Skip to content

TE_SPRAY

GeckoN edited this page Jan 31, 2017 · 4 revisions

Throws sprites in some direction. Sprites have gravity and collisions. Unlike TE_SPRITE_SPRAY, these sprites don't fade out.

Parameters

Type Name Description
Vector pos Point to spray sprites from
Vector dir Direction of the spray
string sprite Sprite to display (alpha transparency)
uint8 count Number of sprites to spawn
uint8 speed Initial sprite speed
uint8 noise Amount to randomize speed and direction
uint8 renderMode Render mode for the sprites/models:
0 : Normal
1 : Color
2 : Texture
3 : Glow
4 : Solid
5 : Additive

There doesn't seem to be a way to set the render amount, so only "Glow" and "Additive" have any effect.

API Function

No API function exists as of SC 5.10

NetworkMessage Function

void te_spray(Vector pos, Vector dir, string sprite="sprites/bubble.spr", 
	uint8 count=8, uint8 speed=127, uint8 noise=255, uint8 rendermode=0,
	NetworkMessageDest msgType=MSG_BROADCAST, edict_t@ dest=null)
{
	NetworkMessage m(msgType, NetworkMessages::SVC_TEMPENTITY, dest);
	m.WriteByte(TE_SPRAY);
	m.WriteCoord(pos.x);
	m.WriteCoord(pos.y);
	m.WriteCoord(pos.z);
	m.WriteCoord(dir.x);
	m.WriteCoord(dir.y);
	m.WriteCoord(dir.z);
	m.WriteShort(g_EngineFuncs.ModelIndex(sprite));
	m.WriteByte(count);
	m.WriteByte(speed);
	m.WriteByte(noise);
	m.WriteByte(rendermode);
	m.End();
}
Clone this wiki locally