CBeam

From Source Entities
Jump to navigation Jump to search

Code classes:

CBeam is a class inherited by beam/laser entities. Glitters in the dark near the Tannhauser Gate.

Classnames:

Bug: In very rare cases a beam may behave oddly if its name matches a beam used by a viewmodel. Changing the name can fix the problem.

Flags[edit | edit source]

  • 1: Start On
  • 2: Toggle (Obsolete. Used in GoldSrc for turning the beam on and off. Use the Toggle input instead.)
  • 16: StartSparks (Every time the beam strikes or is turned on, the beam temporarily emits a small shower of sparks at its starting point.)
  • 32: EndSparks (Every time the beam strikes or is turned on, the beam temporarily emits a small shower of sparks at its ending point. For env_laser this will not show unless it reaches its endpoint.)
  • 64: Decal End (Places a decal scorch mark where a damaging beam hits the first solid object (world brush or entity). For env_beam refer to the Decal Name keyvalue to set the decal you wish to appear at the end of the beam. This isn't recommended for env_laser because the decal cannot be changed.)

Keyvalues[edit | edit source]

Brightness (1 - 255) (renderamt) <integer>
Misleading name! Beam transparency. Invisible when set to 0.
Beam Color (R G B) (rendercolor) <color255>
Beam color.
HDR color scale (HDRColorScale) <float>
Value to multiply sprite color by when running in HDR mode.
Damage/second (damage) <integer>
How much damage this beam does per second to things it hits when it is continually on, or instantaneously if it strikes. For continuous damage, the value should be greater than 10 or it may not work.
Note: In Hl2.png the damage amount is scaled depending on the difficulty setting.
Dissolve Type (dissolvetype) <choices>
If this beam damages and kills something, effects to show around the object. Note: Only fully functional in Hl2.png&DM. In all other games, the only effect is sparks with 1 and 2 or none with -1 and 0.
  • -1: None
  • 0: Energy
  • 1: Heavy Electrical
  • 2: Light Electrical

Inputs[edit | edit source]

Width <float>
Sets the radius of the beam (i.e. 1 = 2 world units total thickness). The FGDs say this is measured in pixels and that's false.[Confirmed]
Noise <float>
Sets how far away from the middle that the beam is allowed to deviate.
ColorRedValue <integer>
Sets how red the beam is (0-255). The resulting color will be affected by any color in the base texture, so only hueless textures will be able to show the full color spectrum.
ColorGreenValue <integer>
Sets how green the beam is (0-255).
ColorBlueValue <integer>
Sets how blue the beam is (0-255).
Alpha <integer>
Sets Brightness.
Color <color255>
Sets the Beam Color.