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

Trigger wind: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Format please)
 
mNo edit summary
 
(36 intermediate revisions by 15 users not shown)
Line 1: Line 1:
trigger_wind
__NOTOC__{{CD|CTriggerWind|file1=triggers.cpp}}
{{this is a|brush entity|name=trigger_wind}} It is a [[Triggers|trigger]] that pushes [[physics]] objects that touch its volume.
{{warning|[[Sv pushaway clientside size|Clientside]] {{ent|prop_physics}} aren't detected by this entity. Use Force server-side flag of such <kbd>prop_physics</kbd> if this is an issue.}}


A trigger volume that pushes physics objects that touch it.
== Keyvalues ==
{{KV Targetname}}
{{KV|Speed|intn=speed|integer|The baseline for how hard the wind blows.}}
{{KV|Speed Noise|intn=SpeedNoise|integer|Noise added to wind speed +/-}}
{{KV|Pitch Yaw Roll (Y Z X)|intn=angles|angles|Yaw sets the wind direction. Pitch and roll should be ignored.
{{warning|Brush also gets rotated but it's not shown in hammer}}}}
{{workaround|If [[vscript|Vscripts]] with NetProps functions are available then instead of using angles keyvalue create logic_auto that '''OnMapSpawn''' sends '''RunScriptCode''' input to trigger_wind with parameter. (45 yaw in this example)
<source lang=c>foreach(k,v in {m_nDirBase=45}) NetProps.SetPropInt(self,k,v)</source>}}
{{KV|Direction Noise|intn=DirectionNoise|integer|Noise added to wind direction.}}
{{KV|Hold Time|integer|intn=HoldTime|Baseline for how long to wait before changing wind.}}
{{KV|Hold Noise|integer|intn=HoldNoise|Noise added to how long to wait before changing wind.}}
{{KV|Filter Name|intn=filtername|filter|Name of filter entity to test against activators.}}
{{KV EnableDisable}}


KEYS
== Flags ==
Needs one of these flags checked to work.


Name targetname <target_source> The name that other entities refer to this entity by.
{{Fl|8|Physics Objects}}
{{Fl|64|Everything (not including physics debris)}}


Parent parentname <target_destination> The name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.
== Inputs ==
{{I|SetSpeed|Set the baseline for how hard the wind blows.|param=integer}}
{{I EnableDisable}}
{{Bug|tested=l4d2|Sometimes props that are inside this trigger's brush and are asleep won't be detected after '''Enable''' input.
{{Fix|Send '''Wake''' input to all the desired props.}}}}


Origin (X Y Z) origin <origin> The position of this entity's center in the world. Rotating entities typically rotate around their origin.
== See also ==
* {{ent|env_wind}}
* {{ent|env_rotorwash}}


Start Disabled StartDisabled <choices>
{{sensor brush}}
 
Global Entity Name globalname <string> Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state.
 
spawnflags spawnflags <flags>
 
Filter Name filtername <filterclass> Filter to use to see if activator triggers me. See filter_activator_name for more explanation.
 
Pitch Yaw Roll (Y Z X) angles <angle> This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
 
Speed Speed <integer> The baseline for how hard the wind blows.
 
Speed Noise SpeedNoise <integer> Noise added to wind speed +/-
 
Direction Noise DirectionNoise <integer> Noise added to wind direction.
 
Hold Time HoldTime <integer> Baseline for how long to wait before changing wind.
 
Hold Noise HoldNoise <integer> Noise added to how long to wait before changing wind.
 
 
INPUTS
 
Kill Removes this entity from the world.
 
KillHierarchy Removes this entity and all its children from the world.
 
AddOutput <string> Adds an entity I/O connection to this entity. Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>. Very dangerous, use with care.
 
FireUser1 Causes this entity's OnUser1 output to be fired.
 
FireUser2 Causes this entity's OnUser2 output to be fired.
 
FireUser3 Causes this entity's OnUser3 output to be fired.
 
FireUser4 Causes this entity's OnUser4 output to be fired.
 
SetParent <string> Changes the entity's parent in the movement hierarchy.
 
SetParentAttachment <string> Change this entity to attach to a specific attachment point on its parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment.
 
ClearParent Removes this entity from the the movement hierarchy, leaving it free to move independently.
 
Enable Enable this entity.
 
Disable Disable this entity.
 
Kill Removes this entity from the world.
 
KillHierarchy Removes this entity and all its children from the world.
 
AddOutput <string> Adds an entity I/O connection to this entity. Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>. Very dangerous, use with care.
 
FireUser1 Causes this entity's OnUser1 output to be fired.
 
FireUser2 Causes this entity's OnUser2 output to be fired.
 
FireUser3 Causes this entity's OnUser3 output to be fired.
 
FireUser4 Causes this entity's OnUser4 output to be fired.
 
SetParent <string> Changes the entity's parent in the movement hierarchy.
 
SetParentAttachment <string> Change this entity to attach to a specific attachment point on its parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment.
 
ClearParent Removes this entity from the the movement hierarchy, leaving it free to move independently.
 
Enable Enable this entity.
 
Disable Disable this entity.
 
Toggle Toggles this trigger between enabled and disabled states.
 
SetSpeed <integer> Set the baseline for how hard the wind blows.
 
 
OUTPUTS
 
OnUser1 Fired in response to FireUser1 input.
 
OnUser2 Fired in response to FireUser2 input.
 
OnUser3 Fired in response to FireUser3 input.
 
OnUser4 Fired in response to FireUser4 input.
 
OnUser1 Fired in response to FireUser1 input.
 
OnUser2 Fired in response to FireUser2 input.
 
OnUser3 Fired in response to FireUser3 input.
 
OnUser4 Fired in response to FireUser4 input.
 
OnStartTouch Fired when an entity starts touching this trigger. The touching entity must pass this trigger's filters to cause this output to fire.
 
OnEndTouch Fired when an entity stops touching this trigger. Only entities that passed this trigger's filters will cause this output to fire.
 
OnEndTouchAll Fires when an entity stops touching this trigger, and no other entities are touching it. Only entities that passed this trigger's filters are considered.

Latest revision as of 06:03, 12 March 2025

C++ Class hierarchy
CTriggerWind
CBaseVPhysicsTrigger
CBaseEntity
C++ triggers.cpp

trigger_wind is a brush entity available in all Source Source games. It is a trigger that pushes physics objects that touch its volume.

Warning.pngWarning:Clientside prop_physics aren't detected by this entity. Use Force server-side flag of such prop_physics if this is an issue.

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

Speed (speed) <integer>
The baseline for how hard the wind blows.
Speed Noise (SpeedNoise) <integer>
Noise added to wind speed +/-
Pitch Yaw Roll (Y Z X) (angles) <angles>
Yaw sets the wind direction. Pitch and roll should be ignored.
Warning.pngWarning:Brush also gets rotated but it's not shown in hammer
PlacementTip.pngWorkaround:If Vscripts with NetProps functions are available then instead of using angles keyvalue create logic_auto that OnMapSpawn sends RunScriptCode input to trigger_wind with parameter. (45 yaw in this example)
foreach(k,v in {m_nDirBase=45}) NetProps.SetPropInt(self,k,v)
Direction Noise (DirectionNoise) <integer>
Noise added to wind direction.
Hold Time (HoldTime) <integer>
Baseline for how long to wait before changing wind.
Hold Noise (HoldNoise) <integer>
Noise added to how long to wait before changing wind.
Filter Name (filtername) <filter>
Name of filter entity to test against activators.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).

Flags

Needs one of these flags checked to work.


Physics Objects : [8]
Everything (not including physics debris) : [64]

Inputs

SetSpeed <integerRedirectInput/integer>
Set the baseline for how hard the wind blows.

EnableDisable:

Enable / Disable
Enable/disable this entity from performing its task. It might also disappear from view.
Icon-Bug.pngBug:Sometimes props that are inside this trigger's brush and are asleep won't be detected after Enable input.
Note.pngFix:Send Wake input to all the desired props.
  (tested in: l4d2)

See also