Effect flags: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎Usage from Hammer: tweaked FGD code for clarity.)
m (added language bar. also some formatting.)
Line 1: Line 1:
For configuring client-side visual effects.
{{lang|Effect flags|title=Effect Flags}}[[Category:Flags]]
A set of bitflags for configuring client-side visual effects.


== Usage from Hammer ==
== Usage From Hammer ==
 
Effect flags can be configured from Hammer. To do so, turn off [[SmartEdit]] and add a new keyvalue pair:
Effect flags can be configured from Hammer. To do so turn off [[SmartEdit]] and add a new keyvalue pair:


  effects <n>
  effects <n>


'<code>n</code>' is the sum total of the flags you want to use. For example, 66 would mean <code>EF_BRIGHTLIGHT</code> and <code>EF_NORECEIVESHADOW</code>.
"<code style=padding:0>n</code>" is the sum total of the flags you want to use. For example, 66 would mean <code>EF_BRIGHTLIGHT</code> and <code style=padding:0>EF_NORECEIVESHADOW</code>.


Alternatively, you can add the following code (or similar) to the [[FGD]] entries of entities you wish to use effect flags on:
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." =
  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: "None"
  0: "None"
Line 25: Line 25:
  ]
  ]
If you wish to use effect flags on enough entity classes, it may be worthwhile to create or modify a <code>BaseClass</code> instead of adding code to numerous entity classes individually.
If you wish to use effect flags on enough entity classes, it may be worthwhile to create or modify a <code>BaseClass</code> instead of adding code to numerous entity classes individually.
{{tip|Effect flags are enabled by default in {{teamSpen|4}}.}}


== Flags ==
== Flags ==
 
;1     - {{ent|EF_BONEMERGE}}:Merges bones of names shared with a parent entity to the position and direction of the parent's.
;1 - <code>[[EF_BONEMERGE]]</code>
;2     - {{ent|EF_BRIGHTLIGHT}}:Emits a dynamic light of RGB(250,250,250) and a random radius of 400 to 431 from the origin.
:Merges bones of names shared with a parent entity to the position and direction of the parent's.
;4     - {{ent|EF_DIMLIGHT}}:Emits a dynamic light of RGB(100,100,100) and a random radius of 200 to 231 from the origin.
;2 - <code>[[EF_BRIGHTLIGHT]]</code>
;8     - <code style=padding:0>EF_NOINTERP</code>:Don't [[interpolation|interpolate]] on the next frame.{{warning|Causes crashes.}}
:Emits a dynamic light of RGB(250,250,250) and a random radius of 400 to 431 from the origin.
;16   - {{ent|EF_NOSHADOW}}:Don't create a render-to-texture shadow, does not affect projected texture shadows.{{note|Same as <code style{{=}}padding:0>disableshadows 1</code>.}}
;4 - <code>[[EF_DIMLIGHT]]</code>
;32   - {{ent|EF_NODRAW}}:Entity is completely ignored by the client, and stops drawing the entity. Can cause prediction errors if a player proceeds to collide with it on the server, so use {{ent|Render Modes|alt=rendermode|10}} instead if this is a problem.
:Emits a dynamic light of RGB(100,100,100) and a random radius of 200 to 231 from the origin.
;64   - <code style=padding:0>EF_NORECEIVESHADOW</code>:Don't receive dynamic shadows.{{note|Same as <code style{{=}}padding:0>disablereceiveshadows 1</code>.}}
;8 - <code>EF_NOINTERP</code>
;128   - {{ent|EF_BONEMERGE_FASTCULL}}:For use with <code style=padding:0>EF_BONEMERGE</code>. If set, the entity will use its parent's origin to calculate whether it is visible; if not set, it will set up parent's bones every frame even if the parent is not in the [[PVS]].
:Don't [[interpolation|interpolate]] on the next frame.
;256   - {{ent|EF_ITEM_BLINK}}:Blink an item so that the user notices it. Added for original Xbox, and not very subtle.
{{warning|Causes crashes.}}
;512   - {{ent|EF_PARENT_ANIMATES}}:Assume that the [[parent]] entity is always animating. Causes it to realign every frame.{{Note|Does not function with the <code>effects</code> keyvalue.}}
;16 - <code>[[EF_NOSHADOW]]</code>
;1024 - <code style=padding:0>EF_MARKED_FOR_FAST_REFLECTION</code>:Marks the entity to render in fast water reflections.{{note|Same as <code style{{=}}padding:0>drawinfastreflection 1.</code>}}
:Don't create a render-to-texture shadow, does not affect projected texture shadows.
;2048 - <code style=padding:0>EF_NOSHADOWDEPTH</code>:Stops {{ent|env_cascade_lighting}} and {{ent|env_projectedtexture}} from making shadows for this entity.{{note|Same as <code style{{=}}padding:0>disableshadowdepth 1</code>.}}
{{note|Same as disableshadows 1.}}
;4096 - <code style=padding:0>EF_SHADOWDEPTH_NOCACHE</code>:Don't cache this entity into shadow depthmaps, update it every frame.
;32 - <code>[[EF_NODRAW]]</code>
;8192 - <code style=padding:0>EF_NOFLASHLIGHT</code>:Stops projected textures from making shadows for this entity.{{note|Same as <code style{{=}}padding:0>disableflashlight 1</code>.}}
:Entity is completely ignored by the client, and stops drawing the entity. Can cause prediction errors if a player proceeds to collide with it on the server, use <code>rendermode 10</code> instead if this is a problem.
;16384 - <code style=padding:0>EF_NOCSM</code> {{csgo|since}}:Don't cast shadows from cascade shadow maps.
;64 - <code>EF_NORECEIVESHADOW </code>
:Don't receive dynamic shadows.
{{note|Same as disablereceiveshadows 1.}}
;128 - <code>[[EF_BONEMERGE_FASTCULL]]</code>
:For use with <code>[[EF_BONEMERGE]]</code>. If set, the entity will use its parent's origin to calculate whether it is visible; if not set, it will set up parent's bones every frame even if the parent is not in the [[PVS]].
;256 - <code>[[EF_ITEM_BLINK]]</code>
:Blink an item so that the user notices it. Added for original Xbox, and really not subtle.
;512 - <code>[[EF_PARENT_ANIMATES]]</code>
:Assume that the [[parent]] entity is always animating. Causes it to realign every frame.
{{Note|Does not function with the "effects" keyvalue.}}
;1024 - <code>EF_MARKED_FOR_FAST_REFLECTION</code>
:Marks the entity to render in fast water reflections.
{{note|Same as drawinfastreflection 1.}}
;2048 - <code>EF_NOSHADOWDEPTH</code>
: Stops [[env_cascade_lighting]] and [[env_projected_texture]] from making shadows for this entity.
{{note|Same as disableshadowdepth 1.}}
;4096 - <code>EF_SHADOWDEPTH_NOCACHE</code>
: Don't cache this entity into shadow depthmaps, update it every frame.
;8192 - <code>EF_NOFLASHLIGHT</code>
:Stops projected textures from making shadows for this entity.
{{note|Same as disableflashlight 1.}}
;{{CSGO add | 16384 - <code>EF_NOCSM</code>}}
:Don't cast shadows from cascade shadow maps.
 
