Env physexplosion: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(updates)
m (Revised hanging sway trick)
Line 2: Line 2:
{{base point|env_physexplosion|sprite=1}} 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 {{ent|env_explosion}}.
{{base point|env_physexplosion|sprite=1}} 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 {{ent|env_explosion}}.


{{idea|Set to emit a fairly low force to get lights swinging or floating debris moving.}}
{{tip|Use this at a low force on hanging objects like lights or bodies to make them sway.}}


{{code class|CPhysExplosion|physobj.cpp}}
{{code class|CPhysExplosion|physobj.cpp}}

Revision as of 09:51, 29 September 2018

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

  • 1: No Damage - Only Force (Players are not ever damaged by the explosion (regardless of this flag), only objects.)
  • 2: Push players
  • 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
  • 16: Disorient player if pushed

Keyvalues

Magnitude (magnitude) ([todo internal name (i)]) <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) ([todo internal name (i)]) <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) ([todo internal name (i)]) <targetname>
If specified, the explosion will only affect the matching entity.
Inner radius (inner_radius) ([todo internal name (i)]) <float>
If not zero, the LOS is calculated from a point intersecting this sphere.


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.