Difference between revisions of "TE BEAMENTPOINT"

From Sven Co-op
Jump to navigation Jump to search
(Created page with "An additive sprite beam between a moving entity and a static point. frame <pre> void te_beamentpoint(CBaseEntity@ target, Vector end, string spr...")
 
m
 
Line 5: Line 5:
 
string sprite="sprites/laserbeam.spr", int frameStart=0,  
 
string sprite="sprites/laserbeam.spr", int frameStart=0,  
 
int frameRate=100, int life=10, int width=32, int noise=1,  
 
int frameRate=100, int life=10, int width=32, int noise=1,  
Color c=PURPLE, int scroll=32,
+
RGBA c=PURPLE, int scroll=32,
 
NetworkMessageDest msgType=MSG_BROADCAST, edict_t@ dest=null)
 
NetworkMessageDest msgType=MSG_BROADCAST, edict_t@ dest=null)
 
{
 
{
Line 37: Line 37:
 
* uint8 width Width of the beam (units * 0.1)
 
* uint8 width Width of the beam (units * 0.1)
 
* uint8 noise Noise amplitude (units * 0.1)
 
* uint8 noise Noise amplitude (units * 0.1)
* Color c Beam color and brightness
+
* RGBA c Beam color and brightness
 
* uint8 scroll Scroll rate of the beam sprite
 
* uint8 scroll Scroll rate of the beam sprite

Latest revision as of 20:45, 5 April 2025

An additive sprite beam between a moving entity and a static point.

TE BEAMENTPOINT.gif
void te_beamentpoint(CBaseEntity@ target, Vector end, 
	string sprite="sprites/laserbeam.spr", int frameStart=0, 
	int frameRate=100, int life=10, int width=32, int noise=1, 
	RGBA c=PURPLE, int scroll=32,
	NetworkMessageDest msgType=MSG_BROADCAST, edict_t@ dest=null)
{
	NetworkMessage m(msgType, NetworkMessages::SVC_TEMPENTITY, dest);
	m.WriteByte(TE_BEAMENTPOINT);
	m.WriteShort(target.entindex());
	m.WriteCoord(end.x);
	m.WriteCoord(end.y);
	m.WriteCoord(end.z);
	m.WriteShort(g_EngineFuncs.ModelIndex(sprite));
	m.WriteByte(frameStart);
	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); // actually brightness
	m.WriteByte(scroll);
	m.End();
}
  • CBaseEntity@ target Entity target for the beam to follow
  • Vector end End position of the beam
  • string sprite Sprite used to display the beam
  • uint8 frameStart Starting frame for the beam sprite
  • uint8 frameRate Frame rate of the beam sprite (FPS * 0.1)
  • 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)
  • RGBA c Beam color and brightness
  • uint8 scroll Scroll rate of the beam sprite