Prop interactions: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Clarification + formatting for previous edit)
(Accounted for ragdolls, added lose_energy, made other minor edits)
Line 1: Line 1:
The '''physgun_interactions''' [[KeyValues]] block affects how a prop is handled by and responds to the [[weapon_physcannon|Gravity Gun]].  It is embedded in a model with the [[$keyvalues]] QC command.
The '''physgun_interactions''' [[KeyValues]] block affects how a prop or ragdoll is handled by and responds to the [[weapon_physcannon|Gravity Gun]].  It is embedded in a model with the [[$keyvalues]] QC command.


== Example ==
== Example ==
Line 27: Line 27:
:: Cling to / embed in the surface.
:: Cling to / embed in the surface.
:; <code>bloodsplat</code>
:; <code>bloodsplat</code>
:: Create a blood [[decal]]
:: Create a blood [[decal]] {{todo|Is this onfirstimpact and/or exclusive to ragdolls?}}
;<code>onfirstimpact <choices></code>
;<code>onfirstimpact <choices></code>
: ''When you first hit something after being thrown...''
: ''When we first hit something after being thrown...''
:; <code>break</code>
:; <code>break</code>
:: Break on colliding with anything after being launched.
:: Break on colliding with anything after being launched.
Line 36: Line 36:
:; <code>impale</code>
:; <code>impale</code>
:: Impales whatever it first collides with after being launched.
:: Impales whatever it first collides with after being launched.
:; <code>lose_energy</code>
:: Apparently non-functional. {{todo|Verify}}
;<code>onlaunch <choices></code>
;<code>onlaunch <choices></code>
: ''When flung by the gravity gun...''
: ''When flung by the gravity gun...''
Line 52: Line 54:
; <code>allow_overhead yes</code>
; <code>allow_overhead yes</code>
: Physgun can carry prop directly above wielder. {{note|Some entities don't need this to allow the prop to be carried overhead. See <code>CGrabController::IsObjectAllowedOverhead()</code>.}}
: Physgun can carry prop directly above wielder. {{note|Some entities don't need this to allow the prop to be carried overhead. See <code>CGrabController::IsObjectAllowedOverhead()</code>.}}
; <code>onpickup create_flare</code>
; <code>onpickup <choices></code>
: Emit a flare from the "fuse" attachment when picked up by the gravity gun. {{note|<code>HL2_EPISODIC</code> DLLs only; see <code>CBreakableProp::OnPhysGunPickup()</code>.}}
: ''When picked up by the gravity gun...''
:; onpickup create_flare
:: Emit a flare from the "fuse" attachment when picked up by the gravity gun. {{note|<code>HL2_EPISODIC</code> DLLs only; see <code>CBreakableProp::OnPhysGunPickup()</code>.}}
:; onpickup boogie
:: ''Ragdolls only.'' Begins ragdoll boogie, providing random  electrical effects to the ragdoll.


== See Also ==
== See Also ==

Revision as of 21:24, 10 May 2017

The physgun_interactions KeyValues block affects how a prop or ragdoll is handled by and responds to the Gravity Gun. It is embedded in a model with the $keyvalues QC command.

Example

$keyvalues
{
	physgun_interactions
	{
	 	preferred_carryangles 	"0 0 0"
	 	onworldimpact 		stick
	 	onfirstimpact 		break
	 	onfirstimpact 		paintsplat
	 	onlaunch 		spin_zaxis
	 	onbreak 		explode_fire
	 	damage 			none
	}
}

Options

preferred_carryangles <angles>
Sets the angles, relative to the player's orientation, at which the prop will be held when carried.
This is used with the sawblades and propellers in Ravenholm, as well as the turret NPCs in Nova Prospekt.
onworldimpact <choices>
When hitting something after being thrown by the gravity gun... (entities too, not just the world)
stick
Cling to / embed in the surface.
bloodsplat
Create a blood decal
Todo: Is this onfirstimpact and/or exclusive to ragdolls?
onfirstimpact <choices>
When we first hit something after being thrown...
break
Break on colliding with anything after being launched.
paintsplat
Applies paint decals to the first thing it hits after being launched.
impale
Impales whatever it first collides with after being launched.
lose_energy
Apparently non-functional.
Todo: Verify
onlaunch <choices>
When flung by the gravity gun...
Default
Physgun applies random angular velocity to the prop as it launches.
spin_none
Prop does not spin when launched.
spin_zaxis
Prop should spin around the Z axis when launched by the physcannon. (e.g. Ravenholm propellers.)
onbreak <choices>
When breaking because of being flung...
explode_fire
Ignite nearby enemies (that are flammable)
damage none
Prop does not move when 'attacked' with the physgun. It may still take damage, but it won't move due to the impact.
allow_overhead yes
Physgun can carry prop directly above wielder.
Note.pngNote:Some entities don't need this to allow the prop to be carried overhead. See CGrabController::IsObjectAllowedOverhead().
onpickup <choices>
When picked up by the gravity gun...
onpickup create_flare
Emit a flare from the "fuse" attachment when picked up by the gravity gun.
Note.pngNote:HL2_EPISODIC DLLs only; see CBreakableProp::OnPhysGunPickup().
onpickup boogie
Ragdolls only. Begins ragdoll boogie, providing random electrical effects to the ragdoll.

See Also