Skip to content

TE_BEAMTORUS

wootguy edited this page Nov 29, 2025 · 4 revisions

A ring-shaped beam that expands over time. The edges of the ring rotate so that they always faces you. The orientation of the torus can't be changed.

Parameters

Type Name Description
Vector pos Center point of the torus
float radius Max radius of the torus
const char* sprite Sprite used to draw the beam
uint8_t startFrame Starting frame for the beam sprite
uint8_t frameRate Frame rate of the beam sprite (FPS * 0.1) **(has no effect)**
uint8_t life Time to display the beam (seconds * 0.1)
uint8_t width Width of the beam / height of the torus
uint8_t noise Noise amplitude of the beam (units * 0.1)
RGBA c RGBA of the beam sprite
uint8_t scrollSpeed Scroll speed of the beam sprite **(has no effect)**

Example Usage

void te_beamtorus(Vector pos, float radius, 
    const char* sprite="sprites/laserbeam.spr", uint8_t startFrame=0, 
    uint8_t frameRate=16, uint8_t life=8, uint8_t width=8, uint8_t noise=0, 
    RGBA c=PURPLE, uint8_t scrollSpeed=0, 
    int msgType=MSG_BROADCAST, edict_t* dest=NULL)
{
    MESSAGE_BEGIN(msgType, SVC_TEMPENTITY, dest);
    WRITE_BYTE(TE_BEAMTORUS);
    WRITE_COORD(pos.x);
    WRITE_COORD(pos.y);
    WRITE_COORD(pos.z);
    WRITE_COORD(pos.x);
    WRITE_COORD(pos.y);
    WRITE_COORD(pos.z + radius);
    WRITE_SHORT(MODEL_INDEX(sprite));
    WRITE_BYTE(startFrame);
    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);
    WRITE_BYTE(scrollSpeed);
    MESSAGE_END();
}

Clone this wiki locally