Skip to content

TE_BSPDECAL

wootguy edited this page Nov 29, 2025 · 3 revisions

Applies a decal to a world surface. Decals are referenced from the .bsp instead of decals.wad.

I've haven't been able to get this working - you can't load just any texture stored in the BSP. I guess it's possible g_EngineFuncs.DecalIndex() is not looking there.

Parameters

Type Name Description
Vector pos Center location of the decal. It needs to be witnin a few units of a surface.
const char* decal Decal name from the map .bsp

Example Usage

void te_bspdecal(Vector pos, const char* decal="{handi",
    int msgType=MSG_BROADCAST, edict_t* dest=NULL)
{
    MESSAGE_BEGIN(msgType, SVC_TEMPENTITY, dest);
    WRITE_BYTE(TE_BSPDECAL);
    WRITE_COORD(pos.x);
    WRITE_COORD(pos.y);
    WRITE_COORD(pos.z);
    WRITE_BYTE(g_EngineFuncs.DecalIndex(decal));
    MESSAGE_END();
}

Clone this wiki locally