Prop interactions: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Robot: Automated text replacement (-\{\|\r +{| class=standard-table))
(more KVs gleaned from the source code)
Line 1: Line 1:
[[physgun_interactions]] affect how a physics prop model is handled by and responds to the [[weapon_physcannon]].  
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.
* These [[QC command]]s are compiled into the model via the (optional) [[physgun_interactions]] block within the [[$keyvalues]] section of the QC file. The method is very similar to encoding the model's [[Prop Data|prop_data]] $keyvalues.


==QC syntax example==
== Example ==


  [[$keyvalues]]
  [[$keyvalues]]
Line 20: Line 19:
==Options==
==Options==


;preferred_carryangles <[[angles]]>
;<code>preferred_carryangles <[[angles]]></code>
:Sets the angles, relative to the player's orientation, at which the prop will be held when carried.  
: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]].
:This is used with the sawblades and propellers in [[Ravenholm]], as well as the turret NPCs in [[Nova Prospekt]].
;onworldimpact <choices>
; <code>onworldimpact <choices></code>
:{| class=standard-table
: ''When hitting something after being thrown by the gravity gun...'' (entities too, not just the world)
! Literal Value || Description
:; <code>stick</code>
|-
:: Cling to / embed in the surface.
| stick || Prop will embed itself into the world if it hits it after being launched.
:; <code>bloodsplat</code>
|}
:: Create a blood [[decal]]
;onfirstimpact <choices>  
;<code>onfirstimpact <choices></code>
:{| class=standard-table
: ''When you first hit something after being thrown...''
! Literal Value || Description
:; <code>break</code>
|-
:: Break on colliding with anything after being launched.
| break || Prop should always break on colliding with anything after being launched.
:; <code>paintsplat</code>
|-
:: Applies paint decals to the first thing it hits after being launched.
| paintsplat || Prop applies paint decals to the first thing it hits after being launched.
:; <code>impale</code>
|-
:: Impales whatever it first collides with after being launched.
| impale || Prop impales whatever it first collides with after being launched. Not used in HL2, and hence unsupported at this time. <!-- It's used with harpoons/spears in Lost Coast/Sandtraps... -->
;<code>onlaunch <choices></code>
|}
: ''When flung by the gravity gun...''
;onlaunch <choices>  
:; Default
:{| class=standard-table
:: Physgun applies random angular velocity to the prop as it launches.
! Literal Value || Description
:; <code>spin_none</code>
|-
:: Prop does not spin when launched.
| <no value> || Physgun applies random angular velocity to the prop as it launches.
:; <code>spin_zaxis</code>
|-
:: Prop should spin around the Z axis when launched by the physcannon. (e.g. Ravenholm propellers.)
| spin_none || Prop does not spin when launched.
; <code>onbreak <choices></code>
|-
: ''When breaking because of being flung...''
| spin_zaxis || Prop should spin around the Z axis when launched by the physcannon. (e.g. Ravenholm propellers.)
:;explode_fire
|}
:: Ignite nearby enemies (that are flammable)
;onbreak <choices>
; <code>damage none</code>
:{| class=standard-table
: Prop does not move when 'attacked' with the physgun. It may still take damage, but it won't move due to the impact.
! Literal Value || Description
; <code>allow_overhead yes</code>
|-
: {{todo}}
| explode_fire || Prop ignites nearby enemies when it explodes on breaking.
; <code>onpickup create_flare</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>.}}
;damage <choices>
:{| class=standard-table
! Literal Value || Description
|-
| none || Prop does not move when 'attacked' with the physgun. It may still take damage, but it won't move due to the impact.
|}


== See Also ==
* [[prop_data]]
* [http://skew.telefragged.com/mods/hl2/ARGG/ Adnan's Rotational Grav Gun] - a 4MB demo mod that simply allows the player to control the "carryangles" of objects held by the Gravgun.


== See Also ==
[http://skew.telefragged.com/mods/hl2/ARGG/ Adnan's Rotational Grav Gun] - a 4MB demo mod that simply allows the player to control the "carryangles" of objects held by the Gravgun.
[[Category:QC Keyvalues]]
[[Category:QC Keyvalues]]

Revision as of 11:54, 17 September 2009

The physgun_interactions KeyValues block affects how a prop 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
onfirstimpact <choices>
When you 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.
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
[Todo]
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().

See Also