Skip to content

TE_BEAMCYLINDER

wootguy edited this page Nov 29, 2025 · 4 revisions

A ring-shaped beam that expands over time. The orientation of the cylinder can't be changed.

Parameters

Type Name Description
Vector pos Center point of the cylinder
float radius Max radius of the cylinder
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 cylinder
uint8_t noise Noise amplitude of the beam (units * 0.1) **(has no effect)**
RGBA c RGBA of the beam sprite
uint8_t scrollSpeed Scroll speed of the beam sprite **(has no effect)**

Example Usage

void te_beamcylinder(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_BEAMCYLINDER);
    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