SpotLight Doc?
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.
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?
Hi everyone!
Where can i find documentation of SpotLights?
Thank you all!
Where can i find documentation of SpotLights?
Thank you all!
- Kappes Buur
-
- Posts: 4120
- Joined: Thu Jul 17, 2003 12:19 am
- Graphics Processor: nVidia (Legacy GZDoom)
- Location: British Columbia, Canada
- Contact:
Re: SpotLight Doc?
For documentation do a search for Spotlight.
Support for dynamic spotlights is only available in GZDBBF and UDB,
[imgur]https://i.imgur.com/PjNIhyC[/imgur]
[imgur]https://i.imgur.com/dqD3iV3[/imgur]
But setting the colour of inner and outer angles can be tricky:
forum.zdoom.org/viewtopic.php?f=123&t=68084&p=1160930
etc
Support for dynamic spotlights is only available in GZDBBF and UDB,
[imgur]https://i.imgur.com/PjNIhyC[/imgur]
[imgur]https://i.imgur.com/dqD3iV3[/imgur]
But setting the colour of inner and outer angles can be tricky:
forum.zdoom.org/viewtopic.php?f=123&t=68084&p=1160930
etc
Re: SpotLight Doc?
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
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
Re: SpotLight Doc?
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.
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.
Re: SpotLight Doc?
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.
Re: SpotLight Doc?
Don't spawn it, then. Place it first as dormant, then simply activate it via ACS.
Re: SpotLight Doc?
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.
Re: SpotLight Doc?
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.
Untested, but should work.
Re: SpotLight Doc?
I really can't see how UserVariables deal with Thing Specials
Re: SpotLight Doc?
The whole argument shuffling thing that I mentioned earlier?
- 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:
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.
For a standard, editor-placed spotlight, the arguments are: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.
- 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 all
SetThingSpecial(5101, 0, 0, 255, 0, 1024);
SetUserVariable(5101, "SpotInnerAngle", 20.0);
SetUserVariable(5101, "SpotOuterAngle", 45.0);
EDIT: Was missing decimal points on the angles.
Re: SpotLight Doc?
Holly!
I really like to know that!
#Magic!
Thank you so much!
I really like to know that!
#Magic!
Thank you so much!