Weapon physcannon: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(just saw this bug firsthand)
(Cleanup.)
Line 1: Line 1:
[[Image:weapon_physcannon.png|thumb|right|250px]]
[[Image:weapon_physcannon.png|thumb|right|250px]]
{{hl2 point|weapon_physcannon}} It's the '''Zero-Point Energy Field Manipulator''' (AKA Gravity Gun), used to manipulate physics objects in the game world. In [[Half-Life 2: Deathmatch]], players spawn with a gravity gun by default. Before it is picked up, the gravity gun also follows all physics rules as if it were a {{ent|prop_physics}}.
{{hl2 point|weapon_physcannon}} It's the '''Zero-Point Energy Field Manipulator''' (AKA Gravity Gun), used to manipulate physics objects in the game world. In {{hl2dm|4}}, [[player]]s spawn with a gravity gun by default. Before it is picked up, the gravity gun also follows all physics rules as if it were a {{ent|prop_physics}}.


{{tip|To supercharge the Gravity Gun, you will have to set up an {{ent|env_global}} entity to enable it.}}
{{tip|To supercharge the Gravity Gun, you will have to set up an {{ent|env_global}} entity to enable it.}}
Line 6: Line 6:


==Dedicated ConVars==
==Dedicated ConVars==
{{ScrollBox|title=Dedicated Console Variables|
<!--{{ScrollBox|title=Dedicated Console Variables|-->
;g_debug_physcannon <[[bool]]>
;g_debug_physcannon <[[bool]]>
: Enables Gravity Gun debugging, which shows a wire frame outline around objects when picked up(Default: 0)
: Enables Gravity Gun debugging, which shows a wire frame outline around objects when picked up(Default: 0)
Line 46: Line 46:
: {{Todo|Add a description for this variable.}}(Default: 1000.0)
: {{Todo|Add a description for this variable.}}(Default: 1000.0)


}}
==KeyValues==
 
{{KV BaseEntity|noscroll=1}}
==Keyvalues==
{{KV Targetname}}
{{KV Angles}}
{{KV NewFade}}
{{KV NewFade}}


==Flags==
==Flags==
* 1 : Start Constrained
{{fl|1|Start Constrained|Prevents the model from moving. Off by default.}}
:Prevents the model from moving. Off by default.
{{fl|2|Start without grab functionality.|Obsolete {{ep1|since}}}}
 
{{fl|2|Deny player pickup (reserve for NPC)|since=EP1}}
* 2 : Start without grab functionality. {{EP1 add|Obsolete}}
{{fl|4|Not puntable by Gravity Gun|since=EP1}}
 
* {{EP1 add|2 : Deny player pickup (reserve for NPC)}}
* {{EP1 add|4 : Not puntable by Gravity Gun}}


==Inputs==
==Inputs==
{{IO|EnableGrab|Enable the grab functionality. {{EP1 add|Obsolete}}}}
{{I Targetname}}
{{I Targetname}}
'''EnableGrab'''
: Enable the grab functionality. {{EP1 add|Obsolete}}


==Outputs==
==Outputs==
{{O Targetname}}
{{O Weapon}}
{{O Weapon}}
'''OnNPCPickup'''
: Fires when an NPC picks up this weapon.


[[Category:Half-Life 2 Entities]]
[[Category:Half-Life 2 Entities]]
[[Category:Half-Life 2 Weapons|P]]
[[Category:Half-Life 2 Weapons|P]]

Revision as of 20:04, 25 April 2022

Weapon physcannon.png

Template:Hl2 point It's the Zero-Point Energy Field Manipulator (AKA Gravity Gun), used to manipulate physics objects in the game world. In Half-Life 2: Deathmatch Half-Life 2: Deathmatch, players spawn with a gravity gun by default. Before it is picked up, the gravity gun also follows all physics rules as if it were a prop_physics.

Tip.pngTip:To supercharge the Gravity Gun, you will have to set up an env_global entity to enable it.
Icon-Bug.pngBug:Sometimes the game may crash when the player is holding something at the moment they pick up the gravity gun.  [todo tested in ?]

Dedicated ConVars

g_debug_physcannon <bool>
Enables Gravity Gun debugging, which shows a wire frame outline around objects when picked up(Default: 0)
physcannon_cone <float>
Changes how wide the pickup range is, lower numbers are wider (Default: 0.97)
physcannon_ball_cone <float>
Todo: Add a description for this variable.
(Default: 0.997)
physcannon_punt_cone <float>
Todo: Add a description for this variable.
(Default: 0.997)
physcannon_minforce <float>
Todo: Add a description for this variable.
(Default: 700.0)
physcannon_maxforce <float>
Todo: Add a description for this variable.
(Default: 1500.0)
physcannon_maxmass <float>
Sets the maximum mass at which an object can be picked up by the gravity gun(Default: 250.0)
physcannon_pullforce <float>
How much force to be used when pulling objects to the player(Default: 4000.0)
physcannon_tracelength <float>
How far an object can be pulled from(Default: 250.0)
physcannon_mega_enabled <bool>
Enables Dark Energy Field Manipulator(Default: 0)
physcannon_mega_pullforce <float>
How much force the Dark Energy Field Manipulator (Default: 8000.0)
physcannon_mega_tracelength <float>
The distance at which the Dark Energy Field Manipulator will be able to pull an object(Default: 850.0)
player_throwforce <float>
Todo: Add a description for this variable.
(Default: 1000.0)

KeyValues

BaseFadeProp:

Start Fade Dist (fademindist) <float>
Distance at which the entity starts to fade.
End Fade Dist (fademaxdist) <float>
Max fade distance at which the entity is visible.
  • If start fade is <0, the entity will disappear instantly when end fade is hit.
  • If end fade is <0, the entity won't disappear at all. (This is the default behavior.)
The values will scale appropriately if the entity is in a 3D Skybox.
Fade Scale (fadescale) <float>
If you specify so in worldspawn, or if the engine is running below DirectX 8 (DX7 in Source 2006), props will fade out even if the fade distances above aren't specified. This value gives you some control over when this happens: numbers smaller than 1 cause the prop to fade out at further distances, while those greater than 1 cause it to fade out at closer distances. Using 0 turns off the forced fade altogether. See also the QC command $noforcedfade.

Flags

Start Constrained : [1]
Prevents the model from moving. Off by default.
Start without grab functionality. : [2]
Obsolete (in all games since Half-Life 2: Episode One)
Deny player pickup (reserve for NPC) : [2] (in all games since Half-Life 2: Episode One)
Not puntable by Gravity Gun : [4] (in all games since Half-Life 2: Episode One)

Inputs

EnableGrab
Enable the grab functionality. Obsolete (in all games since Half-Life 2: Episode One)


Outputs

Weapon:

OnNPCPickup
!activator = NPC
!caller = this entity
Fires when an NPC picks up this weapon.
OnPlayerUse
!activator = player
!caller = this entity
Fires when the player +uses this weapon.
OnPlayerPickup
!activator = player
!caller = this entity
Fires when a player picks up this weapon.
OnCacheInteraction
Fires when the player 'proves' they've found this weapon. Fires on: Player Touch, +USE pickup, Physcannon pickup, Physcannon punt.