Skip to content

Temporary Entities

GeckoN edited this page Feb 7, 2017 · 10 revisions

Temporary entities are like normal entities except that they automatically kill themselves, use less bandwidth, and don't crash the map if there are too many of them. All effects are visual only and don't deal any damage or interact with other entities. Everything here is created using NetworkMessage, which lets you control which players can see the effect.

The point of this page is to demonstrate what each of the TE_* effects do and how you can customize them. Some of these effects can be created via API functions, but using NetworkMessages can give you a little more flexibility in those cases.

Most of the information presented here is based on this post, Half-Life SDK source files, and testing done by w00tguy and me (GeckonCZ). Please let us know of any inaccuracies or omissions.

See the Code Comments section or the example script if the code snippets are unclear and/or don't work for you.

Contents

Beam Effects

TE_BEAMPOINTS TE_BEAMENTPOINT
TE_BEAMENTS TE_BEAMDISK
TE_BEAMCYLINDER TE_BEAMTORUS
TE_BEAMRING TE_LIGHTNING
TE_BEAMSPRITE TE_BEAMFOLLOW
TE_KILLBEAM

Explosions & Simple Sprite Effects

TE_EXPLOSION TE_SMOKE
TE_SPARKS TE_SPRITE
TE_GLOWSPRITE TE_ARMOR_RICOCHET
TE_DLIGHT TE_ELIGHT
TE_PLAYERATTACHMENT TE_KILLPLAYERATTACHMENTS

Sprite-based Particle Effects

TE_SPRITETRAIL TE_BUBBLETRAIL
TE_LARGEFUNNEL TE_FIZZ
TE_BUBBLES TE_SPRITE_SPRAY
TE_SPRAY TE_BLOODSPRITE
TE_FIREFIELD TE_PLAYERSPRITES

Quake-style Effects

TE_GUNSHOT TE_TAREXPLOSION
TE_EXPLOSION2 TE_PARTICLEBURST
TE_LAVASPLASH TE_TELEPORT
TE_LINE TE_SHOWLINE
TE_BOX TE_BLOODSTREAM
TE_BLOOD

Gibs & Other Model Effects

TE_MODEL TE_EXPLODEMODEL
TE_BREAKMODEL TE_PROJECTILE

Tracer Effects

TE_TRACER TE_IMPLOSION
TE_STREAK_SPLASH TE_USERTRACER

Decals

I don't recommend using these directly. Use the API functions defined in CUtility instead.

TE_DECAL TE_PLAYERDECAL
TE_GUNSHOTDECAL TE_MULTIGUNSHOT
TE_DECALHIGH TE_WORLDDECAL
TE_WORLDDECALHIGH TE_BSPDECAL

Miscellaneous

TE_TEXTMESSAGE
 

Engine Color Palettes

Palette #1

Palette #1 is slightly modified Quake palette and is used by TE_PARTICLEBURST, TE_BLOOD, TE_BLOODSTREAM, and TE_BLOODSPRITE effects.

Palette #2

Palette #2 is used by tracer effects, namely TE_USERTRACER and TE_STREAK_SPLASH. TE_TRACER uses color #4 from this palette.

Notes:

  • This color palette is hardcoded into the engine and only the first 12 colors are defined (index 0 through 11).
  • Index 4 holds the Default Tracer Color. Its initial value is {0,0,0} (Black), but the actual run-time color depends on a value of tracerred, tracergreen and tracerblue cvars. Opacity is determined by traceralpha cvar. Default RGB values are 0.8, 0.8 and 0.4. Defaut alpha is 0.5.

Code Comments

Anywhere you see a "sprite" parameter, assume that you can use either a sprite or a model (the same goes for "model" parameters).

When you see a parameter of type "Color", that's referring to a helper class I made. Copy paste this into your script so that the color args work:

class Color
{ 
	uint8 r, g, b, a;
	
	Color() { r = g = b = a = 0; }
	Color(uint8 _r, uint8 _g, uint8 _b, uint8 _a = 255 ) { r = _r; g = _g; b = _b; a = _a; }
	Color (Vector v) { r = int(v.x); g = int(v.y); b = int(v.z); a = 255; }
	string ToString() { return "" + r + " " + g + " " + b + " " + a; }
}

const Color RED(255,0,0);
const Color GREEN(0,255,0);
const Color BLUE(0,0,255);

This script includes all code snippets in one file. Load the plugin and say /te # where # is index of the effect you want to test. For example, to test TE_EXPLOSION effect say:

/te 3

See DoEffect() function for more information. Some of these functions have API equivalents, so just use those unless you have special needs.

Clone this wiki locally