Beam spotlight: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Added that this entity is also available in Garry's Mod, as of latest update)
(-added class hierarchy, cleanup)
Line 1: Line 1:
{{lang|Beam spotlight}}
{{lang|Beam spotlight}}
{{CD|CBeamSpotlight|file1=beamspotlight.cpp}}
{{base point|beam_spotlight|sprites=1|since=Left 4 Dead}} It is used to draw a spotlight. Will draw a beam when the player views it side on, and a halo when it's facing towards the player. It will also create a dynamic light wherever the end of the spotlight rests. Other than its ability to rotate, this entity is functionally identical to {{ent|point_spotlight}}.
{{base point|beam_spotlight|sprites=1|since=Left 4 Dead}} It is used to draw a spotlight. Will draw a beam when the player views it side on, and a halo when it's facing towards the player. It will also create a dynamic light wherever the end of the spotlight rests. Other than its ability to rotate, this entity is functionally identical to {{ent|point_spotlight}}.


Line 6: Line 7:


{{idea|Can be set to rotate for a lighthouse search beam effect.}}
{{idea|Can be set to rotate for a lighthouse search beam effect.}}
{{code class|CBeamSpotlight|beamspotlight.cpp}}


==Flags==
==Flags==
*1: Start On
{{fl|1|Start On|}}
*2: No Dynamic Light - Do not create any actual light.
{{fl|2|No Dynamic Light - Do not create any actual light.|}}
*4: Start with Rotation On
{{fl|4|Start with Rotation On|}}
*8: Reverse Direction
{{fl|8|Reverse Direction|}}
*16: X Axis ({{clarify}} are these axes relative to the world or to the entity?)
{{fl|16|X Axis|}}
*32: Y Axis
{{fl|32|Y Axis|}}
({{clarify}} are these axes relative to the world or to the entity?)


==Keyvalues==
==Keyvalues==
{{KV|Max Rotation Speed (maxspeed)|integer|The maximum rotation speed of the spotlight, in degrees per second.}}
{{KV|Max Rotation Speed|intn=maxspeed|integer|The maximum rotation speed of the spotlight, in degrees per second.}}
{{KV|Spotlight Length (SpotlightLength)|integer|Length of the spotlight beam.}}
{{KV|Spotlight Length|intn=SpotlightLength|integer|Length of the spotlight beam.}}
{{KV|Spotlight Width (SpotlightWidth)|integer|Width of the spotlight beam.}}
{{KV|Spotlight Width|intn=SpotlightWidth|integer|Width of the spotlight beam.}}
{{KV|HDR color scale (HDRColorScale)|float|Multiplier for sprite color by when running in HDR mode.}}
{{KV|HDR color scale|intn=HDRColorScale|float|Multiplier for sprite color by when running in HDR mode.}}
{{KV|Halo Sprite (HaloSprite)|sprite|The material that should be used for the halo. {{l4d}} only.}}
{{KV|Halo Sprite|intn=HaloSprite|sprite|The material that should be used for the halo.|only=l4d}}
{{KV|Beam Sprite (BeamSprite)|sprite|The material that should be used for the beam. {{l4d}} only.}}
{{KV|Beam Sprite|intn=BeamSprite|sprite|The material that should be used for the beam.|only=l4d}}
{{KV RenderFields}}
{{KV RenderFields}}
{{KV SystemLevelChoice}}
{{KV BaseEntity}}


==Inputs==
==Inputs==
Line 35: Line 33:
{{IO|Reverse|Reverse the direction of rotation.}}
{{IO|Reverse|Reverse the direction of rotation.}}
{{I RenderFields}}
{{I RenderFields}}
{{I BaseEntity}}


==Outputs==
==Outputs==
{{IO|OnLightOn|Fires when light turns on.}}
{{IO|OnLightOn|Fires when light turns on.}}
{{IO|OnLightOff|Fires when light turns off.}}
{{IO|OnLightOff|Fires when light turns off.}}
{{O BaseEntity|l4d=1}}


[[Category:Lighting]]
[[Category:Lighting]]

Revision as of 01:38, 24 November 2022

English (en)Русский (ru)Translate (Translate)
C++ Class hierarchy
CBeamSpotlight
CBaseEntity
C++ beamspotlight.cpp

Template:Base point It is used to draw a spotlight. Will draw a beam when the player views it side on, and a halo when it's facing towards the player. It will also create a dynamic light wherever the end of the spotlight rests. Other than its ability to rotate, this entity is functionally identical to point_spotlight.

Note.pngNote:This spotlight is entirely client side, and rotation may be desynchronized between clients.
Note.pngNote:This entity is also available in Garry's Mod Garry's Mod .
Tip.pngIdea:Can be set to rotate for a lighthouse search beam effect.

Flags

Start On : [1]
No Dynamic Light - Do not create any actual light. : [2]
Start with Rotation On : [4]
Reverse Direction : [8]
X Axis : [16]
Y Axis : [32]

([Clarify] are these axes relative to the world or to the entity?)

Keyvalues

Max Rotation Speed (maxspeed) <integer>
The maximum rotation speed of the spotlight, in degrees per second.
Spotlight Length (SpotlightLength) <integer>
Length of the spotlight beam.
Spotlight Width (SpotlightWidth) <integer>
Width of the spotlight beam.
HDR color scale (HDRColorScale) <float>
Multiplier for sprite color by when running in HDR mode.
Halo Sprite (HaloSprite) <sprite> (only in Left 4 Dead)
The material that should be used for the halo.
Beam Sprite (BeamSprite) <sprite> (only in Left 4 Dead)
The material that should be used for the beam.

RenderFields:


Render Mode (rendermode) <byte choices>
Set a non-standard rendering mode on this entity.
Render Modes
  • 0: Normal
  • 1: Color
  • 2: Texture
  • 3: Glow
  • 4: Solid/Alphatest Obsolete
  • 5: Additive
  • 6: Removed, does nothing Obsolete
  • 7: Additive Fractional Frame
  • 8: Alpha Add
  • 9: World Space Glow
  • 10: Don't Render
Render FX (renderfx) <byte choices>
Various somewhat legacy alpha effects. See render effects.
Render Amount / Transparency (renderamt) <byte>
Transparency amount, requires a Render Mode other than Normal. 0 is invisible, 255 is fully visible.
Render Color (R G B) (rendercolor) <color255>
Color tint.

Inputs

LightOn
Turn the spotlight on.
LightOff
Turn the spotlight off
Start
Start rotating.
Stop
Stop rotating.
Reverse
Reverse the direction of rotation.

RenderFields:

Alpha <integer 0–255>
Sets the entity's transparency to a number from 0 (invisible) to 255 (fully visible). Requires the entity to have its rendermode set to a number other than 0.
Color <color255RedirectInput/color32>
Sets an RGB color for the entity.

Outputs

OnLightOn
Fires when light turns on.
OnLightOff
Fires when light turns off.