Skip to content

TE_ELIGHT

GeckoN edited this page Jan 31, 2017 · 4 revisions

A spherical dynamic light that fades over time and only affects point entities. This appears to be the same effect used with the EF_MUZZLEFLASH effect (seen with the gauss gun primary fire).

I can't figure out how to set up the light properly. It just looks like crap no matter what I try.

Parameters

Type Name Description
Vector pos Center point for the effect
float radius Radius of the light sphere
Color c Light color
uint8 life Time to display the light (seconds * 0.1)
uint8 decayRate Light fade speed

API Function

No API function exists as of SC 5.02

NetworkMessage Function

void te_elight(CBaseEntity@ target, Vector pos, float radius=1024.0f, 
	Color c=PURPLE, uint8 life=16, float decayRate=2000.0f, 
	NetworkMessageDest msgType=MSG_BROADCAST, edict_t@ dest=null)
{
	NetworkMessage m(msgType, NetworkMessages::SVC_TEMPENTITY, dest);
	m.WriteByte(TE_ELIGHT);
	m.WriteShort(target.entindex());
	m.WriteCoord(pos.x);
	m.WriteCoord(pos.y);
	m.WriteCoord(pos.z);
	m.WriteCoord(radius);
	m.WriteByte(c.r);
	m.WriteByte(c.g);
	m.WriteByte(c.b);
	m.WriteByte(life);
	m.WriteCoord(decayRate);
	m.End();
}
Clone this wiki locally