Skip to content

TE_LIGHTNING

wootguy edited this page Nov 29, 2025 · 3 revisions

Appears to be a simpler version of TE_BEAMPOINTS (fewer parameters). I can't get it to work.

Parameters

Type Name Description
Vector start Starting position of the beam
Vector end End position of the beam
const char* sprite Sprite used to display the beam
uint8_t life How long to display the beam (seconds * 0.1)
uint8_t width Width of the beam (units * 0.1)
uint8_t noise Noise amplitude (units * 0.1)

Example Usage

void te_lightning(Vector start, Vector end, 
    const char* sprite="sprites/laserbeam.spr", int life=10, int width=32, 
    int noise=1, 
    int msgType=MSG_BROADCAST, edict_t* dest=NULL)
{
    MESSAGE_BEGIN(msgType, SVC_TEMPENTITY, dest);
    WRITE_BYTE(TE_LIGHTNING);
    WRITE_COORD(start.x);
    WRITE_COORD(start.y);
    WRITE_COORD(start.z);
    WRITE_COORD(end.x);
    WRITE_COORD(end.y);
    WRITE_COORD(end.z);
    WRITE_BYTE(life);
    WRITE_BYTE(width);
    WRITE_BYTE(noise);
    WRITE_SHORT(MODEL_INDEX(sprite));
    MESSAGE_END();
}

Clone this wiki locally