logic_playerproxy

From Source Entities
Jump to navigation Jump to search

Present in:
Hl2.pngHL2
Hl2-episodes.pngEp1&2
Hl2dm-custom.pngHL2:DM
P1.pngPortal
Asw.pngASW
P2.pngPortal 2
Csgo.pngCS:GO

Code classes:

logic_playerproxy is a point entity present in most Source games. It's used to relay I/O to and from the player. Most of the entity's functions are impossible to do in other ways.

Note: Entity assumes there's only one player and will likely break in multiplayer. Completely unusable in Asw.pngCsgo-small.png.

ConVars/Commands[edit | edit source]

ConVar/CommandParameters or default valueParameter TypeEffect
hl2_darkness_flashlight_factor1FloatAn alternative flashlight drain rate. See SetFlashlightSlowDrain.

Keyvalues[edit | edit source]

Damage Filter Name (damagefilter) <filterclass>
A damage filter to apply to the player.

Inputs[edit | edit source]

SetDamageFilter <target_destination>
Sets Damage Filter Name.

Hl2.pngHalf-Life 2 series[edit | edit source]

RequestPlayerHealth
Fires the PlayerHealth output.
SetPlayerHealth <integer>
Sets the player's health.
SetFlashlightSlowDrain
Divides the flashlight's power consumption rate by hl2_darkness_flashlight_factor.
SetFlashlightNormalDrain
Sets the flashlight back to its normal drain rate.
RequestAmmoState
Checks if the player has ammo or not. Fires either PlayerHasAmmo or PlayerHasNoAmmo.
LowerWeapon
Makes the weapon lowered. Weapon immediately raises back up unless it has some external reason to stay lowered, so it's pretty useless.
EnableCappedPhysicsDamage
Gives the player settings which give them a greater resistance to physics damage.
DisableCappedPhysicsDamage
Returns the player to their normal impact damage settings.
SetLocatorTargetEntity <target_destination> (only available in Hl2.pngEpisodic)
Shows the compass HUD element seen near the end of Episode 2, with the specified entity being shown by a vehicle icon. If the parameter is blank, hides the element.
SuppressCrosshair (Not in FGD)  (only available in P1.png)
Hides the crosshair. Not reversible.

P2.pngPortal 2[edit | edit source]

AddPotatosToPortalgun
Adds potato Glados to the portal gun. Note: The portal gun is temporarily hidden on the player model when sent.
RemovePotatosFromPortalgun
Removes potato Glados from the portal gun. Note: The portal gun is temporarily hidden on the player model when sent.
SetDropEnabled <boolean>
Sets if the player can drop an object they've picked up. Objects can still be pried off by an intervening physical force. To do: Not used for the part where Chell carries Wheatley. How did they do that?
SetMotionBlurAmount <float>
Puts a zoom blur on the player. Parameter is an arbitrary number.
ForceVMGrabController
No effect.
ForcePhysicsGrabController
No effect.
ResetGrabControllerBehavior
No effect.


Editors: 
The flashlight and playerdied outputs may look like they don't work, but that's because they use an unconventional method for firing which involves referencing the FGD name. No apparent reason.

Outputs[edit | edit source]

Hl2.pngHalf-Life 2 series[edit | edit source]

PlayerHealth <integer>
Fires when RequestPlayerHealth is sent. Automatically puts the player's health as the input parameter, unless overridden by the mapper.
OnFlashlightOn <float>
Fires when the player turns on the flashlight. Automatically puts the current power as a percent from 0.0 to 1.0 as the input parameter, unless overridden by the mapper.
OnFlashlightOff <float>
Fires when the player turns off the flashlight. Automatically puts the current power as a percent from 0.0 to 1.0 as the input parameter, unless overridden by the mapper.
PlayerHasAmmo
Fires when RequestAmmoState and the player has a weapon with ammo.
PlayerHasNoAmmo
Fires when RequestAmmoState and the player has no ammo in any weapon.
PlayerDied
Fires when the player dies.
PlayerMissedAR2AltFire  (only available in Hl2.pngEpisodic)
Fires when the player fires an AR2 energy ball that doesn't kill anything.

P2.pngPortal 2[edit | edit source]

OnJump
Fires when the player presses their jump button.
OnDuck
Fires when the player presses their duck button, unless they're currently airborne due to jumping.
OnUnDuck
Fires when the player finishes unducking. Bug: Inconsistently fires when traveling through portals when one or both are not placed on 90 degree walls.
OnPrimaryPortalPlaced
Fires when the primary portal (blue, light blue, yellow) is successfully placed/moved. See also: func_portal_detector.
OnSecondaryPortalPlaced
Fires when the secondary portal (orange, purple, red) is successfully placed/moved.
OnStartSlowingTime
Part of an unfinished concept.
OnStopSlowingTime
Part of an unfinished concept.
OnCoopPing (Not in FGD)
Never fires.

See Also[edit | edit source]