Skip to content

TE_DLIGHT

wootguy edited this page Nov 29, 2025 · 4 revisions

A spherical dynamic light that fades over time.

Parameters

Type Name Description
Vector pos Center point for the effect
uint8_t radius Radius of the light sphere (units * 10)
RGBA c Light RGBA
uint8_t life Time to display the light (seconds * 0.1)
uint8_t decayRate Light fade speed

Example Usage

void te_dlight(Vector pos, uint8_t radius=32, RGBA c=PURPLE, 
    uint8_t life=255, uint8_t decayRate=50,
    int msgType=MSG_BROADCAST, edict_t* dest=NULL)
{
    MESSAGE_BEGIN(msgType, SVC_TEMPENTITY, dest);
    WRITE_BYTE(TE_DLIGHT);
    WRITE_COORD(pos.x);
    WRITE_COORD(pos.y);
    WRITE_COORD(pos.z);
    WRITE_BYTE(radius);
    WRITE_BYTE(c.r);
    WRITE_BYTE(c.g);
    WRITE_BYTE(c.b);
    WRITE_BYTE(life);
    WRITE_BYTE(decayRate);
    MESSAGE_END();
}

Clone this wiki locally