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

Env physexplosion: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Substituted IO templates)
 
(29 intermediate revisions by 17 users not shown)
Line 1: Line 1:
{{wrongtitle|title=env_physexplosion}}
{{LanguageBar}}
{{CD|CPhysExplosion|file1=physobj.cpp}}
{{this is a|point entity|name=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}}.
{{toc-right}}
{{tip|Use this at a low force on hanging objects like lights or bodies to make them sway.}}


==Entity Description==
==Flags==
[[Image:{{PAGENAME}}.png|left]]
{{fl|1|No Damage|Only Force (Players are not ever damaged by the explosion (regardless of this flag), only objects.)}}
'''Env_physexplosion''' 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]].
{{fl|2|Push players|}}
 
{{fl|4|Push radially|not as a sphere (Radially meaning as a circle/cylinder. No upward or downward force will be generated.)}}
If the ''No Damage - Only Force'' flag isn't set, the object will also take damage from the explosion. (Damage is applied to the object only - the explosion will never directly damage the player.)
{{fl|8|Test [[LOS]] before pushing|}}
 
{{fl|16|Disorient player if pushed|}}
Env_physexplosions set to emit a fairly low force can be useful to get lights swinging or floating debris moving.
 
{{note|Beyond a certain point, increasing the magnitude will not increase the force of the explosion. If you require a bigger explosion than this, create multiple identical copies of the entity.}}
 
==Availability==
{{in game|point}} {{game-base}}
{{in code|class=class_c_phys_explosion.html CPhysExplosion|file=physobj_8cpp-source.html physobj.cpp}}


==Keyvalues==
==Keyvalues==
* {{kv targetname}}
{{KV Targetname}}
* {{kv parentname}}
{{KV|Magnitude|intn=magnitude|string|Amount of physics force applied by the explosion.
* '''magnitude'''
:{{note|The magnitude value is clamped between 1 and 100. If you require a bigger explosion than this, create multiple instances of the entity.}}}}
: <float> Amount of physics force applied by the explosion.  
{{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.}}
* '''radius'''
{{KV|Limit to Entity|intn=targetentityname|target_destination|If specified, the explosion will only affect the matching entity.}}
: <float> Clamp radius (0 = auto) If specified, the radius in which the explosion damages entities. If unspecified, the radius will be based on the magnitude.
{{KV|Inner radius|intn=inner_radius|float|If not zero, the [[LOS]] is calculated from a point intersecting this sphere.}}
* '''targetentityname'''
: <target_destination> If specified, the explosion will only affect the matching entity.
* '''{{ep1 add|inner_radius}}
: <float> If not zero, the LOS is calculated from a point intersecting this sphere.
==Flags==
* 1 : No Damage - Only Force
: Don't make the object take damage from the explosion.
* {{ep1 add|2 : Push players}}
* {{ep1 add|4 : Push radially - not as a sphere}}
* {{ep1 add|8 : Test LOS before pushing}}
* {{ep1 add|16 : Disorient player if pushed}}


==Inputs==
==Inputs==
* {{i targetname}}
{{I|Explode|Trigger the explosion.}}
* {{i parentname}}
{{I|ExplodeAndRemove|since=p2|Trigger the explosion, then remove the entity.}}
* '''Explode'''
: Trigger the explosion.


==Outputs==
==Outputs==
* {{o targetname}}
{{O|OnPushedPlayer|Fires when the player is pushed by the explosion.}}
* '''{{ep1 add|OnPushedPlayer}}
 
: Fires when the player is pushed by the explosion.
[[Category:Physics]]

Latest revision as of 21:43, 19 April 2025

English (en)中文 (zh)Translate (Translate)
C++ Class hierarchy
CPhysExplosion
CPointEntity
CBaseEntity
C++ physobj.cpp
Env physexplosion.png

env_physexplosion is a point entity available in all Source Source games.

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.

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

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

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.

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.