Temporary Effects

From Sven Co-op
Jump to navigation Jump to search

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.

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).

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