Difference between revisions of "TE DLIGHT"

From Sven Co-op
Jump to navigation Jump to search
m
m
Line 26: Line 26:
 
* <code>uint8 life</code> Time to display the light (seconds * 0.1)
 
* <code>uint8 life</code> Time to display the light (seconds * 0.1)
 
* <code>uint8 decayRate</code> Light fade speed
 
* <code>uint8 decayRate</code> Light fade speed
 +
[[Category:Scripting]]

Revision as of 20:02, 7 July 2025

TE_DLIGHT

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).

void te_dlight(Vector pos, uint8 radius=32, RGBA c=RGBA_PURPLE, 
	uint8 life=255, uint8 decayRate=50,
	NetworkMessageDest msgType=MSG_BROADCAST, edict_t@ dest=null)
{
	NetworkMessage m(msgType, NetworkMessages::SVC_TEMPENTITY, dest);
	m.WriteByte(TE_DLIGHT);
	m.WriteCoord(pos.x);
	m.WriteCoord(pos.y);
	m.WriteCoord(pos.z);
	m.WriteByte(radius);
	m.WriteByte(c.r);
	m.WriteByte(c.g);
	m.WriteByte(c.b);
	m.WriteByte(life);
	m.WriteByte(decayRate);
	m.End();
}
  • Vector pos Center point for the effect
  • float radius Radius of the light sphere
  • RGBA c Light color
  • uint8 life Time to display the light (seconds * 0.1)
  • uint8 decayRate Light fade speed