TE BEAMDISK

From Sven Co-op
Revision as of 20:49, 5 April 2025 by Outerbeast (talk | contribs) (Created page with "An additive sprite disk that expands over time. The orientation of the disk can't be changed. frame <pre> void te_beamdisk(Vector pos, float radius,...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

An additive sprite disk that expands over time. The orientation of the disk can't be changed.

TE BEAMDISK.gif
void te_beamdisk(Vector pos, float radius, 
	string sprite="sprites/laserbeam.spr", uint8 startFrame=0, 
	uint8 frameRate=16, uint8 life=8, RGBA c=RGBA_PURPLE, uint8 scrollSpeed=0, 
	NetworkMessageDest msgType=MSG_BROADCAST, edict_t@ dest=null)
{
	NetworkMessage m(msgType, NetworkMessages::SVC_TEMPENTITY, dest);
	m.WriteByte(TE_BEAMDISK);
	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(1); // "width" - has no effect
	m.WriteByte(0); // "noise" - has no effect
	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 disk
* float	radius	Max radius of the disk
* string	sprite	Sprite used to cover the disk
* uint8	startFrame	Starting frame for the disk sprite
* uint8	frameRate	Frame rate of the disk sprite (FPS * 0.1) (has no effect)
* uint8	life	Time to display the disk (seconds * 0.1)
* RGBA	c	Color of the disk sprite
* uint8	scrollSpeed	If set to 10 or greater, the disk starts out fully stretched to infinity and appears to rotate.
* Values < 10 have no effect.