Point spotlight: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
Line 31: Line 31:
== Inputs ==
== Inputs ==
{{IO|LightOn|Turn the spotlight on.}}
{{IO|LightOn|Turn the spotlight on.}}
{{IO|LightOff|Turn the spotlight off}}
{{IO|LightOff|Turn the spotlight off.}}
{{IO|SetColor|Change the color of the spotlight|param=color255|since=AS}}
{{IO|SetColor|Change the color of the spotlight. Light must be turned off then back on before changes take effect.|param=color255}}
{{IO|ForceUpdate|Force an update of the spotlight position and orientation|since=AS}}
{{IO|ForceUpdate|Force an update of the spotlight position and orientation.|since=AS}}
{{I Targetname}}
{{I Targetname}}
{{I Parentname}}
{{I Parentname}}

Revision as of 06:19, 3 June 2015

Template:Base point It is a light_dynamic with two glow sprite effects: a beam effect for viewers outside the light cone and a halo effect for viewers inside the cone.

  • If the 'No Dynamic Light' spawn flag is checked this entity will just provide a sprite effects, and will not illuminate other objects.

By default point_spotlight is told to use the material sprites/glow_test02.vmt. You can change this if you are shipping your own binaries by going into point_spotlight.cpp in the server project, navigating to line 351 and replacing:

m_hSpotlight = CBeam::BeamCreate( "sprites/glow_test02.vmt", m_flSpotlightGoalWidth );

There you can define your own material.

Todo: Define a way to set a custom materials through this ents keyvalues


A point_spotlight.

Keyvalues

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>
Spotlight color.
HDR color scale. ([todo internal name (i)]) <float>
float value to multiply sprite color by when running in HDR mode.
Halo size scale. ([todo internal name (i)]) <float> (in all games since Left 4 Dead 2)
float value to determine the size of the halo.
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

Inputs

LightOn
Turn the spotlight on.
LightOff
Turn the spotlight off.
SetColor <color255RedirectInput/color32>
Change the color of the spotlight. Light must be turned off then back on before changes take effect.
ForceUpdate  (in all games since Alien Swarm)
Force an update of the spotlight position and orientation.


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.


See also