How to move a dynamic light thing?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.

How to move a dynamic light thing?

Postby Chl » Mon Feb 01, 2016 2:05 pm

So I want to create an effect where a dynamic lights colour and intensity can be smoothly increased/decreased with a script. After searching the forum this can apparently be done with Thing_SetSpecial. The problem is that I want the light on a player so I tried to have a light on the map follow the player with a script.
Code: Select allExpand view
SetActorPosition(1001, GetActorX(1000), GetActorY(1000), GetActorZ(1000)+16.0, 0);
Thing_Move(1001, 1000, 1);

Now, neither of those two work. They move things, as long as it's NOT a dynamic light. Why doesn't that work?
User avatar
Chl
 
Joined: 05 Dec 2015

Re: How to move a dynamic light thing?

Postby Graf Zahl » Mon Feb 01, 2016 2:53 pm

You need to post a little more info about how you set this up.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: How to move a dynamic light thing?

Postby Chl » Mon Feb 01, 2016 3:09 pm

Well, I don't think there is anything wrong with how I set it up because it works for regular things, unless there is something specific I must do for lights.
Code: Select allExpand view
script "Setup" enter
{
    Thing_ChangeTID(0, 1000);
     ....

Code: Select allExpand view
script "Lightinside" OPEN
 {
    while (1) {
       //SetActorPosition(1001, GetActorX(1000), GetActorY(1000), GetActorZ(1000)+16.0, 0);
       Thing_Move(1001, 1000, 1);
       Delay(1);
       
    }
}

On the map I have a Type 9800 thing with tag 1001.
User avatar
Chl
 
Joined: 05 Dec 2015

Re: How to move a dynamic light thing?

Postby Graf Zahl » Mon Feb 01, 2016 3:51 pm

I still cannot test your code fragments.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: How to move a dynamic light thing?

Postby Chl » Mon Feb 01, 2016 4:10 pm

I think I found the problem. I made a new map with the same script and it worked, just to suddenly stop working. Turns out the light wont move if its intensity radius hits a wall, and in my map its very narrow. How can I get around this?
You do not have the required permissions to view the files attached to this post.
User avatar
Chl
 
Joined: 05 Dec 2015

Re: How to move a dynamic light thing?

Postby Graf Zahl » Mon Feb 01, 2016 5:09 pm

The most versatile function for moving an actor is Warp.

That one allows to set a flag so that the position is not checked. Dynamic lights set their radius to the dimensions of the light so that it can be used to detect affected surfaces, so the regular move functions all won't really work.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: How to move a dynamic light thing?

Postby Chl » Mon Feb 01, 2016 5:41 pm

Ok, thanks. I actually looked at warp first, but couldn't figure out how to make the light the calling actor... :(
User avatar
Chl
 
Joined: 05 Dec 2015

Re: How to move a dynamic light thing?

Postby Scotty » Mon Feb 01, 2016 6:06 pm

This should help you out.

http://zdoom.org/wiki/SetActivator
User avatar
Scotty
 
Joined: 24 Mar 2009

Re: How to move a dynamic light thing?

Postby Graf Zahl » Mon Feb 01, 2016 6:08 pm

Nevertheless, who designed such a versatile function and forgot something as essential as a parameter to set what actor is supposed to be moved... :?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: How to move a dynamic light thing?

Postby Chl » Mon Feb 01, 2016 6:15 pm

Epic wrote:This should help you out.

http://zdoom.org/wiki/SetActivator
Cool, thanks. :)
Graf Zahl wrote:Nevertheless, who designed such a versatile function and forgot something as essential as a parameter to set what actor is supposed to be moved... :?
I thought that was strange too, but since I don't know programming I thought it was for a good reason.
User avatar
Chl
 
Joined: 05 Dec 2015

Re: How to move a dynamic light thing?

Postby Chl » Mon Feb 01, 2016 7:18 pm

Argh, now there's a new problem. The light won't follow or light any sector except the one it spawned in.
You do not have the required permissions to view the files attached to this post.
User avatar
Chl
 
Joined: 05 Dec 2015

Re: How to move a dynamic light thing?

Postby Graf Zahl » Tue Feb 02, 2016 4:46 am

I'm afraid, for that you'll have to wait for the next GZDoom devbuild. Turns out that the light list was not updated when a light got moved around.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: How to move a dynamic light thing?

Postby Chl » Tue Feb 02, 2016 8:18 am

Graf Zahl wrote:I'm afraid, for that you'll have to wait for the next GZDoom devbuild. Turns out that the light list was not updated when a light got moved around.
That's ok, this mod won't be done in a long while yet. Just that you're fixing stuff like this is great. :)
User avatar
Chl
 
Joined: 05 Dec 2015

Re: How to move a dynamic light thing?

Postby Chl » Fri Feb 05, 2016 4:23 pm

With the newest GZD this method works perfectly. It's so much easier to change light properties than fiddling around in GLDEFS.

The question is though, how tough on the resources is this method?
User avatar
Chl
 
Joined: 05 Dec 2015

Re: How to move a dynamic light thing?

Postby Graf Zahl » Fri Feb 05, 2016 5:23 pm

As bad as moving any other actor around - meaning not much.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Editing (Archive)

Who is online

Users browsing this forum: alanw89 and 1 guest