Env physexplosion: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Revised hanging sway trick)
(-flags and internal names formatting, concise page)
Line 7: Line 7:


==Flags==
==Flags==
*1: No Damage - Only Force (Players are not ever damaged by the explosion (regardless of this flag), only objects.)
{{fl|1|No Damage|Only Force (Players are not ever damaged by the explosion (regardless of this flag), only objects.)}}
*2: Push players
{{fl|2|Push players|}}
*4: Push radially - not as a sphere (Radially meaning as a circle/cylinder. No upward or downward force will be generated.)
{{fl|4|Push radially|not as a sphere (Radially meaning as a circle/cylinder. No upward or downward force will be generated.)}}
*8: Test [[LOS]] before pushing
{{fl|8|Test [[LOS]] before pushing|}}
*16: Disorient player if pushed
{{fl|16|Disorient player if pushed|}}


==Keyvalues==
==Keyvalues==
{{KV|Magnitude (magnitude)|string|Amount of physics force applied by the explosion.
{{KV|Magnitude|intn=magnitude|string|Amount of physics force applied by the explosion.


{{note|The magnitude value is clamped between 1 and 100. If you require a bigger explosion than this, create multiple instances of the entity.}}}}
{{note|The magnitude value is clamped between 1 and 100. If you require a bigger explosion than this, create multiple instances of the entity.}}}}
{{KV|Clamp Radius (0 {{=}} auto) (radius)|string|If specified, the radius in which the explosion damages entities. If unspecified, the radius will be based on the magnitude.}}
{{KV|Clamp Radius (0 {{=}} auto)|intn=radius|string|If specified, the radius in which the explosion damages entities. If unspecified, the radius will be based on the magnitude.}}
{{KV|Limit to Entity (targetentityname)|target_destination|If specified, the explosion will only affect the matching entity.}}
{{KV|Limit to Entity|intn=targetentityname|target_destination|If specified, the explosion will only affect the matching entity.}}
{{KV|Inner radius (inner_radius)|float|If not zero, the [[LOS]] is calculated from a point intersecting this sphere.}}
{{KV|Inner radius|intn=inner_radius|float|If not zero, the [[LOS]] is calculated from a point intersecting this sphere.}}
{{KV BaseEntity|css=1}}
{{KV Targetname}}


==Inputs==
==Inputs==
{{IO|Explode|Trigger the explosion.}}
{{IO|Explode|Trigger the explosion.}}
{{IO|ExplodeAndRemove|since=p2|Trigger the explosion, then remove the entity.}}
{{IO|ExplodeAndRemove|since=p2|Trigger the explosion, then remove the entity.}}
{{I BaseEntity}}


==Outputs==
==Outputs==
{{IO|OnPushedPlayer|Fires when the player is pushed by the explosion.}}
{{IO|OnPushedPlayer|Fires when the player is pushed by the explosion.}}
{{O BaseEntity|l4d=1}}


[[Category:Physics]]
[[Category:Physics]]

Revision as of 02:12, 31 October 2022

English (en)中文 (zh)Translate (Translate)

Template:Base point It applies a physical force to physics objects within its radius, anything from a gentle nudge to a big explosion, depending on its magnitude. The explosion itself is not visible; for visible explosions, use env_explosion.

Tip.pngTip:Use this at a low force on hanging objects like lights or bodies to make them sway.
C++ In code, it is represented by theCPhysExplosionclass, defined in thephysobj.cppfile.

Flags

No Damage : [1]
Only Force (Players are not ever damaged by the explosion (regardless of this flag), only objects.)
Push players : [2]
Push radially : [4]
not as a sphere (Radially meaning as a circle/cylinder. No upward or downward force will be generated.)
Test LOS before pushing : [8]
Disorient player if pushed : [16]

Keyvalues

Magnitude (magnitude) <string>
Amount of physics force applied by the explosion.
Note.pngNote:The magnitude value is clamped between 1 and 100. If you require a bigger explosion than this, create multiple instances of the entity.
Clamp Radius (0 = auto) (radius) <string>
If specified, the radius in which the explosion damages entities. If unspecified, the radius will be based on the magnitude.
Limit to Entity (targetentityname) <targetname>
If specified, the explosion will only affect the matching entity.
Inner radius (inner_radius) <float>
If not zero, the LOS is calculated from a point intersecting this sphere.
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

Inputs

Explode
Trigger the explosion.
ExplodeAndRemove  (in all games since Portal 2)
Trigger the explosion, then remove the entity.

Outputs

OnPushedPlayer
Fires when the player is pushed by the explosion.