SpotLight Doc?

Ask about mapping, UDMF, using DoomBuilder/editor of choice, etc, here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

SpotLight Doc?

Postby Logan MTM » Tue Dec 15, 2020 8:20 pm

Hi everyone!

Where can i find documentation of SpotLights?

Thank you all!
User avatar
Logan MTM
I can see you...
 
Joined: 16 Jan 2006
Location: Rio de Janeiro - Brazil

Re: SpotLight Doc?

Postby Kappes Buur » Wed Dec 16, 2020 9:07 pm

For documentation do a search for Spotlight.
Support for dynamic spotlights is only available in GZDBBF and UDB,




But setting the colour of inner and outer angles can be tricky:
forum.zdoom.org/viewtopic.php?f=123&t=68084&p=1160930
etc
User avatar
Kappes Buur
 
 
 
Joined: 17 Jul 2003
Location: British Columbia, Canada

Re: SpotLight Doc?

Postby Logan MTM » Thu Dec 17, 2020 6:04 am

Thank you.
Interesting, I'm getting the exact same problem. I just want change the spotlight color via ACS.
The spotlight color always turn red. I don't get how Jaska solve this problem anyway :(
#PM hin
User avatar
Logan MTM
I can see you...
 
Joined: 16 Jan 2006
Location: Rio de Janeiro - Brazil

Re: SpotLight Doc?

Postby AFADoomer » Thu Dec 17, 2020 11:50 am

To change the color in-game, try using the first three args as R, G, B, like you would any other dynamic light.

Basically, the spotlight's arguments get shuffled around and rewritten when it actually spawns in the game. The inner and outer angles are stored in internal variables, and the first three arguments become the RGB color values.
User avatar
AFADoomer
 
Joined: 15 Jul 2003

Re: SpotLight Doc?

Postby Logan MTM » Thu Dec 17, 2020 7:48 pm

AFADoomer wrote:To change the color in-game, try using the first three args as R, G, B, like you would any other dynamic light.

Basically, the spotlight's arguments get shuffled around and rewritten when it actually spawns in the game. The inner and outer angles are stored in internal variables, and the first three arguments become the RGB color values.


User avatar
Logan MTM
I can see you...
 
Joined: 16 Jan 2006
Location: Rio de Janeiro - Brazil

Re: SpotLight Doc?

Postby Misery » Thu Dec 17, 2020 9:18 pm

Don't spawn it, then. Place it first as dormant, then simply activate it via ACS.
User avatar
Misery
 
Joined: 04 Nov 2018

Re: SpotLight Doc?

Postby Logan MTM » Fri Dec 18, 2020 8:18 am

It's really a simple solution. But, any No LOSII map will lose important lights. Yeah, I think I really don't care much about it.
User avatar
Logan MTM
I can see you...
 
Joined: 16 Jan 2006
Location: Rio de Janeiro - Brazil

Re: SpotLight Doc?

Postby AFADoomer » Fri Dec 18, 2020 10:32 am

Spawn it and set the color with the first three args and intensity with the 4th arg using SetThingSpecial, then set the SpotInnerAngle and SpotOuterAngle variables with SetUserVariable.

Untested, but should work.
User avatar
AFADoomer
 
Joined: 15 Jul 2003

Re: SpotLight Doc?

Postby Logan MTM » Fri Dec 18, 2020 12:22 pm

I really can't see how UserVariables deal with Thing Specials :?
User avatar
Logan MTM
I can see you...
 
Joined: 16 Jan 2006
Location: Rio de Janeiro - Brazil

Re: SpotLight Doc?

Postby AFADoomer » Fri Dec 18, 2020 2:05 pm

The whole argument shuffling thing that I mentioned earlier?
Logan MTM wrote:
AFADoomer wrote:The inner and outer angles are stored in internal variables, and the first three arguments become the RGB color values.


For a standard, editor-placed spotlight, the arguments are:
- color
- inner angle
- outer angle
- intensity

When the light is loaded in the game (so, what you end up with after your Spawn call), the arguments have been shuffled around:
- red amount
- green amount
- blue amount
- intensity

*and* the inner angle and outer angle values are written to the SpotInnerAngle and SpotOuterAngle variables internal to the light actor.

This second version of the arguments is what you are working with in ACS, so with what you are trying to do you have to set the arguments according to that pattern.

If you want to modify (or set) the inner/outer angle value, you have to modify the variable values directly. SetUserVariable is used to modify any numeric internal actor variable, not just 'user_' variables.

So something like this:
Code: Select allExpand view
SetThingSpecial(5101, 0, 0, 255, 0, 1024);
SetUserVariable(5101, "SpotInnerAngle", 20.0);
SetUserVariable(5101, "SpotOuterAngle", 45.0);

Gives you a green spotlight that has a cone that fades between 20 degrees and 45 degrees from the centerline of the light.

EDIT: Was missing decimal points on the angles.
User avatar
AFADoomer
 
Joined: 15 Jul 2003

Re: SpotLight Doc?

Postby Logan MTM » Fri Dec 18, 2020 7:22 pm

Holly!
I really like to know that!

#Magic!

Thank you so much! :D
User avatar
Logan MTM
I can see you...
 
Joined: 16 Jan 2006
Location: Rio de Janeiro - Brazil


Return to Mapping

Who is online

Users browsing this forum: No registered users and 0 guests