Difference between revisions of "TE FIREFIELD"

From Sven Co-op
Jump to navigation Jump to search
(Created page with "frame|TE_FIREFIELD Spawns randomly positioned sprites in a cube or on a square plane. <pre> void te_firefield(Vector pos, uint16 radius=128, string...")
 
m
 
Line 26: Line 26:
 
* <code>uint8 flags</code> Combinable options:
 
* <code>uint8 flags</code> Combinable options:
 
1 : All sprites will drift upwards
 
1 : All sprites will drift upwards
 +
<br>
 
2 : 50% of the sprites will drift upwards
 
2 : 50% of the sprites will drift upwards
 +
<br>
 
4 : Loop sprites at 15fps instead of playing one cycle stretched to fit the "life" time
 
4 : Loop sprites at 15fps instead of playing one cycle stretched to fit the "life" time
 +
<br>
 
8 : Display sprites at 50% opacity
 
8 : Display sprites at 50% opacity
 +
<br>
 
16 : Spawn sprites on a flat plane instead of in cube
 
16 : Spawn sprites on a flat plane instead of in cube
 +
<br>
 
* <code>uint8 life</code> Time to display sprites (seconds * 0.1 +/- some random amount)
 
* <code>uint8 life</code> Time to display sprites (seconds * 0.1 +/- some random amount)
 
[[Category:Scripting]]
 
[[Category:Scripting]]

Latest revision as of 16:16, 23 July 2025

TE_FIREFIELD

Spawns randomly positioned sprites in a cube or on a square plane.

void te_firefield(Vector pos, uint16 radius=128, 
	string sprite="sprites/grenade.spr", uint8 count=128, 
	uint8 flags=30, uint8 life=5,
	NetworkMessageDest msgType=MSG_BROADCAST, edict_t@ dest=null) 
{
	NetworkMessage m(msgType, NetworkMessages::SVC_TEMPENTITY, dest);
	m.WriteByte(TE_FIREFIELD);
	m.WriteCoord(pos.x);
	m.WriteCoord(pos.y);
	m.WriteCoord(pos.z);
	m.WriteShort(radius);
	m.WriteShort(g_EngineFuncs.ModelIndex(sprite));
	m.WriteByte(count);
	m.WriteByte(flags);
	m.WriteByte(life);
	m.End();
}
  • Vector pos Center point of the effect
  • uint16 radius Size of the cube or square (distance from center point to a side)
  • string sprite Sprite to display (alpha transparency)
  • uint8 count Number of sprites to spawn
  • uint8 flags Combinable options:

1 : All sprites will drift upwards
2 : 50% of the sprites will drift upwards
4 : Loop sprites at 15fps instead of playing one cycle stretched to fit the "life" time
8 : Display sprites at 50% opacity
16 : Spawn sprites on a flat plane instead of in cube

  • uint8 life Time to display sprites (seconds * 0.1 +/- some random amount)