Env beam: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Posted a detailed article and some corrections to flags and keys.)
Line 1: Line 1:
{{wrongtitle|title=env_beam}}
{{wrongtitle|title=env_beam}}
==Entity Description==
==Entity Description==
An entity that creates a visible beam between two points. The points can be attached to entities to make the beam move around. It is somewhat similar to [[env_laser]].
 
An entity that creates a visible energy beam running between two points (from a start point to an ending point). It is somewhat similar to <code>env_laser</code>.
There is a lengthy article down below, but if all you really want is a simple straight beam, here is the basics: Create two <code>info_target</code> entities, name one "Start" and one "End". Create the <code>env_beam</code> entity, type "Start" in its ''Start Entity'' and "End" in its ''Ending Entity'', and be sure to check its ''Start On'' flag, and that's it.
Now, for enthusiasts, here are the details:
 
 
===Specifying Points===
 
You will probably want to specify one or both points the beam will go between by filling in its ''Start Entity'' and/or ''Ending Entity'' properties with the names of named entities. To specify a start point, input a name of a named entity in the ''Start Entity'' value. To specify an ending point, input a named entity in the ''Ending Entity''. You can use a variety of nameable entity types for start or ending entities, such as <code>func_brushes</code>, <code>prop_physics</code>, NPCs, moving <code>func_trains</code> and the <code>env_beam</code> entity itself. (<code>Func_train</code>s doesn't require an Origin brush to work anymore.)  However, be aware that there is currently a bug affecting the area of damage of solid brush entities.
If no other entities will do, you can create and name simple <code>info_target</code> entities instead. (You can ''not'' use an env_beam with the <code>info_null</code> entity, because it is removed before the map starts, or the <code>prop_static</code>, the <code>func_detail</code> or the <code>prop_detail</code> entities, because they cannot be named.)
 
Each specified entity point can be used by several env_beams, and you can even blend two beams together totally without so much as a color flicker.
 
You can also specify groups of multiple start entities or ending entities by giving them the same name. The env_beam will then randomly select one of these entities to use for every strike. However, their first spawn will be at the line shown in Hammer. Only one env_beam will run between two points at any time.
 
If you specify entity names for both points and click ''Apply'', Hammer will draw a helping line between the two named entities to confirm that a beam will run between them in-game. (While normally always shown in the 3D view, this line is only displayed in the 2D views if the env_beam entity is also shown in it.) (If groups are used, only one line ''might'' be drawn from one of the start entities to one of the ending entities. It won't show if you name two entities before you specify the point entity.) When you select an env_beam, its line will also light up.
 
If entity names for either points are omitted, a random point on a solid surface within the radius (specified in its ''Radius'' property) will instead be selected for every strike. If only one of these entities are omitted, the center of this radius will be the other specified entity, and if both entities are omitted, the center will be the env_beam entity itself. Beams involving these random points does not cause damage.
 
If all the start point or ending point entities are destroyed for an env_beam in-game, it will cease to work.
 
 
 
===Penetration and Damage===
(Please note that due to a somewhat unforeseeable bug with using brush entities, this part will mainly cover env_beam damage emitted from the more reliable <code>info_target</code> entities.)
 
The beam will ''always'' visibly run from its start point to its ending point. It won't stop for anything (including worldbrushes).
Its damage will however, like a bullet, be absorbed by the first solid thing (props, the player, solid func_brushes, worldbrush walls, ...) it hits on its way toward its ending point. (This includes prop_physics emitters blocking its own beam, but apparently not solid func_brushes (but this may be a bug).)
A striking env_beam (with its ''Life'' property set to more than 0) will immediately discharge all its damage into this thing on inpact, each strike (which means that you can walk into a beam strike after impact and not take damage), while a permanent beam (with its ''Life'' property set to 0) will emit damage more gradually.
 
Note that the damage caused by a beam strike depends on the current difficulty setting:
 
* The "Easy" (<code>skill 1</code>) setting causes 50% of the ''Damage / second'' value.
* The "Normal" (<code>skill 2</code>) setting causes 100% of the ''Damage / second'' value.
* The "Hard" (<code>skill 3</code>) setting causes 150% of the ''Damage / second'' value.
 
 
===Beam Rings===
A "beam ring" is an env_beam with its ''Ring'' flag set. Instead of using two points to draw a beam line between, a beam ring uses the two points as a diameter, drawing a beam ring between them. People has been having trouble setting up these rings because they often use info_targets for beam points, ''which are not valid for beam rings''. (The beam will not show at all.) Instead you can use brush entities (like func_brushes or func_trains), prop_physics or models. Both a Start Entity and an Ending Entity must be specified (or else the beam will not be a ring).
Beam rings using func_trains can be seen in Xen around spires, and can also be used to create expanding visual blast waves.


==Keyvalues==
==Keyvalues==
Line 12: Line 51:
: {{color}} Beam Color
: {{color}} Beam Color
* '''Radius'''
* '''Radius'''
: <integer> If the 'Random Strike' spawnflag is set, this radius determines the area within which the endpoints will randomly strike.
: <integer> If the LightningStart and/or LightningEnd values are omitted, this radius determines the area within which the endpoints will randomly strike. A new random position will be appointed for every strike. (The Help text for this keyvalue is apparently wrong in Hammer.)
* '''life'''
* '''life'''
: <unsigned integer> Amount of time before the beam dies. Setting to zero will make the beam stay forever.
: <unsigned integer> Amount of time before the beam dies. Setting to zero will make the beam stay forever.
Line 32: Line 71:
: <float> 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.
: <float> 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.
* '''LightningStart'''
* '''LightningStart'''
: <target_destination> Entity that the beam starts at.
: <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.
* '''LightningEnd'''
* '''LightningEnd'''
: <target_destination> Entity that the beam ends at.
: <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.
* '''TouchType'''
* '''TouchType'''
: <choices> If you want the beam to fire an output when touched by entities, choose the entity type here.
: <choices> If you want the beam to fire an output when touched by entities, choose the entity type here.
Line 61: Line 100:
:When the beam has died, it will strike again randomly within a delay interval of 0 to the value in ''Strike again time (secs)''.
:When the beam has died, it will strike again randomly within a delay interval of 0 to the value in ''Strike again time (secs)''.
* 8 : Ring
* 8 : Ring
:Uses the two points as a diameter, drawing a beam ring between them instead of a straight line. These points must be ''brush'' entities, or the beam will not show at all. Beam rings does not do damage.
:Uses two points as a diameter, drawing a beam ring between them instead of a straight line. These points can not be info_target entities. See [[env_beam#Ring_Beams|above]].
* 16 : StartSparks
* 16 : StartSparks
:Every time the beam strikes or is turned on, the beam temporarily emits a small shower of sparks at its Start Entity.
:Every time the beam strikes or is turned on, the beam temporarily emits a small shower of sparks at its Start Entity.
Line 69: Line 108:
:Do not use. Places a decal scorch mark where a damaging beam hits the first solid (world brush or entity). Unfortunately this decal is enormous as a crater, obviously a square decal and horribly ugly.
:Do not use. Places a decal scorch mark where a damaging beam hits the first solid (world brush or entity). Unfortunately this decal is enormous as a crater, obviously a square decal and horribly ugly.
* 128 : Shade Start
* 128 : Shade Start
:The beam fades out toward its Start Entity.
:The beam fades out toward its Start Entity. Overrides Shade End. Does not work on striking beams or beam rings.
* 256 : Shade End
* 256 : Shade End
:The beam fades out toward its Ending Entity
:The beam fades out toward its Ending Entity. Is overridden by Shade Start. Does not work on striking beams (''Life'' > 0) or beam rings.
* 512 : Taper Out
* 512 : Taper Out
:Makes the beam taper out into a point towards its Ending Entity.
:Makes the beam taper out into a point towards its Ending Entity. Does not work on striking beams (''Life'' > 0) or beam rings.
 


==Inputs==
==Inputs==

Revision as of 15:53, 6 February 2006

Template:Wrongtitle

Entity Description

An entity that creates a visible energy beam running between two points (from a start point to an ending point). It is somewhat similar to env_laser. There is a lengthy article down below, but if all you really want is a simple straight beam, here is the basics: Create two info_target entities, name one "Start" and one "End". Create the env_beam entity, type "Start" in its Start Entity and "End" in its Ending Entity, and be sure to check its Start On flag, and that's it. Now, for enthusiasts, here are the details:


Specifying Points

You will probably want to specify one or both points the beam will go between by filling in its Start Entity and/or Ending Entity properties with the names of named entities. To specify a start point, input a name of a named entity in the Start Entity value. To specify an ending point, input a named entity in the Ending Entity. You can use a variety of nameable entity types for start or ending entities, such as func_brushes, prop_physics, NPCs, moving func_trains and the env_beam entity itself. (Func_trains doesn't require an Origin brush to work anymore.) However, be aware that there is currently a bug affecting the area of damage of solid brush entities. If no other entities will do, you can create and name simple info_target entities instead. (You can not use an env_beam with the info_null entity, because it is removed before the map starts, or the prop_static, the func_detail or the prop_detail entities, because they cannot be named.)

Each specified entity point can be used by several env_beams, and you can even blend two beams together totally without so much as a color flicker.

You can also specify groups of multiple start entities or ending entities by giving them the same name. The env_beam will then randomly select one of these entities to use for every strike. However, their first spawn will be at the line shown in Hammer. Only one env_beam will run between two points at any time.

If you specify entity names for both points and click Apply, Hammer will draw a helping line between the two named entities to confirm that a beam will run between them in-game. (While normally always shown in the 3D view, this line is only displayed in the 2D views if the env_beam entity is also shown in it.) (If groups are used, only one line might be drawn from one of the start entities to one of the ending entities. It won't show if you name two entities before you specify the point entity.) When you select an env_beam, its line will also light up.

If entity names for either points are omitted, a random point on a solid surface within the radius (specified in its Radius property) will instead be selected for every strike. If only one of these entities are omitted, the center of this radius will be the other specified entity, and if both entities are omitted, the center will be the env_beam entity itself. Beams involving these random points does not cause damage.

If all the start point or ending point entities are destroyed for an env_beam in-game, it will cease to work.


Penetration and Damage

(Please note that due to a somewhat unforeseeable bug with using brush entities, this part will mainly cover env_beam damage emitted from the more reliable info_target entities.)

The beam will always visibly run from its start point to its ending point. It won't stop for anything (including worldbrushes). Its damage will however, like a bullet, be absorbed by the first solid thing (props, the player, solid func_brushes, worldbrush walls, ...) it hits on its way toward its ending point. (This includes prop_physics emitters blocking its own beam, but apparently not solid func_brushes (but this may be a bug).) A striking env_beam (with its Life property set to more than 0) will immediately discharge all its damage into this thing on inpact, each strike (which means that you can walk into a beam strike after impact and not take damage), while a permanent beam (with its Life property set to 0) will emit damage more gradually.

Note that the damage caused by a beam strike depends on the current difficulty setting:

  • The "Easy" (skill 1) setting causes 50% of the Damage / second value.
  • The "Normal" (skill 2) setting causes 100% of the Damage / second value.
  • The "Hard" (skill 3) setting causes 150% of the Damage / second value.


Beam Rings

A "beam ring" is an env_beam with its Ring flag set. Instead of using two points to draw a beam line between, a beam ring uses the two points as a diameter, drawing a beam ring between them. People has been having trouble setting up these rings because they often use info_targets for beam points, which are not valid for beam rings. (The beam will not show at all.) Instead you can use brush entities (like func_brushes or func_trains), prop_physics or models. Both a Start Entity and an Ending Entity must be specified (or else the beam will not be a ring). Beam rings using func_trains can be seen in Xen around spires, and can also be used to create expanding visual blast waves.

Keyvalues

<byte> Useless when set to 0
  • rendercolor
#000000 Beam Color
  • Radius
<integer> If the LightningStart and/or LightningEnd values are omitted, this radius determines the area within which the endpoints will randomly strike. A new random position will be appointed for every strike. (The Help text for this keyvalue is apparently wrong in Hammer.)
  • life
<unsigned integer> Amount of time before the beam dies. Setting to zero will make the beam stay forever.
  • BoltWidth
<float> Width of the beam. Range: 1 to MAX_BEAM_WIDTH
  • NoiseAmplitude
<float> The amount of noise in the beam. 0 is a perfectly straight beam. Range: 0 to MAX_BEAM_NOISEAMPLITUDE
  • texture
<sprite> The material used to draw the beam.
  • TextureScroll
<integer> Rate at which the beam texture should scroll along the beam. Range: 0 to MAX_BEAM_SCROLLSPEED
  • framerate
<integer> Framerate at which the beam texture should animate, if it has multiple frames.
  • framestart
<integer> The frame to start the beam texture on.
  • StrikeTime
<float> Refire time between random strikes of the beam. Only used if the 'Random Strike' spawnflag is set.
  • damage
<float> 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.
  • 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.
  • 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.
  • TouchType
<choices> If you want the beam to fire an output when touched by entities, choose the entity type here.
Literal Value Description
0 Not a tripwire
1 Player Only
2 NPC Only
3 Player or NPC
4 Player or NPC or Physprop
  • filtername
<filterclass> Filter to use to see if activator triggers me. See filter_activator_name for more explanation.

Flags

  • 1 : Start On
Starts the map with the beam turned on.
  • 2 : Toggle
Obsolete. Replaced by the Toggle input of the Source I/O system. Used to toggle the beam on and off.
  • 4 : Random Strike
When the beam has died, it will strike again randomly within a delay interval of 0 to the value in Strike again time (secs).
  • 8 : Ring
Uses two points as a diameter, drawing a beam ring between them instead of a straight line. These points can not be info_target entities. See above.
  • 16 : StartSparks
Every time the beam strikes or is turned on, the beam temporarily emits a small shower of sparks at its Start Entity.
  • 32 : EndSparks
Every time the beam strikes or is turned on, the beam temporarily emits a small shower of sparks at its Ending Entity.
  • 64 : Decal End
Do not use. Places a decal scorch mark where a damaging beam hits the first solid (world brush or entity). Unfortunately this decal is enormous as a crater, obviously a square decal and horribly ugly.
  • 128 : Shade Start
The beam fades out toward its Start Entity. Overrides Shade End. Does not work on striking beams or beam rings.
  • 256 : Shade End
The beam fades out toward its Ending Entity. Is overridden by Shade Start. Does not work on striking beams (Life > 0) or beam rings.
  • 512 : Taper Out
Makes the beam taper out into a point towards its Ending Entity. Does not work on striking beams (Life > 0) or beam rings.


Inputs

Turns the beam on.
  • TurnOff
Turns the beam off.
  • Toggle
Toggles the beam's state.
  • StrikeOnce
Causes the beam to strike once. It will stay on for its set Life and then turn off (it will never turn off if Life is set to zero).
  • Color #000000
Sets the rendercolor
Set the NoiseAmplitude
  • ScrollSpeed <float>
Set the TextureScroll
  • Width <float>
Set the BoltWidth

Outputs

Fired when an entity touches the beam. Only fired if the entity passes the 'Touch Type' choice. Check out Targetname read up on how to trigger the activator.

See Also