Beam spotlight: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (categorising)
(Cleanup)
Line 1: Line 1:
{{base point|beam_spotlight}}
==Entity Description==
==Entity Description==
[[File:{{PAGENAME}}.png|left]]
An entity 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. Unless the 'No Dynamic Light' spawnflag is checked, it will also create a dynamic light wherever the end of the spotlight rests.


[[Image:{{PAGENAME}}.png|left]]The '''Beam_spotlight''' [[entity]] creates a cone shaped light "glow" of light reflecting off of fog.  Does not provide any illumination on objects itself, but makes other lightsources, such as a [[light_spot]] look more realistic (treated as an overlay?).  Cone is slightly parabolic, with the apex slightly behind the entity and unrendered.
This spotlight is entirely client side, it is not sync'd across clients.
 
Can be set to rotate for a lighthouse search beam effect.
 
Creates a glare effect when looking directly into the source (not visible from behind, as one would expect).
 
 
==Keyvalues==
* {{KV Targetname}}
 
* {{KV Angles}}
 
* {{KV Parentname}}
 
* '''Color'''
:The color of the beam.  Black makes the beam invisible, so no "Shadow Beams."
 
* '''Disable Receiving Shadows'''
:''Default No''
 
* '''Start Fade Distance'''
:Distance at which the overlay starts to fade (<0 = subtract from fademaxdist).
 
