Page 1 of 1
How to move a dynamic light thing?
Posted: Mon Feb 01, 2016 2:05 pm
by Chl
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 all
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?
Re: How to move a dynamic light thing?
Posted: Mon Feb 01, 2016 2:53 pm
by Graf Zahl
You need to post a little more info about how you set this up.
Re: How to move a dynamic light thing?
Posted: Mon Feb 01, 2016 3:09 pm
by Chl
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 all
script "Setup" enter
{
Thing_ChangeTID(0, 1000);
....
Code: Select all
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.
Re: How to move a dynamic light thing?
Posted: Mon Feb 01, 2016 3:51 pm
by Graf Zahl
I still cannot test your code fragments.
Re: How to move a dynamic light thing?
Posted: Mon Feb 01, 2016 4:10 pm
by Chl
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?
Re: How to move a dynamic light thing?
Posted: Mon Feb 01, 2016 5:09 pm
by Graf Zahl
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.
Re: How to move a dynamic light thing?
Posted: Mon Feb 01, 2016 5:41 pm
by Chl
Ok, thanks. I actually looked at warp first, but couldn't figure out how to make the light the calling actor...

Re: How to move a dynamic light thing?
Posted: Mon Feb 01, 2016 6:06 pm
by Scotty
Re: How to move a dynamic light thing?
Posted: Mon Feb 01, 2016 6:08 pm
by Graf Zahl
Nevertheless, who designed such a versatile function and forgot something as essential as a parameter to set what actor is supposed to be moved...

Re: How to move a dynamic light thing?
Posted: Mon Feb 01, 2016 6:15 pm
by Chl
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.
Re: How to move a dynamic light thing?
Posted: Mon Feb 01, 2016 7:18 pm
by Chl
Argh, now there's a new problem. The light won't follow or light any sector except the one it spawned in.
Re: How to move a dynamic light thing?
Posted: Tue Feb 02, 2016 4:46 am
by Graf Zahl
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.
Re: How to move a dynamic light thing?
Posted: Tue Feb 02, 2016 8:18 am
by Chl
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.

Re: How to move a dynamic light thing?
Posted: Fri Feb 05, 2016 4:23 pm
by Chl
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?
Re: How to move a dynamic light thing?
Posted: Fri Feb 05, 2016 5:23 pm
by Graf Zahl
As bad as moving any other actor around - meaning not much.