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.
User avatar
Logan MTM
Posts: 677
Joined: Mon Jan 16, 2006 8:53 pm
Location: Rio de Janeiro - Brazil

SpotLight Doc?

Post by Logan MTM »

Hi everyone!

Where can i find documentation of SpotLights?

Thank you all!
User avatar
Kappes Buur
 
 
Posts: 4007
Joined: Thu Jul 17, 2003 12:19 am
Location: British Columbia, Canada

Re: SpotLight Doc?

Post by Kappes Buur »

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
User avatar
Logan MTM
Posts: 677
Joined: Mon Jan 16, 2006 8:53 pm
Location: Rio de Janeiro - Brazil

Re: SpotLight Doc?

Post by Logan MTM »

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
AFADoomer
Posts: 1240
Joined: Tue Jul 15, 2003 4:18 pm

Re: SpotLight Doc?

Post by AFADoomer »

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
Posts: 677
Joined: Mon Jan 16, 2006 8:53 pm
Location: Rio de Janeiro - Brazil

Re: SpotLight Doc?

Post by Logan MTM »

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
Misery
Posts: 156
Joined: Sun Nov 04, 2018 4:57 pm

Re: SpotLight Doc?

Post by Misery »

Don't spawn it, then. Place it first as dormant, then simply activate it via ACS.
User avatar
Logan MTM
Posts: 677
Joined: Mon Jan 16, 2006 8:53 pm
Location: Rio de Janeiro - Brazil

Re: SpotLight Doc?

Post by Logan MTM »

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
AFADoomer
Posts: 1240
Joined: Tue Jul 15, 2003 4:18 pm

Re: SpotLight Doc?

Post by AFADoomer »

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
Logan MTM
Posts: 677
Joined: Mon Jan 16, 2006 8:53 pm
Location: Rio de Janeiro - Brazil

Re: SpotLight Doc?

Post by Logan MTM »

I really can't see how UserVariables deal with Thing Specials :?
User avatar
AFADoomer
Posts: 1240
Joined: Tue Jul 15, 2003 4:18 pm

Re: SpotLight Doc?

Post by AFADoomer »

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 all

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
Logan MTM
Posts: 677
Joined: Mon Jan 16, 2006 8:53 pm
Location: Rio de Janeiro - Brazil

Re: SpotLight Doc?

Post by Logan MTM »

Holly!
I really like to know that!

#Magic!

Thank you so much! :D

Return to “Mapping”