[Added] Spotlights

Moderator: Developers

Re: Spotlights

Postby Gutawer » Wed Jan 24, 2018 8:35 am

https://www.dropbox.com/s/eowuj25tztvc3bk/SpotlightTestMap.wad?dl=0 <- There's a working set of spotlights placed inside a map.
User avatar
Gutawer
User Accounts Assistant
 
Joined: 16 Apr 2016
Discord: Gutawer#3431

Re: Spotlights

Postby AFADoomer » Wed Jan 24, 2018 7:07 pm

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
AFADoomer
 
Joined: 15 Jul 2003

Re: Spotlights

Postby Gutawer » Thu Jan 25, 2018 11:33 am

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
Gutawer
User Accounts Assistant
 
Joined: 16 Apr 2016
Discord: Gutawer#3431

Re: Spotlights

Postby Graf Zahl » Thu Jan 25, 2018 11:57 am

Internally they are the same class as the regular lights so their variables need to be the same, too.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Spotlights

Postby ZZYZX » Sat Feb 03, 2018 11:21 am

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
ZZYZX
le chat du rabbin
 
 
 
Joined: 14 Oct 2012
Location: Ukraine

Re: Spotlights

Postby Graf Zahl » Sat Feb 03, 2018 12:10 pm

It's still a stand-in for the regular args, not some arbitrary parameter that is free for use.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Spotlights

Postby AFADoomer » Sat Feb 03, 2018 12:13 pm

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
AFADoomer
 
Joined: 15 Jul 2003

Re: Spotlights

Postby Gutawer » Sat Feb 03, 2018 2:55 pm

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
Gutawer
User Accounts Assistant
 
Joined: 16 Apr 2016
Discord: Gutawer#3431

Re: Spotlights

Postby Zanieon » Tue Feb 06, 2018 9:46 pm

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
Zanieon
A Tamer of The Dark
 
Joined: 13 Jan 2009
Location: Somewhere in the future
Discord: Zanieon#3177

Re: Spotlights

Postby ZZYZX » Wed Feb 07, 2018 7:23 am

Would work. Spotlights are UDMF-exclusive anyway.
User avatar
ZZYZX
le chat du rabbin
 
 
 
Joined: 14 Oct 2012
Location: Ukraine

Re: Spotlights

Postby Gutawer » Wed Feb 07, 2018 1:21 pm

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
Gutawer
User Accounts Assistant
 
Joined: 16 Apr 2016
Discord: Gutawer#3431

Re: Spotlights

Postby ZZYZX » Wed Feb 07, 2018 1:34 pm

Obviously, but that's GenericLight talk elsewhere. And this is to make the existing stuff work.
User avatar
ZZYZX
le chat du rabbin
 
 
 
Joined: 14 Oct 2012
Location: Ukraine

Re: Spotlights

Postby Zanieon » Tue Feb 13, 2018 7:34 am

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
Zanieon
A Tamer of The Dark
 
Joined: 13 Jan 2009
Location: Somewhere in the future
Discord: Zanieon#3177

Re: Spotlights

Postby Rachael » Tue Feb 13, 2018 10:02 am

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
Rachael
QZDoom + Webmaster
 
Joined: 13 Jan 2004

Re: Spotlights

Postby ZZYZX » Wed Feb 14, 2018 1:17 pm

Users should NOT inherit internal dynamic lights. And GLDEFS spotlights don't use any actor properties.
User avatar
ZZYZX
le chat du rabbin
 
 
 
Joined: 14 Oct 2012
Location: Ukraine

Previous

Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 2 guests