* '''End Fade Distance'''
:Maximum distance at which the overlay is visible (0= don't fade out).
 
* '''Fade Scale'''
:If you specify a fade in the worldspawn, or if the engine is running under low end/medium end/XBox360, then the engine will forcibly fade out the props even if fademindist/fademaxdist isn't specified.  This scale factor gives you some control over the fade.  Using 0 here turns off the forcible fades.  Numbers smaller than 1 cause the prop to fade out at further distances, and greater than 1 cause it to fade out at closer distances.
 
* '''Max Rotation Speed'''
:The maximum rotation speed of the spotlight in degrees per second.  Rotates counter-clockwise (seen from above) if speed is >0.
 
* '''Spotlight Length'''
Length of the spotlight beam.


* '''Spotlight Width'''
{{tip|Can be set to rotate for a lighthouse search beam effect.}}
Width of the spotlight beam at the far end of the cone.  Appears to be the diameter.  Appears to have a maximum width of about 128 units.  How wide the beam actually appears is dependent on the distance to the nearest object (or spotlight length, which ever is closer).  The end of the cone is always the same size, regardless of how far away it is from the source, rather than realistic cone of light being truncated upon meeting a closer object.  Likewise the linear fade from source to end is scaled to fit inside the distance.


* '''HDR color scale'''
== Keyvalues ==
Float value to multiply the sprite color by when running in HDR mode.
{{KV|Max Rotation Speed|integer|The maximum rotation speed of the spotlight, in degrees per second.}}
{{KV|Spotlight Length|integer|Length of the spotlight beam.}}
{{KV|Spotlight Width|integer|Width of the spotlight beam.}}
{{KV|Color (R G B)|color255|The color of the beam. Black makes the beam invisible, so no "Shadow Beams." }}
{{KV|HDR color scale.|float|float value to multiply sprite color by when running in HDR mode.}}
{{KV Targetname}}
{{KV Parentname}}
{{KV RenderFields}}
{{KV Angles}}
{{KV DXLevelChoice}}
{{KV SystemLevelChoice}}


== Flags ==
== Flags ==
 
:* 1 : Start On
* 1:Start On'''
:* 2 : No Dynamic Light
 
:* 4 : Start rotation on
* 2:No Dynamic Light'''
:* 8 : Reverse Direction
 
:* 16 : X Axis
* 4:Start Rotation On'''
:* 32 : Y Axis
 
* 8:Reverse Direction
 
* 16:X Axis
:Causes the light to rotate about the X Axis instead of the Z.
 
* 32:Y Axis
:Causes the light to rotate about the Y Axis instead of the Z.


== Inputs ==
== Inputs ==
 
{{IO|LightOn|Turn the spotlight on.}}
* {{I Targetname}}
{{IO|LightOff|Turn the spotlight off}}
 
{{IO|Start|Start the rotator rotating.}}
* {{I Parentname}}
{{IO|Stop|Stop the rotator from rotating.}}
 
{{IO|Reverse|Reverse the direction of rotation of the rotator.}}
* '''Color'''
{{I Targetname}}
<byte> <byte> <byte> Changes the color of the beam.
{{I Parentname}}
 
{{I RenderFields}}
* '''Alpha'''
<byte> Change the alpha.
 
* '''TurnOn'''
: Turn the light off.
 
* '''TurnOff'''
: Turn the light on.
 
* '''Start'''
:Start the rotator rotating.
 
* '''Stop'''
:Stop the rotator from rotating.
 
* '''Reverse'''
:Reverse the direction of the rotation.


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


* {{O Targetname}}
[[Category:Lighting]]
 
* '''OnLightOn'''
:Fires when the light turns on.
 
* '''OnLightOff'''
:Fires when the light turns off.
 
[[Category:Entities]]
[[Category:Lightning]]

Revision as of 01:49, 11 June 2011

Template:Base point

Entity Description

Beam spotlight.png

An entity 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. Unless the 'No Dynamic Light' spawnflag is checked, it will also create a dynamic light wherever the end of the spotlight rests.

This spotlight is entirely client side, it is not sync'd across clients.

Tip.pngTip:Can be set to rotate for a lighthouse search beam effect.

Keyvalues

Max Rotation Speed ([todo internal name (i)]) <integer>
The maximum rotation speed of the spotlight, in degrees per second.
Spotlight Length ([todo internal name (i)]) <integer>
Length of the spotlight beam.
Spotlight Width ([todo internal name (i)]) <integer>
Width of the spotlight beam.
Color (R G B) ([todo internal name (i)]) <color255>
The color of the beam. Black makes the beam invisible, so no "Shadow Beams."
HDR color scale. ([todo internal name (i)]) <float>
float value to multiply sprite color by when running in HDR mode.
Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Parentname:
Parent (parentname) <targetname>
Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma.

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.
Pitch Yaw Roll (Y Z X) (angles) <QAngle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
Minimum / Maximum DX Level (mindxlevel / maxdxlevel) <integer choices> (removed since Left 4 Dead)
The entity will not exist if the engine is running outside the given range of DirectX Versions.
Choices
Warning.pngWarning:If these are used, the object may break when the user switches their DirectX settings.[missing string]
Minimum / Maximum Effect Details Level (mincpulevel / maxcpulevel) <integer choices> (in all games since Left 4 Dead)
Don't render for players with Effect Details levels that exceed the minimum or maximum.
Choices
  • 0: Default ("Low" for mincpulevel, "High" for maxcpulevel)
  • 1: Low
  • 2: Medium
  • 3: High
Minimum / Maximum Shader Details Level (mingpulevel / maxgpulevel) <integer choices> (in all games since Left 4 Dead)
Don't render for players with Shader Details levels that exceed the minimum or maximum.
Choices
  • 0: Default ("Low" for mingpulevel, "Very High" for maxgpulevel)
  • 1: Low
  • 2: Medium
  • 3: High
  • 4: Very High
See also:  cpu_level / gpu_level convars

Flags

  • 1 : Start On
  • 2 : No Dynamic Light
  • 4 : Start rotation on
  • 8 : Reverse Direction
  • 16 : X Axis
  • 32 : Y Axis

Inputs

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


Parentname:
SetParent <stringRedirectInput/string>
Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment <stringRedirectInput/string>
Change this entity to attach to a specific attachment point on its parent. The entity will teleport so that the position of its root bone matches that of the attachment. Entities must be parented before being sent this input.
SetParentAttachmentMaintainOffset <stringRedirectInput/string>
As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
ClearParent
Removes this entity from the the movement hierarchy, leaving it free to move independently.

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.