Skip to content

Temporary Entities

GeckoN edited this page Jan 27, 2017 · 10 revisions

Introduction:

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.

Everything I know is from this post and my own testing. I probably made some mistakes, and I couldn't get all effects to work. Let me (w00tguy) know of any inaccuracies or if you were able to get TE_LIGHTNING or TE_BSPDECAL to work.

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 palette #1

Engine palette #2

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) { this.r = r; this.g = g; this.b = b; this.a = 255; }
    Color(uint8 r, uint8 g, uint8 b, uint8 a) { this.r = r; this.g = g; this.b = b; this.a = a; }
    Color(float r, float g, float b, float a) { this.r = uint8(r); this.g = uint8(g); this.b = uint8(b); this.a = uint8(a); }
    Color (Vector v) { this.r = uint8(v.x); this.g = uint8(v.y); this.b = uint8(v.z); this.a = 255; }
    string ToString() { return "" + r + " " + g + " " + b + " " + a; }
    Vector getRGB() { return Vector(r, g, b); }
}
Color PURPLE = Color(127,0,255);
Color WHITE  = Color(255,255,255);

This script includes all code snippets in one file. Enable/disable lines in the doEffect() function to test out different effects. Some of these functions have API equivalents, so just use those unless you have special needs.

Clone this wiki locally