This article's documentation is for anything that uses the Source engine. Click here for more information.

Env wind: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (client side bug)
(activator/caller)
 
(16 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{lang|Env wind}}
{{LanguageBar}}
{{base point|env_wind|sprite=1}} It creates wind throughout an entire map.
{{Preserved entity}}
{{PreservedEnt}}
{{CD|CEnvWind|file1=effects.cpp}}
{{this is a|point entity|name=env_wind|sprite=1}} It creates wind throughout an entire map, which affect [[prop_physics|physics props]], [[$treesway|swaying trees]], and [[func_dustmotes|dust]].


{{note|Wind direction is determined by <code>env_wind</code>'s yaw value.}}
{{note|Wind direction is determined by <code>env_wind</code>'s yaw value.}}
{{note|In most games that have {{ent|$treeSway}}, this entity is required in order for the materials to simulate wind blowing on them. <code>$treesway</code> does not require <code>env_wind</code> if <code>$treeswaystatic</code> ({{tf2}}{{GMOD}} only) is used.}}
{{note|In most games, this entity is required for {{ent|$treesway}} to have any effect, unless {{code|$treeswaystatic}} {{only|{{tf2branch}}{{GMOD}}{{csgo}}{{mapbase}}}} is used.}}
{{bug|Wind effect in client game will not stop when loading next map which not include env_wind entity at all}}
{{bug|The wind effect in the client game will not reset when a new map is loaded which does not contain an env_wind entity.}}
{{code class|CEnvWind|effects.cpp}}
{{tip|In {{bms|4}} this entity can be spawned via {{ent|point_template}} and killed with {{code|Kill}} input. This allows you to change the wind globally or turn it off completely by spawning new {{ent|env_wind}} and killing via {{code|Kill}} input the previous {{ent|env_wind}}.}}


{{clr}}
{{clr}}
__NOTOC__
== Keyvalues ==
{{KV Targetname}}
{{KV|Min normal speed|intn=minwind|integer|Minimum speed of the wind while idling.}}
{{KV|Max normal speed|intn=maxwind|integer|Maximum speed of the wind while idling.}}
{{KV|Min gust speed|intn=mingust|integer|Minimum speed of wind gusts.}}
{{KV|Max gust speed|intn=maxgust|integer|Maximum speed of wind gusts.}}
{{KV|Min gust delay|intn=mingustdelay|integer|Minimum time delay between random gusts.}}
{{KV|Max gust delay|intn=maxgustdelay|integer|Maximum time delay between random gusts.}}
{{KV|Gust Duration|intn=gustduration|integer|How long will the wind gust for.}}
{{KV|Max gust dir change (degrees)|intn=gustdirchange|integer|Maximum amount that the wind's direction changes due to a gust.}}
{{KV|Radius|intn=windradius|float|only=L4ds|The radius this entity applies wind effects to. -1 for global effect.}}


==Keyvalues==
== Inputs ==
{{KV|Min normal speed (minwind)|integer|Minimum speed of the wind while idling.}}
{{I|SetWindDir|Set the wind's direction to this.|param=int|nofgd=1|only=GMOD}}
{{KV|Max normal speed (maxwind)|integer|Maximum speed of the wind while idling.}}
{{I|Enable|Turns the wind on.|only={{P2CE}}}}
{{KV|Min gust speed (mingust)|integer|Minimum speed of wind gusts.}}
{{I|Disable|Turns the wind off.|only={{P2CE}}}}
{{KV|Max gust speed (maxgust)|integer|Maximum speed of wind gusts.}}
{{KV|Min gust delay (mingustdelay)|integer|Minimum time delay between random gusts.}}
{{KV|Max gust delay (maxgustdelay)|integer|Maximum time delay between random gusts.}}
{{KV|Gust Duration (gustduration)|integer|How long will the wind gust for.}}
{{KV|Max gust dir change (degrees) (gustdirchange)|integer|Maximum amount that the wind's direction changes due to a gust.}}
{{KV|Radius (windradius)|float|only=L4ds|The radius this entity applies wind effects to. -1 for global effect.}}
{{KV BaseEntity}}


==Inputs==
== Outputs ==
{{IO|SetWindDir|Set the wind's direction to this.|param=int|nofgd=1|only=GMOD}}
{{O|OnGustStart|activator=!caller = NULL|caller=hide|Fired when a wind gust begins.
{{IO|Enable|Turns the wind on|only={{P2CE}}}}
:{{Bug|env_wind gusts can seemingly pile up and fire this output multiple times when a player first loads into a multiplayer map.  {{Workaround|Use AddOutput to add OnGustStart effects when players are already connected}}{{Todo|Needs more testing, only observed in {{tf2}} }}}}}}
{{IO|Disable|Turns the wind off|only={{P2CE}}}}
{{O|OnGustEnd|activator=!caller = NULL|caller=hide|Fired when a wind gust ends.}}
{{I BaseEntity}}


==Outputs==
== See also ==
{{IO|OnGustStart|Fired when a wind gust begins.}}
* {{ent|trigger_wind}}
{{IO|OnGustEnd|Fired when a wind gust ends.}}
* {{ent|trigger_push}}
{{O BaseEntity|l4d=1}}
* {{ent|env_rotorwash}}
 
==See Also==
*{{ent|trigger_wind}}
*{{ent|trigger_push}}
*{{ent|env_rotorwash}}

Latest revision as of 18:20, 8 May 2025

English (en)Translate (Translate)
Recycle-warning.png
This is a preserved entity in Counter-Strike: SourceHalf-Life 2: DeathmatchDay of Defeat: SourceTeam Fortress 2Left 4 DeadLeft 4 Dead 2Portal 2Counter-Strike: Global Offensive
If the game has round restart mechanics this entity may not behave as expected.
C++ Class hierarchy
CEnvWind
CBaseEntity
C++ effects.cpp
Env wind.png

env_wind is a point entity available in all Source Source games. It creates wind throughout an entire map, which affect physics props, swaying trees, and dust.

Note.pngNote:Wind direction is determined by env_wind's yaw value.
Note.pngNote:In most games, this entity is required for $treesway to have any effect, unless $treeswaystatic (only in Team Fortress 2 branchGarry's ModCounter-Strike: Global OffensiveMapbase) is used.
Icon-Bug.pngBug:The wind effect in the client game will not reset when a new map is loaded which does not contain an env_wind entity.  [todo tested in ?]
Tip.pngTip:In Black Mesa Black Mesa this entity can be spawned via point_template and killed with Kill input. This allows you to change the wind globally or turn it off completely by spawning new env_wind and killing via Kill input the previous env_wind.

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Min normal speed (minwind) <integer>
Minimum speed of the wind while idling.
Max normal speed (maxwind) <integer>
Maximum speed of the wind while idling.
Min gust speed (mingust) <integer>
Minimum speed of wind gusts.
Max gust speed (maxgust) <integer>
Maximum speed of wind gusts.
Min gust delay (mingustdelay) <integer>
Minimum time delay between random gusts.
Max gust delay (maxgustdelay) <integer>
Maximum time delay between random gusts.
Gust Duration (gustduration) <integer>
How long will the wind gust for.
Max gust dir change (degrees) (gustdirchange) <integer>
Maximum amount that the wind's direction changes due to a gust.
Radius (windradius) <float> (only in Left 4 Dead seriesLeft 4 Dead series)
The radius this entity applies wind effects to. -1 for global effect.

Inputs

SetWindDir <integerRedirectInput/integer> (only in Garry's Mod) !FGD
Set the wind's direction to this.
Enable  (only in Portal 2: Community Edition)
Turns the wind on.
Disable  (only in Portal 2: Community Edition)
Turns the wind off.

Outputs

OnGustStart
!activator = !caller = NULL
Fired when a wind gust begins.
Icon-Bug.pngBug:env_wind gusts can seemingly pile up and fire this output multiple times when a player first loads into a multiplayer map.
PlacementTip.pngWorkaround:Use AddOutput to add OnGustStart effects when players are already connected
Todo: Needs more testing, only observed in Team Fortress 2
  [todo tested in ?]
OnGustEnd
!activator = !caller = NULL
Fired when a wind gust ends.

See also