Skip to content

TE_LIGHTNING

GeckoN edited this page Jan 26, 2017 · 4 revisions

Appears to be a simpler version of TE_BEAMPOINTS (fewer parameters). I can't get it to work.

Parameters

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)

API Function

No API function exists as of SC 5.02

NetworkMessage Function

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();
}
Clone this wiki locally