Skip to content

TE_USERTRACER

GeckoN edited this page Feb 7, 2017 · 7 revisions

Shoots a customizable bullet tracer.

Due to the low precision of the life parameter, the tracer distance is much less accurate than TE_TRACER.

Parameters

Type Name Description
Vector pos Center point for the effect
Vector dir Direction of the tracer
float speed Initial tracer speed. The default speed is 6000
uint8 color Tracer color (index in Engine Palette #2).
Only values <0 - 11> are valid. The default color index is 4.
uint8 life Time to display tracer (seconds * 0.1)
uint8 length Tracer sprite length

API Function

No API function exists as of SC 5.02

NetworkMessage Function

void te_usertracer(Vector pos, Vector dir, float speed=6000.0f, 
	uint8 life=32, uint color=4, uint8 length=12,
	NetworkMessageDest msgType=MSG_BROADCAST, edict_t@ dest=null)
{
	Vector velocity = dir*speed;
	NetworkMessage m(msgType, NetworkMessages::SVC_TEMPENTITY, dest);
	m.WriteByte(TE_USERTRACER);
	m.WriteCoord(pos.x);
	m.WriteCoord(pos.y);
	m.WriteCoord(pos.z);
	m.WriteCoord(velocity.x);
	m.WriteCoord(velocity.y);
	m.WriteCoord(velocity.z);
	m.WriteByte(life);
	m.WriteByte(color);
	m.WriteByte(length);
	m.End();
}
Clone this wiki locally