Env laser

From Valve Developer Community
Jump to navigation Jump to search
Env_lasers in action.

Template:Base point

Entity description

It creates a laser beam between itself and a given target. It is somewhat similar to env_beam and not to be confused with env_portal_laser. In case an env_laser entity doesn't damage you, first make sure that the "damage per second" value is not set to zero, and then make sure the centerpoint of the env laser in hammer is not inside a brush. Also make sure that the center of the env_laser is not on the edge of a brush. In all the above cases you will not receive any damage.

Tip.pngTip:To move an entity very slightly so the center point doesn't intersect with the side of a wall anymore use the Ctrl+M shortcut, which opens up the transform window. Click on move, click on the desired direction (x, y or z), then fill in a value of either 0.01 or -0.01 to place the brush slightly off the grid by only a fraction. It is better to perform such subtle off-grid movements when you're done editing your map and are ready for the final compile. For the duration of your editing stick to the grid.

If your env_laser doesn't have a targetname the "start on" flag doesn't have to be set since it starts automatically. If the env_laser does have a targetname you do need the "start on" flag if you want it to work when the map spawns.

C++ In code, it is represented by theCEnvLaserclass, defined in theEnvLaser.cppfile.

Keyvalues

Target of Laser ([todo internal name (i)]) <targetname>
Name of entity, or entities, to strike at. The target is randomly chosen if there are multiple entities matching the given name.
Brightness (1 - 255) ([todo internal name (i)]) <integer>
Beam brightness.
Beam Color (R G B) ([todo internal name (i)]) <color255>
Beam color.
Width of Beam ([todo internal name (i)]) <float>
The width of the laser beam, in pixels.
Amount of noise (0-255) ([todo internal name (i)]) <integer>
The amount of noise in the beam. 0 is a perfectly straight beam.
Sprite Name ([todo internal name (i)]) <sprite>
The material used to draw the laser beam.
End Sprite ([todo internal name (i)]) <sprite>
If specified, this sprite will be drawn at the end of the laser beam.
Texture Scroll Rate (0-100) ([todo internal name (i)]) <integer>
Rate at which the beam texture should scroll along the beam.
Starting Frame ([todo internal name (i)]) <integer>
The frame to start the beam texture on.
Damage / second ([todo internal name (i)]) <string>
How much damage this laser does. per second. to things it hits.
Dissolve Type ([todo internal name (i)]) <choices>
Dissolve effect type.
Note.pngNote:This effect is not available in all games.
  • -1 : None
  • 0 : Energy
  • 1 : Heavy electrical
  • 2 : Light electrical
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.

Flags

  • 1 : Start On
  • 16 : StartSparks
  • 32 : EndSparks
  • 64 : Decal End

Inputs

TurnOn
Turns the laser on.
TurnOff
Turns the laser off.
Toggle
Toggles the laser between on and off.


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.

Outputs

See also