Skip to content

TE_MULTIGUNSHOT

wootguy edited this page Nov 29, 2025 · 4 revisions

Applies multiple decals on the targgeted surface (brush entity or world). A ricochet sound effect is played if count is >= 3. No tracers are shown and monsters are ignored.

Unlike the other decal methods, the position of a decal is determined by the intersection of a shoot vector and a wall.

Parameters

Type Name Description
Vector pos Location to shoot from
Vector dir Shoot direction
float spreadX Amount to randomize direction for each trace/decal (horizontal)
float spreadY Amount to randomize direction for each trace/decal (vertical)
uint8_t count Number of bullets to shoot / decals to apply
const char* decal Texture name from decals.wad

Example Usage

void te_multigunshot(Vector pos, Vector dir, float spreadX=512.0f, 
    float spreadY=512.0f, uint8_t count=8, const char* decal="{shot4",
    int msgType=MSG_BROADCAST, edict_t* dest=NULL)
{   
    MESSAGE_BEGIN(msgType, SVC_TEMPENTITY, dest);
    WRITE_BYTE(TE_MULTIGUNSHOT);
    WRITE_COORD(pos.x);
    WRITE_COORD(pos.y);
    WRITE_COORD(pos.z);
    WRITE_COORD(dir.x);
    WRITE_COORD(dir.y);
    WRITE_COORD(dir.z);
    WRITE_COORD(spreadX);
    WRITE_COORD(spreadY);
    WRITE_BYTE(count);
    WRITE_BYTE(g_EngineFuncs.DecalIndex(decal));
    MESSAGE_END();
}

Clone this wiki locally