Difference between revisions of "TE BEAMFOLLOW"
Jump to navigation
Jump to search
Outerbeast (talk | contribs) (Created page with "A beam trail that follows a moving entity. The trail will kill itself if the entity is stopped and doesn't start moving within 1 second, or if the beam catches up with itself...") |
Outerbeast (talk | contribs) m |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
A beam trail that follows a moving entity. The trail will kill itself if the entity is stopped and doesn't start moving within 1 second, or if the beam catches up with itself after the entity has stopped moving. | A beam trail that follows a moving entity. The trail will kill itself if the entity is stopped and doesn't start moving within 1 second, or if the beam catches up with itself after the entity has stopped moving. | ||
| − | [[File:TE_BEAMFOLLOW|frame|TE_BEAMFOLLOW]] | + | [[File:TE_BEAMFOLLOW.gif|frame|TE_BEAMFOLLOW]] |
<pre> | <pre> | ||
void te_trail(CBaseEntity@ target, string sprite="sprites/laserbeam.spr", | void te_trail(CBaseEntity@ target, string sprite="sprites/laserbeam.spr", | ||
| Line 20: | Line 20: | ||
</pre> | </pre> | ||
| − | * CBaseEntity@ target Entity target for the beam to follow | + | * <code>CBaseEntity@ target</code> Entity target for the beam to follow |
| − | * string sprite Sprite used to display the beam | + | * <code>string sprite</code> Sprite used to display the beam |
| − | * uint8 life Time before the trail fades out (seconds * 0.1) | + | * <code>uint8 life</code> Time before the trail fades out (seconds * 0.1) |
| − | * uint8 width Width of the beam (units * 0.1) | + | * <code>uint8 width</code> Width of the beam (units * 0.1) |
| − | * int attachmentpoint attachment point on the model to attach the beam | + | * <code>int attachmentpoint</code> attachment point on the model to attach the beam |
| − | * RGBA c Color and brightness of the beam | + | * <code>RGBA c</code> Color and brightness of the beam |
| + | [[Category:Scripting]] | ||
Latest revision as of 20:43, 12 April 2025
A beam trail that follows a moving entity. The trail will kill itself if the entity is stopped and doesn't start moving within 1 second, or if the beam catches up with itself after the entity has stopped moving.
void te_trail(CBaseEntity@ target, string sprite="sprites/laserbeam.spr",
uint8 life=100, uint8 width=2, int attachmentpoint = 0, RGBA c=RGBA_PURPLE,
NetworkMessageDest msgType=MSG_BROADCAST, edict_t@ dest=null)
{
NetworkMessage m(msgType, NetworkMessages::SVC_TEMPENTITY, dest);
m.WriteByte(TE_BEAMFOLLOW);
m.WriteShort(target.entindex() + 0x1000 * ( attachmentpoint + 1 ) );
m.WriteShort(g_EngineFuncs.ModelIndex(sprite));
m.WriteByte(life);
m.WriteByte(width);
m.WriteByte(c.r);
m.WriteByte(c.g);
m.WriteByte(c.b);
m.WriteByte(c.a);
m.End();
}
CBaseEntity@ targetEntity target for the beam to followstring spriteSprite used to display the beamuint8 lifeTime before the trail fades out (seconds * 0.1)uint8 widthWidth of the beam (units * 0.1)int attachmentpointattachment point on the model to attach the beamRGBA cColor and brightness of the beam