== Functions ==
== Functions ==
*<code>AddEFlags()</code> / <code>SetEFlags()</code>
*<code>AddEFlags()</code> / <code>SetEFlags()</code>
*<code>RemoveEFlags()</code>
*<code>RemoveEFlags()</code>
*<code>GetEFlags()</code>
*<code>GetEFlags()</code>
*<code>IsEFlagSet()</code>
*<code>IsEFlagSet()</code>
 
== See Also ==
[[Category:Flags]]
* <code style=padding:0>[http://wiki.sourcepython.com/_modules/entities/constants.html entities.constants]</code>
 
* [[Non-FGD features]]
== External links ==
* [[Render Modes]]
* [http://wiki.sourcepython.com/_modules/entities/constants.html entities.constants]

Revision as of 17:19, 24 May 2022

English (en)Translate (Translate)

A set of bitflags for configuring client-side visual effects.

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: "None"
	1: "Bonemerge always (very expensive!)"
	2: "Bright, dynamic light at entity origin"
	4: "Dim, dynamic light at entity origin"
	8: "No movement interpolation"
	16: "Don't cast shadows"
	32: "Don't draw entity (entity is fully ignored by clients, NOT server; can cause collision problems)"
	64: "Don't receive dynamic shadows"
	128: "Bonemerge only in PVS, better performance but prone to disappearing. Use with Bonemerge."
	256: "Unsubtle blink"
	512: "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.pngTip:Effect flags are enabled by default in TeamSpen's Hammer Addons 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.pngWarning:Causes crashes.
16 - EF_NOSHADOW
Don't create a render-to-texture shadow, does not affect projected texture shadows.
Note.pngNote:Same as disableshadows 1.
32 - EF_NODRAW
Entity is completely ignored by the client, and stops drawing the entity. 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.pngNote:Same as disablereceiveshadows 1.
128 - EF_BONEMERGE_FASTCULL
For use with EF_BONEMERGE. If set, the entity will use its parent's origin to calculate whether it is visible; if not set, it will set up parent's bones every frame even if the parent is not in the PVS.
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.pngNote:Does not function with the effects keyvalue.
1024 - EF_MARKED_FOR_FAST_REFLECTION
Marks the entity to render in fast water reflections.
Note.pngNote:Same as drawinfastreflection 1.
2048 - EF_NOSHADOWDEPTH
Stops env_cascade_lighting and env_projectedtexture from making shadows for this entity.
Note.pngNote:Same as disableshadowdepth 1.
4096 - EF_SHADOWDEPTH_NOCACHE
Don't cache this entity into shadow depthmaps, update it every frame.
8192 - EF_NOFLASHLIGHT
Stops projected textures from making shadows for this entity.
Note.pngNote:Same as disableflashlight 1.
16384 - EF_NOCSM (in all games since Counter-Strike: Global Offensive)
Don't cast shadows from cascade shadow maps.

Functions

  • AddEFlags() / SetEFlags()
  • RemoveEFlags()
  • GetEFlags()
  • IsEFlagSet()

See Also