Skip to content

TE_BEAMPOINTS

wootguy edited this page Nov 29, 2025 · 4 revisions

An additive sprite beam between two static points.

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 frameStart Starting frame for the beam sprite
uint8_t frameRate Frame rate of the beam sprite (FPS * 0.1)
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)
RGBA c Beam RGBA and brightness
uint8_t scroll Scroll rate of the beam sprite

Example Usage

void te_beampoints(Vector start, Vector end, 
    const char* sprite="sprites/laserbeam.spr", uint8_t frameStart=0, 
    uint8_t frameRate=100, uint8_t life=10, uint8_t width=32, uint8_t noise=1, 
    RGBA c=PURPLE, uint8_t scroll=32,
    int msgType=MSG_BROADCAST, edict_t* dest=NULL)
{
    MESSAGE_BEGIN(msgType, SVC_TEMPENTITY, dest);
    WRITE_BYTE(TE_BEAMPOINTS);
    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_SHORT(MODEL_INDEX(sprite));
    WRITE_BYTE(frameStart);
    WRITE_BYTE(frameRate);
    WRITE_BYTE(life);
    WRITE_BYTE(width);
    WRITE_BYTE(noise);
    WRITE_BYTE(c.r);
    WRITE_BYTE(c.g);
    WRITE_BYTE(c.b);
    WRITE_BYTE(c.a); // actually brightness
    WRITE_BYTE(scroll);
    MESSAGE_END();
}

Clone this wiki locally