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

Physics cannister: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Changed parameters of {{this is a}} to comply with the updated version. This action was performed by a bot.)
(-added class hierarchy, cleanup)
Line 1: Line 1:
{{CD|CPhysicsCannister|file1=physics_cannister.cpp}}
{{this is a|point entity|name=physics_cannister}} It is a physically simulated gas canister (with a misspelled entity name) that can have its cap shot off, at which point gas will start escaping, causing the canister to fly around. If it takes enough damage, it will explode.  
{{this is a|point entity|name=physics_cannister}} It is a physically simulated gas canister (with a misspelled entity name) that can have its cap shot off, at which point gas will start escaping, causing the canister to fly around. If it takes enough damage, it will explode.  
[[File:Physics cannister.png|thumb|200px|A fire extinguisher turned into a <code>physics_cannister</code> by adding a <code>nozzle</code> attachment to the top. Thrust will be applied along the blue line.]]
[[File:Physics cannister.png|thumb|200px|A fire extinguisher turned into a <code>physics_cannister</code> by adding a <code>nozzle</code> attachment to the top. Thrust will be applied along the blue line.]]
Line 6: Line 7:
{{Note|The model should have a <code>nozzle</code> attachment point, which is where gas will escape and thrust will be produced from.<br>
{{Note|The model should have a <code>nozzle</code> attachment point, which is where gas will escape and thrust will be produced from.<br>
The thrust will be simulated along the Z axis, visualized as the blue line of the attachment in HLMV.}}
The thrust will be simulated along the Z axis, visualized as the blue line of the attachment in HLMV.}}
{{code class|CPhysicsCannister|physics_cannister.cpp}}
 
== Keyvalues ==
== Keyvalues ==
{{KV|Explosion Damage|string|The amount of damage done by the explosion created when the canister blows up.}}
{{KV Targetname}}
{{KV|Explosion Radius|string|The radius of the explosion to create when the canister blows up.}}
{{KV|Explosion Damage|intn=expdamage|string|The amount of damage done by the explosion created when the canister blows up.}}
{{KV|Health|integer|The amount of damage the canister takes before exploding.}}
{{KV|Explosion Radius|intn=expradius|string|The radius of the explosion to create when the canister blows up.}}
{{KV|Thrust|string|When the cap has been blown off, and the escaping gas is thrusting the canister about, this is the amount of thrust generated.}}
{{KV|Health|intn=health|integer|The amount of damage the canister takes before exploding.}}
{{KV|Fuel Seconds|string|The amount of time that gas leaks from the canister before being considered empty.}}
{{KV|Thrust|intn=thrust|string|When the cap has been blown off, and the escaping gas is thrusting the canister about, this is the amount of thrust generated.}}
{{KV|Smoke Color (R G B)|color255|Color of the smoke.}}
{{KV|Fuel Seconds|intn=fuel|string|The amount of time that gas leaks from the canister before being considered empty.}}
{{KV|Smoke Alpha (0 - 255)|int 0-255|Transparency of the smoke.}}
{{KV|Smoke Color (R G B)|intn=rendercolor|color255|Color of the smoke.}}
{{KV|Thruster Sound|sound|The sound played when the gas is escaping from the canister.}}
{{KV|Smoke Alpha (0 - 255)|intn=renderamt|int 0-255|Transparency of the smoke.}}
{{KV BaseEntity}}
{{KV|Thruster Sound|intn=gassound|sound|The sound played when the gas is escaping from the canister.}}
{{KV BasePropPhysics|nofgd=1}}


