Spotlights

Moderator: GZDoom Developers

User avatar
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

Re: Spotlights

Post by Gutawer »

https://www.dropbox.com/s/eowuj25tztvc3 ... p.wad?dl=0 <- There's a working set of spotlights placed inside a map.
User avatar
AFADoomer
Posts: 1324
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

Re: Spotlights

Post by AFADoomer »

Thanks to both of you! I feel kind of dumb now - I wasn't including args[3] (intensity value).

This also confused me in part of my testing:
Graf Zahl wrote:Args[0] is the full RGB color, Args[1] is the inner and Args[2] is the outer angle.

Alternatively you can set arg0str to a color name, this will also work for regular lights.
This seems to only work this way from within the editor. If you want to manipulate the values directly in an actor via ZScript, Args 0/1/2 are still RGB, just like in other normal dynamic lights, and the inner/outer angle must be set via their respective properties.
User avatar
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

Re: Spotlights

Post by Gutawer »

Yeah, it's a bit strange but to be perfectly honest I prefer it this way. Makes editing dynamic lights more consistent in ZScript, and also keeps the SpotInnerAngle and SpotOuterAngle variables in tact which have a nicer name than the alternatives (args[1] and args[2]).
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Spotlights

Post by Graf Zahl »

Internally they are the same class as the regular lights so their variables need to be the same, too.
User avatar
ZZYZX
 
 
Posts: 1384
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine
Contact:

Re: Spotlights

Post by ZZYZX »

Graf Zahl wrote:Alternatively you can set arg0str to a color name
Where did this thread go where you called it a gross hack to use arg0str for anything else than script name for ACS specials? :roll:
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Spotlights

Post by Graf Zahl »

It's still a stand-in for the regular args, not some arbitrary parameter that is free for use.
User avatar
AFADoomer
Posts: 1324
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

Re: Spotlights

Post by AFADoomer »

If only UDMF user variables weren't all just assumed to be integers when parsed, and strings could be passed in from the editor... ;-)
User avatar
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

Re: Spotlights

Post by Gutawer »

I've just noticed a fairly major issue with pulse and flicker spotlights. Pulsing/flickering lights use angles for pulse period, and spot lights use angle for, well, light angle. That means that you can't have a pulsing/flickering spot light with controllable angle and period, making them fairly useless in my eyes. No idea how that could be fixed, though - goddamn old ZDoom hacks!

EDIT: Oh, and also, looks like I defined DoomEdNum 9854 wrong when adding the actors - it's SpotLightFlickerRandomSubtractive when it should be SpotLightFlickerRandomAdditive.
User avatar
Zanieon
Posts: 2059
Joined: Tue Jan 13, 2009 4:13 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Somewhere in the future
Contact:

Re: Spotlights

Post by Zanieon »

Gutawer wrote:I've just noticed a fairly major issue with pulse and flicker spotlights. Pulsing/flickering lights use angles for pulse period, and spot lights use angle for, well, light angle. That means that you can't have a pulsing/flickering spot light with controllable angle and period, making them fairly useless in my eyes. No idea how that could be fixed, though - goddamn old ZDoom hacks!
Swap the propery of using Angle with Roll instead? Roll has really no use for actors such as Dynamic Lights even for Spot Lights.
User avatar
ZZYZX
 
 
Posts: 1384
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine
Contact:

Re: Spotlights

Post by ZZYZX »

Would work. Spotlights are UDMF-exclusive anyway.
User avatar
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

Re: Spotlights

Post by Gutawer »

While that'd probably work, it seems like yet another hack that doesn't really fix the root of the problem (fields being completely misappropriated) and instead just sidesteps it. It'd also completely break as a solution if GZDoom decides to implement something like light cookies on dynamic lights later on down the line - which I know has been mentioned before (though I'm certainly not expecting it to become a reality soon or anything) - since in that case, roll does matter as it affects the cookie's rotation. The real solution is to come up with something better and more robust so this never has to be dealt with again. The original cause of the angle hack would have been the exact same reasoning - "dynamic lights will never need to use angle for anything".
User avatar
ZZYZX
 
 
Posts: 1384
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine
Contact:

Re: Spotlights

Post by ZZYZX »

Obviously, but that's GenericLight talk elsewhere. And this is to make the existing stuff work.
User avatar
Zanieon
Posts: 2059
Joined: Tue Jan 13, 2009 4:13 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Somewhere in the future
Contact:

Re: Spotlights

Post by Zanieon »

Okay coming up with better ideas then, since it is UDMF exclusive, Spotlights can pick their colors from the Color field of the Rendering properties instead of having a separate field as an argument, then that argument which is actually the color field can be the flicker/pulse light periods.
User avatar
Rachael
Posts: 13557
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Spotlights

Post by Rachael »

Problem with that is, an actor can also be a spotlight, and that would reduce the usability of the colour field because it would be tied to both the actor's stencil colour if used as well as its light colour, and you may not want those two linked.
User avatar
ZZYZX
 
 
Posts: 1384
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine
Contact:

Re: Spotlights

Post by ZZYZX »

Users should NOT inherit internal dynamic lights. And GLDEFS spotlights don't use any actor properties.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”