CLight (CS)

From AlliedModders Wiki
Revision as of 16:28, 17 May 2009 by Arkshine (talk | contribs) (Added CLight)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Basic Information

  • Classname: CLight.
  • Inheriting Instance : light, light_spot.
  • Description: Point-based light. Simple, effective.


Class Hierarchy


Entity Data

W = Windows | L = Linux

Name W. Offset L. Offset L. Diff Type Description
m_iStyle 34 39 +5 int None.
m_iszPattern 35 40 +5 int None.


Entity Attributes

  • Target (target) - When an entity is activated, it triggers the entity with the name specified by Target.
  • Name (targetname) - Property used to identify entities.
  • Brightness (_light) - First three 3-digit numbers are the color (RGB). The fourth number is the brightness.
  • Apperance (style) - Light appearance. Values:
0 = normal
1 = flicker A
2 = slow strong pulse
3 = candle A
4 = fast strobe
5 = gentle pulse
6 = flicker B
7 = candle B
8 = candle C
9 = slow strobe
10 = fluorescent flicker
11 = slow pulse, no black
  • Custom Apperance (pattern) - Use a string of letters to provide a custom light style (see note).
  • ZHLT Fade (_fade) - 1.0 by default.
  • ZHLT Falloff (_falloff) -
"" : Default
1 : Inverse Linear.
2 : Inverse Square.


Entity Flag

// Spawn Flag
#define SF_LIGHT_START_OFF  1  // Initially dark - If this is enabled, the entity will need to be triggered to work.


Notes

  • The Custom Apperance property allows you to enter a string of letters from a to z, representing brightness. 'a' is dark, 'm' is normal brightness, 'z' is full brightness. If you entered 'abcdefghihgfedcba' then the light would go from bright to dim and back again and then repeat. Complicating things, to use this feature, you must name the light. However, if you then use a trigger to activate it, then it will behave as a normal light.
  • And then... you can't have more than 4 named lights in the same visual area - it'll cause problems while compiling.


HLSDK Reference


Related Links