TE LIGHTNING

From Sven Co-op
Jump to navigation Jump to search

Simpler version of TE_BEAMPOINTS (fewer parameters).

Note: Implementation of this effect seems to be bit buggy. The effect may not work immediately and some of its properties are affected by other temporary effects. (Try firing gauss gun, hornet gun or displacer, and then create the effect. You will see what I mean...) Use TE_BEAMPOINTS instead.

void te_lightning(Vector start, Vector end, 
	string sprite="sprites/laserbeam.spr", int life=10, int width=32, 
	int noise=1, 
	NetworkMessageDest msgType=MSG_BROADCAST, edict_t@ dest=null)
{
	NetworkMessage m(msgType, NetworkMessages::SVC_TEMPENTITY, dest);
	m.WriteByte(TE_LIGHTNING);
	m.WriteCoord(start.x);
	m.WriteCoord(start.y);
	m.WriteCoord(start.z);
	m.WriteCoord(end.x);
	m.WriteCoord(end.y);
	m.WriteCoord(end.z);
	m.WriteByte(life);
	m.WriteByte(width);
	m.WriteByte(noise);
	m.WriteShort(g_EngineFuncs.ModelIndex(sprite));
	m.End();
}
Type Name Description
Vector start Starting position of the beam
Vector end End position of the beam
string sprite Sprite used to display the beam
uint8 life How long to display the beam (seconds * 0.1)
uint8 width Width of the beam (units * 0.1)
uint8 noise Noise amplitude (units * 0.1)