== Flags ==
== Flags ==
{{fl|1|[[Physics optimization|Start Asleep]]}}
{{fl|1|[[Physics optimization|Start Asleep]]}}
{{fl|2|Explode}}
{{fl|2|Explode}}
{{fl|4|[[Physics optimization|Debris]]|Don't collide with the player or other debris.|nofgd=1}}
{{fl|8|[[Physics optimization|Motion Disabled]]|Starts with motion disabled until sent <code>EnableMotion</code>.|nofgd=1}}
{{fl|64|Enable motion when grabbed by gravity gun|nofgd=1}}
{{fl|128|Not affected by [[rotor wash]]|nofgd=1}}
{{fl|256|Generate output on {{ent|+use}}|nofgd=1}}
{{fl|512|Prevent pickup|nofgd=1}}
{{fl|1024|Prevent motion enable on player bump.|nofgd=1}}
{{fl|4096|Debris with [[trigger]] interaction.|nofgd=1}}
{{fl|8192|Force server-side|Multiplayer only; see {{ent|sv_pushaway_clientside_size}}.|nofgd=1}}
{{fl|1048576|Gravity gun can ALWAYS pick up. No matter what.|nofgd=1}}
{{Fl BreakableProp}}


== Inputs ==
== Inputs ==
Line 39: Line 28:
{{IO|Explode|Force the canister to explode.|param=string}}
{{IO|Explode|Force the canister to explode.|param=string}}
{{IO|Wake|Wakes up the canister, if it is sleeping.}}
{{IO|Wake|Wakes up the canister, if it is sleeping.}}
{{I BaseEntity}}
{{I BaseAnimating|nofgd=1|portal2=1}}
{{I BasePropPhysics|nofgd=1}}


== Outputs ==
== Outputs ==
{{IO|OnActivate|Fired when gas starts to escape from the canister.}}
{{IO|OnActivate|Fired when gas starts to escape from the canister.}}
{{O BaseEntity|l4d=1}}
{{IO|OnAwakened|Fired when this entity becomes awake (collision/force is applied).}}
{{O BasePropPhysics|portal2=1|l4d2=1}}

Revision as of 06:13, 2 July 2024

C++ Class hierarchy
CPhysicsCannister
CBaseCombatCharacter
CBaseFlex
CBaseAnimatingOverlay
CBaseAnimating
CBaseEntity
C++ physics_cannister.cpp

physics_cannister is a point entity available in all Source Source games. It is a physically simulated gas canister (with a misspelled entity name) that can have its cap shot off, at which point gas will start escaping, causing the canister to fly around. If it takes enough damage, it will explode.

A fire extinguisher turned into a physics_cannister by adding a nozzle attachment to the top. Thrust will be applied along the blue line.
A gif of a physics cannister (in an official Half-Life 2 map) having its cap shot off and flying into a wall, then it being shot again causing it to explode.
Icon-Bug.pngBug:This entity exists in Left 4 Dead 2, but it remains unused and no fitting prop for it exists. It works if a model is added; however, once the thrusting is finished, it interacts glitchily when stood on. It pushes you off the canister prop in unpredictable ways, and the survivor bots keep melee bashing into it when standing nearby.  [todo tested in ?]
Icon-Bug.pngBug:This entity also exists in Portal seriesTeam Fortress 2Counter-Strike: Global Offensive, also unused and with the default prop missing.
Confirm:is it just as glitchy there as in L4D2?
  [todo tested in ?]
Note.pngNote:The model should have a nozzle attachment point, which is where gas will escape and thrust will be produced from.
The thrust will be simulated along the Z axis, visualized as the blue line of the attachment in HLMV.

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

Explosion Damage (expdamage) <string>
The amount of damage done by the explosion created when the canister blows up.
Explosion Radius (expradius) <string>
The radius of the explosion to create when the canister blows up.
Health (health) <integer>
The amount of damage the canister takes before exploding.
Thrust (thrust) <string>
When the cap has been blown off, and the escaping gas is thrusting the canister about, this is the amount of thrust generated.
Fuel Seconds (fuel) <string>
The amount of time that gas leaks from the canister before being considered empty.
Smoke Color (R G B) (rendercolor) <color255>
Color of the smoke.
Smoke Alpha (0 - 255) (renderamt) <integer 0–255>
Transparency of the smoke.
Thruster Sound (gassound) <sound>
The sound played when the gas is escaping from the canister.

Flags

Start Asleep : [1]
Explode : [2]

Inputs

Activate <stringRedirectInput/string>
Start gas escaping from the canister.
Deactivate <stringRedirectInput/string>
Stop gas escaping from the canister.
Explode <stringRedirectInput/string>
Force the canister to explode.
Wake
Wakes up the canister, if it is sleeping.

Outputs

OnActivate
Fired when gas starts to escape from the canister.
OnAwakened
Fired when this entity becomes awake (collision/force is applied).