Env laser: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
Line 21: Line 21:
{{KV|Damage / second|string|How much damage this laser does. per second. to things it hits.}}
{{KV|Damage / second|string|How much damage this laser does. per second. to things it hits.}}
{{KV|Dissolve Type|choices|Dissolve effect type.}}
{{KV|Dissolve Type|choices|Dissolve effect type.}}
{{Note|This effect is not available in all games.}}
:* -1 : None
:* -1 : None
:* 0 : Energy
:* 0 : Energy

Revision as of 03:48, 30 September 2011

Env_lasers in action.

Template:Base point 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. If you are wondering why your env_laser entity doesn't damage you, first make sure that the "damage per second" value is not set to zero then you have to make sure that 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 both those cases the damage is negated by the brushes.

To move a brush / entity very slightly so the center point doesn't intersect with the side of a wall anymore use "<ctrl> M" quick-key for hammer it opens up a small window. click on Move!!!!! and then 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... If you are still planning on moving these brushes afterwards do this when your map is finished because if you move these entity's together with other parts of your map they might all get off the grid which isn't good for optimization.

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 start 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