Skip to main content

env_dlight

env_dlight icon
Point entityPorted from FeaturefulSpirit of Half-Life

An env_dlight makes a dynamic light, the kind of light a muzzle flash or a rocket makes, which lights the world and the models around it. You can switch it on and off with triggers or let it stay on for a set time, and it can sit on an entity and move with it.

Players who join later see the lights that are on. Dynamic lights are not part of the light that the map compiler bakes into the map.

Attributes​

KeyDescriptionDefault
Nametargetname

Triggering the entity switches the light on or off, as the use type says. Without a name, the light is on from the start of the map. See Common keys.

Positionmessage

Sets where the light is. It takes a locus position, so you can use a point such as 0 0 64, the name of an entity, or !activator for the entity that switched the light on. With Position is Locus Entity, it names the entity the light sits on.

If you leave this key empty, the light is at the env_dlight itself.

Light colorrendercolor

Sets the color of the light, as red, green and blue from 0 up to 255.

Default 255 255 255
Radiusrenderamt

Sets how far the light reaches, in units, from 0 up to 1023.

Default 80
Durationhealth

Sets how many seconds the light stays on after it turns on, and 0 keeps it on until you switch it off.

Default 0.0

Flags​

1Only once

The entity is removed when its Duration ends

2Start on

The light is on from the start of the map

4Track position updates

While the light is on, the entity finds its Position again every 0.1 seconds, so with !activator the light follows the entity that switched it on

8Position is Locus Entity

The light sits on the entity named in Position. When that entity has a model you can see, the light moves with it smoothly on every player's screen. On an entity without a model, such as an info_target, it stays where the entity was when the light turned on, unless you also set Track position updates

Notes​

  • The game has 32 dynamic lights for each player, and muzzle flashes, rockets and other effects use them too
  • If the entity can't find the position that Position names when you switch the light on, the light stays off
  • If trigger_changevalue or trigger_copyvalue changes Radius or Light color while the light is on, every player sees the change at once. See Changing keys

See also​

Changes since 1.38​

  • env_dlight is new in SBO 2.0.0