Difference between revisions of "Fog volume"

From Valve Developer Community
Jump to: navigation, search
(Available in Left 4 Dead series to Available in all Source games since Left 4 Dead)
 
Line 1: Line 1:
{{l4d series brush|fog_volume}}, as well as {{portal2}}[[Portal 2]] and {{game link|Alien Swarm}}. It controls fog and other visual cinematic elements within its volume. It is necessary to have at least one <code>fog_volume</code> in order for (a master) [[color_correction]] to take effect in Left 4 Dead and Left 4 Dead 2.
+
{{brush ent|fog_volume|since=Left 4 Dead}} It controls fog and other visual cinematic elements within its volume. It is necessary to have at least one <code>fog_volume</code> in order for (a master) [[color_correction]] to take effect in Left 4 Dead and Left 4 Dead 2.
  
 
{{tip|There is a Fog Panel in {{game link|Left 4 Dead 2}} that allows in-game manipulation of fog parameters. It is loaded via console command <code>fogui</code>. This command exists in {{portal2}}[[Portal 2]] but does not function.}}
 
{{tip|There is a Fog Panel in {{game link|Left 4 Dead 2}} that allows in-game manipulation of fog parameters. It is loaded via console command <code>fogui</code>. This command exists in {{portal2}}[[Portal 2]] but does not function.}}

Latest revision as of 18:36, 24 May 2019

fog_volume is a brush entity available in all Source games since <Left 4 Dead> Left 4 Dead. It controls fog and other visual cinematic elements within its volume. It is necessary to have at least one fog_volume in order for (a master) color_correction to take effect in Left 4 Dead and Left 4 Dead 2.

Tip:There is a Fog Panel in <Left 4 Dead 2> Left 4 Dead 2 that allows in-game manipulation of fog parameters. It is loaded via console command fogui. This command exists in [Portal 2]Portal 2 but does not function.
Note:<Alien Swarm> Alien Swarm does not use the origin of a player to decide which fog volume he is in, but rather camera position. Due to this, you must make sure that your fog volume is taller (height) then the highest point a marines camera can reach, i.e: The distance from the camera in height from the marine.
Note:In {mods using Source 2007 and Source 2013 you can create client-side fog changing functionality in a multiplayer game using instead trigger_multiple. Have at least 2 env_fog_controller with different fog settings and one checked with Master flag. Use OnStartTouch > !activator > SetFogController > [name of env_fog_controller entity]. The input will appear as red, but it still works. Use OnEndTouch() to change the fog back.
Note:In <Counter-Strike: Global Offensive> (and perhaps other games), binding multiple brushes to fog_volume will produce the fog effect for the bounding box of the group of brushes i.e. if you have 2 blocks for fog_volume in an L-shaped hallway, standing in a room in the inside corner of that hallway will trigger the fog as well

Keyvalues

Fog Name <targetname>
The name of the fog entity associated with this volume.
Postprocess Name <targetname>
The name of the postprocess entity associated with this volume.
ColorCorrection Name <targetname>
The name of the color_correction entity associated with this volume.

Targetname:

Name <string>
The targetname that other entities refer to this entity by.
Entity Scripts <scriptlist> (New with Left 4 Dead 2)
Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.
Script think function <string> (New with Left 4 Dead 2)
Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call.
Note:Try to avoid expensive operations in this function, as it may cause performance problems.

EnableDisable:

Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (probably with the Enable input).

Inputs

Targetname:

Kill
Removes this entity and any entities parented to it from the world.
KillHierarchy
Functions the same as Kill, although this entity and any entities parented to it are killed on the same frame, being marginally faster than Kill.
AddOutput  <string>
Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.
Use  !FGD
Same as a player invoking +use; may not do anything. Can also be invoked by creating an output that does not specify an input.
This input is not included in Valve's FGDs.
RunScriptFile  <script> (New with Left 4 Dead 2)
Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode  <string> (New with Left 4 Dead 2)
Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console.
Bug: In <Left 4 Dead 2>, the code is executed in the script scope of the entity that fires the output, not the one receiving the input.
Warning: Never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor.
CallScriptFunction  <string> (New with Left 4 Dead 2) !FGD
Execute a VScript function in the scope of the receiving entity.
SetLocalOrigin  <coordinates> (New with Alien Swarm) !FGD
Send this entity to a spot in the map. If the entity is parented to something, it will be offset from the parent by this amount.
SetLocalAngles  <angles> (New with Alien Swarm) !FGD
Set this entity's angles.

EnableDisable:

Enable
Disable
Enable/disable this entity from performing its task. It might also disappear from view.

Outputs

Targetname:

OnUser1 to OnUser4
These Outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see User Inputs and Outputs.
OnKilled  (Only in the Left 4 Dead series)
This Output fires when the entity is killed and removed from the game.

See also

External links