Skip to content

TE_BEAMENTPOINT

wootguy edited this page Nov 29, 2025 · 4 revisions

An additive sprite beam between a moving entity and a static point.

Parameters

Type Name Description
CBaseEntity* target Entity target for the beam to follow
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_beamentpoint(CBaseEntity* target, Vector end, 
    const char* sprite="sprites/laserbeam.spr", int frameStart=0, 
    int frameRate=100, int life=10, int width=32, int noise=1, 
    RGBA c=PURPLE, int scroll=32,
    int msgType=MSG_BROADCAST, edict_t* dest=NULL)
{
    MESSAGE_BEGIN(msgType, SVC_TEMPENTITY, dest);
    WRITE_BYTE(TE_BEAMENTPOINT);
    WRITE_SHORT(target->entindex());
    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