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.
Locked
User avatar
Chl
Posts: 219
Joined: Sat Dec 05, 2015 2:18 pm

How to move a dynamic light thing?

Post 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?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49225
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: How to move a dynamic light thing?

Post by Graf Zahl »

You need to post a little more info about how you set this up.
User avatar
Chl
Posts: 219
Joined: Sat Dec 05, 2015 2:18 pm

Re: How to move a dynamic light thing?

Post 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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49225
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: How to move a dynamic light thing?

Post by Graf Zahl »

I still cannot test your code fragments.
User avatar
Chl
Posts: 219
Joined: Sat Dec 05, 2015 2:18 pm

Re: How to move a dynamic light thing?

Post 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?
Attachments
MAP01.wad
(2.1 KiB) Downloaded 47 times
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49225
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: How to move a dynamic light thing?

Post 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.
User avatar
Chl
Posts: 219
Joined: Sat Dec 05, 2015 2:18 pm

Re: How to move a dynamic light thing?

Post by Chl »

Ok, thanks. I actually looked at warp first, but couldn't figure out how to make the light the calling actor... :(
User avatar
Scotty
Posts: 35
Joined: Tue Mar 24, 2009 10:43 pm

Re: How to move a dynamic light thing?

Post by Scotty »

This should help you out.

http://zdoom.org/wiki/SetActivator
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49225
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: How to move a dynamic light thing?

Post 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... :?
User avatar
Chl
Posts: 219
Joined: Sat Dec 05, 2015 2:18 pm

Re: How to move a dynamic light thing?

Post by Chl »

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
Posts: 219
Joined: Sat Dec 05, 2015 2:18 pm

Re: How to move a dynamic light thing?

Post by Chl »

Argh, now there's a new problem. The light won't follow or light any sector except the one it spawned in.
Attachments
MAP01.wad
(5.6 KiB) Downloaded 54 times
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49225
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: How to move a dynamic light thing?

Post 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.
User avatar
Chl
Posts: 219
Joined: Sat Dec 05, 2015 2:18 pm

Re: How to move a dynamic light thing?

Post 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. :)
User avatar
Chl
Posts: 219
Joined: Sat Dec 05, 2015 2:18 pm

Re: How to move a dynamic light thing?

Post 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?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49225
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: How to move a dynamic light thing?

Post by Graf Zahl »

As bad as moving any other actor around - meaning not much.
Locked

Return to “Editing (Archive)”