env_beam

From Source Entities
Jump to navigation Jump to search

Code classes:

env_beam is a point entity present in all Source games. It creates a visible energy beam running between two entities.

Bug: Parenting might break the entity.

Fix: Try env_laser or logic_measure_movement.

Bug: In Tf2.png, info_target, info_landmark and path_corner are known to not be valid Start or Ending Entities. This is probably due to a typo.

Fix: Use info_teleport_destination instead.

Usage Notes[edit | edit source]

The start and end must be point entities with no sprite or model. They cannot be internal entities or any other entity that could remove itself automatically, like info_null. If both the start and end point entities are destroyed in-game, the beam will no longer work. A beam can use itself as a start or end point.

Developers can specify a group of multiple starting/ending entities by giving them the same name. The env_beam will then randomly select one of these entities to use for each strike. If entity names for either points is omitted, a random point on a solid surface within the radius (specified in its Radius property) will be selected for each strike instead. If both points are omitted, the center will be the env_beam entity itself. Such randomized beams do not cause damage.

The beam will always visibly run from start to end, even through solid brushes. The beam's damage will be absorbed by the first solid thing it hits. If Life is greater than 0, the beam will deal this damage only once, while a permanent beam (Life at 0) will inflict damage gradually.

Flags[edit | edit source]

  • 4: Random Strike (Once the beam has died, it will strike again randomly with a time variance set by Strike again time.)
  • 8: Ring - Doesn't work.
  • 128: Shade Start (The beam fades out toward its Start Entity. Overrides Shade End. Does not work on striking beams.)
  • 256: Shade End (The beam fades out toward its Ending Entity. Is overridden by Shade Start. Does not work on striking beams.)
  • 512: Taper Out (Makes the beam taper out into a point towards its Ending Entity. Does not work on striking beams.)

Keyvalues[edit | edit source]

Start Entity (LightningStart) <target_destination>
Entity that the beam starts at. If omitted the entity will instead use a random position on any surface within its Radius value. A new random position will be appointed for every strike. See usage note above.
Ending Entity (LightningEnd) <target_destination>
Entity that the beam ends at. If omitted the entity will instead use a random position on any surface within its Radius value. A new random position will be appointed for every strike.
Life (life) <float>
Amount of time before the beam dies. Setting to zero will make the beam stay forever.
Width of beam (BoltWidth) <float>
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]
Amount of noise (NoiseAmplitude) <float>
The amount of noise in the beam. 0 is a perfectly straight beam, and high values are very jagged.
Texture Scroll Rate (TextureScroll) <integer>
Rate at which the beam texture should scroll along the beam.
Strike again time (StrikeTime) <float>
Time between random strikes of the beam.
Sprite Name (texture) <sprite>
The material used to draw the beam.
Starting Frame (framestart) <integer>
The frame to start the beam texture on.
Radius (Radius) <float>
If the Random Strike spawnflag is set, this radius determines the area within which the endpoints will randomly strike.
Frames per 10 seconds (framerate) <integer>
Does not exist in code.
Touch Type (TouchType) <choices>
If the beam is touched by an entity fitting this criteria, the OnTouchedByEntity output will fire.
  • 0: Not a tripwire (all entities ignored)
  • 1: Player Only
  • 2: NPC Only
  • 3: Player or NPC
  • 4: Player or NPC or Physprop
Filter Name (filtername) <filterclass>
A CBaseFilter entity used to filter which entities can cause OnTouchedByEntity to fire.
Decal Name (decalname) <string>
If Damage/Second (damage) is set to something, this decal will appear where the beam first touches a solid object. To do: Determine valid strings. Scorch works.
Endpoint handle (targetpoint) <vecline> (available in all games since Asw.png)
If an Ending Entity entity is not specified, use this point as the destination instead. If the beam moves, the destination point will move along with it.
Beam clipping (ClipStyle) <choices> (available in all games since Asw.png)
"Select whether you want the beam to clip against geometry or characters."[Clarify]
  • 0: Do not clip (default)
  • 1: Clip to geometry
  • 2: Clip to everything solid

Inputs[edit | edit source]

TurnOn
Turns the beam on.
TurnOff
Turns the beam off.
Toggle
If on, turn off. If off, turn on.
StrikeOnce
Makes the beam turn on then turn off again once it dies.

Outputs[edit | edit source]

OnTouchedByEntity
Fires if an entity passing the Touch Type criteria touches the beam. Activator is that entity.