forked from baso88/SC_AngelScript
-
Notifications
You must be signed in to change notification settings - Fork 0
TE_BREAKMODEL
wootguy edited this page Nov 29, 2025
·
4 revisions
Spawns multiple rotating models with gravity, collisions, fadeout, particle trails, and sound effects. Models are spawned from random locations inside a box.
This is the effect used when you destroy a func_breakable.
| Type | Name | Description |
|---|---|---|
| Vector | pos | Center point for the effect |
| Vector | size | Radius of the box where the models spawn randomly inside |
| Vector | velocity | Speed and direction of the models |
| uint8_t | speedNoise | Amount to randomize speed and direction |
| const char* | model | Model to display |
| uint8_t | count | Number of models to spawn |
| uint8_t | life | Time to display all models (seconds * 0.1) |
| uint8_t | flags | Choose only one of the following flags:
1 : Glass sounds and models draw at 50% opacity
2 : Metal sounds
4 : Flesh sounds
8 : Wood sounds
64 : Rock sounds
The following flags can be enabled in addition to the flag selected above: |
void te_breakmodel(Vector pos, Vector size, Vector velocity,
uint8_t speedNoise=16, const char* model="models/hgibs.mdl",
uint8_t count=8, uint8_t life=0, uint8_t flags=20,
int msgType=MSG_BROADCAST, edict_t* dest=NULL)
{
MESSAGE_BEGIN(msgType, SVC_TEMPENTITY, dest);
WRITE_BYTE(TE_BREAKMODEL);
WRITE_COORD(pos.x);
WRITE_COORD(pos.y);
WRITE_COORD(pos.z);
WRITE_COORD(size.x);
WRITE_COORD(size.y);
WRITE_COORD(size.z);
WRITE_COORD(velocity.x);
WRITE_COORD(velocity.y);
WRITE_COORD(velocity.z);
WRITE_BYTE(speedNoise);
WRITE_SHORT(MODEL_INDEX(model));
WRITE_BYTE(count);
WRITE_BYTE(life);
WRITE_BYTE(flags);
MESSAGE_END();
}