TE BEAMTORUS

From Sven Co-op
Revision as of 13:24, 16 April 2025 by Outerbeast (talk | contribs) (Created page with "A ring-shaped beam that expands over time. The edges of the ring rotate so that they always faces you. The orientation of the torus can't be changed. File:TE BEAMTORUS.gif|f...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

A ring-shaped beam that expands over time. The edges of the ring rotate so that they always faces you. The orientation of the torus can't be changed.

TE_BEAMTORUS
void te_beamtorus(Vector pos, float radius, 
	string sprite="sprites/laserbeam.spr", uint8 startFrame=0, 
	uint8 frameRate=16, uint8 life=8, uint8 width=8, uint8 noise=0, 
	Color c=PURPLE, uint8 scrollSpeed=0, 
	NetworkMessageDest msgType=MSG_BROADCAST, edict_t@ dest=null)
{
	NetworkMessage m(msgType, NetworkMessages::SVC_TEMPENTITY, dest);
	m.WriteByte(TE_BEAMTORUS);
	m.WriteCoord(pos.x);
	m.WriteCoord(pos.y);
	m.WriteCoord(pos.z);
	m.WriteCoord(pos.x);
	m.WriteCoord(pos.y);
	m.WriteCoord(pos.z + radius);
	m.WriteShort(g_EngineFuncs.ModelIndex(sprite));
	m.WriteByte(startFrame);
	m.WriteByte(frameRate);
	m.WriteByte(life);
	m.WriteByte(width);
	m.WriteByte(noise);
	m.WriteByte(c.r);
	m.WriteByte(c.g);
	m.WriteByte(c.b);
	m.WriteByte(c.a);
	m.WriteByte(scrollSpeed);
	m.End();
}

* Vector	pos	Center point of the torus
* float	radius	Max radius of the torus
* string	sprite	Sprite used to draw the beam
* uint8	startFrame	Starting frame for the beam sprite
* uint8	frameRate	Frame rate of the beam sprite (FPS * 0.1) (has no effect)
* uint8	life	Time to display the beam (seconds * 0.1)
* uint8	width	Width of the beam / height of the torus
* uint8	noise	Noise amplitude of the beam (units * 0.1)
* Color	c	Color of the beam sprite
* uint8	scrollSpeed	Scroll speed of the beam sprite (has no effect)