Effect flags (Source)
A set of bitflags for configuring client-side visual effects.
Contents
Usage From Hammer
Effect flags can be configured from Hammer. To do so, turn off SmartEdit and add a new keyvalue pair:
effects <n>
"n
" is the sum total of the flags you want to use. For example, 66 would mean EF_BRIGHTLIGHT
and EF_NORECEIVESHADOW
.
Alternatively, you can add the following code (or similar) to the FGD entries of entities you wish to use effect flags on:
effects(choices) : "Effect Flags" : 0 : "For configuring visual effects. If you want to combine effects, simply type in the sum of the effect numbers, e.g., '72' for 64+8." = [ 0: "0 - None" 1: "1 - EF_BONEMERGE: Bonemerge always (very expensive!)" 2: "2 - EF_BRIGHTLIGHT: Bright, dynamic light at entity origin" 4: "4 - EF_DIMLIGHT: Dim, dynamic light at entity origin" 8: "8 - EF_NOINTERP: No movement interpolation" 16: "16 - EF_NOSHADOW: Don't cast shadows" 32: "32 - EF_NODRAW: Don't draw entity (entity is fully ignored by clients, NOT server; can cause collision problems)" 64: "64 - EF_NORECEIVESHADOW: Don't receive dynamic shadows" 128: "128 - EF_BONEMERGE_FASTCULL: Bonemerge only in PVS, better performance but prone to disappearing. Use with Bonemerge." 256: "256 - EF_ITEM_BLINK: Unsubtle blink" 512: "512 - EF_PARENT_ANIMATES: Flag parent as always animating and realign each frame" ]
If you wish to use effect flags on enough entity classes, it may be worthwhile to create or modify a BaseClass
instead of adding code to numerous entity classes individually.
Tip:Effect flags are enabled by default in TeamSpen's Hammer Addons.
Flags
- [
1
] : EF_BONEMERGE
Merges bones of names shared with a parent entity to the position and direction of the parent's. - [
2
] : EF_BRIGHTLIGHT
Emits a dynamic light of RGB(250,250,250) and a random radius of 400 to 431 from the origin. - [
4
] : EF_DIMLIGHT
Emits a dynamic light of RGB(100,100,100) and a random radius of 200 to 231 from the origin.
- [
8
] : EF_NOINTERP
Don't interpolate on the next frame.Warning:Causes crashes. - [
16
] : EF_NOSHADOW
Don't create a render-to-texture shadow, does not affect projected texture shadows.Note:Same asdisableshadows 1
. - [
32
] : EF_NODRAW
Entity is completely ignored by the client, and stops drawing the entity.
Important:Can cause prediction errors if a player proceeds to collide with it on the server, so use
rendermode 10
instead if this is a problem.- [
64
] : EF_NORECEIVESHADOW
Don't receive dynamic shadows.Note:Same asdisablereceiveshadows 1
. - [
128
] : EF_BONEMERGE_FASTCULL - [
256
] : EF_ITEM_BLINK
Blink an item so that the user notices it. Added for original Xbox, and not very subtle. - [
512
] : EF_PARENT_ANIMATES
Assume that the parent entity is always animating. Causes it to realign every frame.Note:Does not function with theeffects
keyvalue. - [
1024
] : EF_MARKED_FOR_FAST_REFLECTION (in all games since )
Marks the entity to render in fast water reflections.Note:Same asdrawinfastreflection 1.
- [
2048
] : EF_NOSHADOWDEPTH (in all games since )
Stopsenv_cascade_lighting
andenv_projectedtexture
from making shadows for this entity.Note:Same asdisableshadowdepth 1
. - [
4096
] : EF_SHADOWDEPTH_NOCACHE
Don't cache this entity into shadow depthmaps, update it every frame. - [
8192
] : EF_NOFLASHLIGHT (in all games since )
Stops projected textures from making shadows for this entity.Note:Same asdisableflashlight 1
. - [
16384
] : EF_NOCSM (in all games since )
Don't cast shadows from cascade shadow maps.
Functions
AddEFlags()
/SetEFlags()
RemoveEFlags()
GetEFlags()
IsEFlagSet()