Logic playerproxy: Difference between revisions
Jump to navigation
Jump to search
Note:Outputs will only fire on the first instance of this entity in the map.
Note:This entity is primarily intended for use in singleplayer, but all of the games it is present in can be played in multiplayer as well, even if they were not designed with it in mind. Thus, the entity exhibits varying behavior in multiplayer depending on the game:
m (→Inputs) |
(changed a bunch of things, the I/O is now grouped by game as well) |
||
Line 1: | Line 1: | ||
{{CD|CLogicPlayerProxy|file1=logic_playerproxy.cpp}} | {{CD|CLogicPlayerProxy|file1=logic_playerproxy.cpp}} | ||
{{ | {{entity|type=e0|logic_playerproxy|game=Half-Life 2|game1=Portal|game2=Alien Swarm|game3=Portal 2|game4=Counter-Strike: Global Offensive}} | ||
It is used to relay inputs/outputs to the player and back to the world. | |||
{{note|Outputs will only fire on the first instance of this entity in the map.}} | |||
{{note|This entity is primarily intended for use in singleplayer, but all of the games it is present in can be played in multiplayer as well, even if they were not designed with it in mind. Thus, the entity exhibits varying behavior in multiplayer depending on the game: | |||
* In [[Orange Box]] games and Portal 2, outputs will fire correctly, with the player that triggered the output as the {{ent|!activator}}. | |||
* In Orange Box games, inputs will affect the most recently connected player. | |||
* In Portal 2, inputs will produce the console message <code>Can't use logic player proxy in multiplayer!</code> and do nothing. | |||
* In Alien Swarm and CS:GO (which are multiplayer only), the entity does not function at all. | |||
}} | |||
== Keyvalues == | == Keyvalues == | ||
{{KV | {{KV BaseEntity}} | ||
{{KV DamageFilter}} | {{KV DamageFilter}} | ||
== Inputs == | == Inputs == | ||
=== {{hl2}}{{portal}} Half-Life 2, HL2 Episodes, and Portal === | |||
{{IO|RequestPlayerHealth|Requests the current player's health from the proxy. This will fire the PlayerHealth output with the value.}} | {{IO|RequestPlayerHealth|Requests the current player's health from the proxy. This will fire the PlayerHealth output with the value.}} | ||
{{IO|SetFlashlightSlowDrain|Puts the player's flashlight in slow-power-drain mode (for Episodic darkness)}} | {{IO|SetFlashlightSlowDrain|Puts the player's flashlight in slow-power-drain mode (for Episodic darkness)}} | ||
Line 12: | Line 26: | ||
{{IO|SetPlayerHealth|Sets the player's health to this value.|param=integer}} | {{IO|SetPlayerHealth|Sets the player's health to this value.|param=integer}} | ||
{{IO|RequestAmmoState|Request the ammo state of the player. It will fire PlayerHasAmmo or PlayerHasNoAmmo outputs.}} | {{IO|RequestAmmoState|Request the ammo state of the player. It will fire PlayerHasAmmo or PlayerHasNoAmmo outputs.}} | ||
{{IO|LowerWeapon|Lowers the players weapon. | {{IO|LowerWeapon|Lowers the players weapon.}} | ||
{{IO|EnableCappedPhysicsDamage|Cause player to take less damage from physics objects, and never more than 30 points from any individual strike. | {{IO|EnableCappedPhysicsDamage|Cause player to take less damage from physics objects, and never more than 30 points from any individual strike.}} | ||
{{IO|DisableCappedPhysicsDamage|Undo effects of EnableCappedPhysicsDamage | {{IO|DisableCappedPhysicsDamage|Undo effects of EnableCappedPhysicsDamage}} | ||
{{IO|SetLocatorTargetEntity|Set the entity that the HUD locator should track. (Usually a vehicle)|param=string|only={{ep2}}}} | {{IO|SetLocatorTargetEntity|Set the entity that the HUD locator should track. (Usually a vehicle)|param=string|only={{ep2}}}} | ||
:{{note|Also works in [[Episode One]] since [[Source 2007]], if the resources are ported.}} | |||
{{IO|SuppressCrosshair|Hides the crosshair.|nofgd=1|only={{portal}}}} | {{IO|SuppressCrosshair|Hides the crosshair.|nofgd=1|only={{portal}}}} | ||
:{{note|Unlike the command <code>crosshair 0</code>, the crosshair is enabled again when a new game is started or a save made before firing the input is loaded.}} | :{{note|Unlike the command <code>crosshair 0</code>, the crosshair is enabled again when a new game is started or a save made before firing the input is loaded.}} | ||
:{{note|Added in the March 3rd, 2010 update. Seems to be a backported Portal 2 input that was removed from Portal 2 before release.}} | :{{note|Added in the March 3rd, 2010 update. Seems to be a backported Portal 2 input that was removed from Portal 2 before release.}} | ||
{{IO|AddPotatosToPortalgun|Change portalgun bodygroup to show PotatOS. | |||
{{IO|RemovePotatosFromPortalgun|Change portalgun bodygroup to not show PotatOS. | === {{portal2}} Portal 2 === | ||
{{IO|SetDropEnabled|Set | |||
{{IO|ForceVMGrabController|Force the player to use the view model grab controller for all objects that are picked up. | {{IO|AddPotatosToPortalgun|Change portalgun bodygroup to show PotatOS.}} | ||
{{IO|ForcePhysicsGrabController|Force the player to use the physics grab controller for all objects that are picked up. | {{IO|RemovePotatosFromPortalgun|Change portalgun bodygroup to not show PotatOS.}} | ||
{{IO|ResetGrabControllerBehavior|Resets the grab controller used by the player to its default behavior. | {{IO|SetDropEnabled|Set whether the player is allowed to drop a carried object.}} | ||
{{IO|SetMotionBlurAmount|Forces the motion blur effect on the player. Set to <<nowiki>=</nowiki> 0 to disable this override.|param=float| | {{IO|ForceVMGrabController|Force the player to use the view model grab controller for all objects that are picked up.}} | ||
{{IO|ForcePhysicsGrabController|Force the player to use the physics grab controller for all objects that are picked up.}} | |||
{{IO|ResetGrabControllerBehavior|Resets the grab controller used by the player to its default behavior.}} | |||
{{IO|SetMotionBlurAmount|Forces the motion blur effect on the player. Set to <<nowiki>=</nowiki> 0 to disable this override.|param=float}} | |||
{{IO|PaintPlayerWithPortalPaint|Displays a Conversion Gel splashing effect on the player's screen.|nofgd=1}} | |||
{{IO|SetFallDamageEnabled|Enables or disables fall damage on the player.|param=bool|only={{P2CE}}}} | {{IO|SetFallDamageEnabled|Enables or disables fall damage on the player.|param=bool|only={{P2CE}}}} | ||
{{IO|GiveBoots|Gives long fall boots to the player.|only={{P2CE}}}} | {{IO|GiveBoots|Gives long fall boots to the player.|only={{P2CE}}}} | ||
Line 33: | Line 52: | ||
{{IO|RemovePaintGun|Removes the player's paint gun.|only={{P2CE}}}} | {{IO|RemovePaintGun|Removes the player's paint gun.|only={{P2CE}}}} | ||
{{IO|RemovePortalGun|Removes the player's portal gun.|only={{P2CE}}}} | {{IO|RemovePortalGun|Removes the player's portal gun.|only={{P2CE}}}} | ||
{{I | |||
=== Base === | |||
{{I BaseEntity}} | |||
{{I DamageFilter}} | {{I DamageFilter}} | ||
== Outputs == | == Outputs == | ||
{{IO|OnFlashlightOn|Fired when the player turns on | |||
{{IO|OnFlashlightOff|Fired when the player turns off | === {{hl2}}{{portal}} Half-Life 2, HL2 Episodes, and Portal === | ||
{{IO|PlayerHealth|Outputs the player's current health value.|param=integer}} | |||
{{IO|OnFlashlightOn|Fired when the player turns on their flashlight. This output has the value of how much energy the player had when this happened [0..1].|param=float}} | |||
{{IO|OnFlashlightOff|Fired when the player turns off their flashlight. This output has the value of how much energy the player had when this happened [0..1].|param=float}} | |||
{{IO|PlayerHasAmmo|Fired by request if the player has any ammo.}} | {{IO|PlayerHasAmmo|Fired by request if the player has any ammo.}} | ||
{{IO|PlayerHasNoAmmo|Fired by request if the player doesn't have any ammo.}} | {{IO|PlayerHasNoAmmo|Fired by request if the player doesn't have any ammo.}} | ||
{{IO|PlayerMissedAR2AltFire|Player fired an AR2 combine ball that didn't kill any enemies.| | {{IO|PlayerMissedAR2AltFire|Player fired an AR2 combine ball that didn't kill any enemies.|not={{hl2}}}} | ||
{{IO| | |||
=== {{portal2}} Portal 2 === | |||
{{IO|OnPrimaryPortalPlaced|Fired when a Portal player successfully places the primary portal.}} | |||
{{IO|OnSecondaryPortalPlaced|Fired when a Portal player successfully places the secondary portal.}} | |||
{{IO|OnCoopPing|Fired in response to the unused <code>+coop_ping</code> command. Normal pings do not fire this output; use {{ent|info_player_ping_detector}} instead.|nofgd=1}} | |||
{{IO|OnStartSlowingTime|Fired when a Portal player initiates slow time.|only={{P2CE}}}} | {{IO|OnStartSlowingTime|Fired when a Portal player initiates slow time.|only={{P2CE}}}} | ||
{{IO|OnStopSlowingTime|Fired when a Portal player stops slowing time.|only={{P2CE}}}} | {{IO|OnStopSlowingTime|Fired when a Portal player stops slowing time.|only={{P2CE}}}} | ||
{{IO| | === Base === | ||
{{IO|PlayerDied|Fires when the player dies.}} | |||
{{IO|OnDuck|Fired when a player starts to duck.|since={{portal2}}}} | {{IO|OnDuck|Fired when a player starts to duck.|since={{portal2}}}} | ||
{{IO|OnUnDuck|Fired when a player releases the duck button.|since={{portal2}}}} | {{IO|OnUnDuck|Fired when a player releases the duck button.|since={{portal2}}}} | ||
{{IO|OnJump|Fired when a player jumps.|since={{portal2}}}} | {{IO|OnJump|Fired when a player jumps.|since={{portal2}}}} | ||
{{O | |||
{{O BaseEntity}} | |||
[[Category:IO System]] | [[Category:IO System]] |
Revision as of 20:24, 7 July 2023
![]() |
---|
CLogicPlayerProxy |
![]() |
It is used to relay inputs/outputs to the player and back to the world.


- In Orange Box games and Portal 2, outputs will fire correctly, with the player that triggered the output as the !activator.
- In Orange Box games, inputs will affect the most recently connected player.
- In Portal 2, inputs will produce the console message
Can't use logic player proxy in multiplayer!
and do nothing. - In Alien Swarm and CS:GO (which are multiplayer only), the entity does not function at all.
Keyvalues
DamageFilter:
- Damage Filter (damagefilter) <targetname>
- Name of the filter_damage_type entity that controls which entities can damage us.
Inputs

Half-Life 2, HL2 Episodes, and Portal
- RequestPlayerHealth
- Requests the current player's health from the proxy. This will fire the PlayerHealth output with the value.
- SetFlashlightSlowDrain
- Puts the player's flashlight in slow-power-drain mode (for Episodic darkness)
- SetFlashlightNormalDrain
- Puts the player's flashlight to default power drain
- SetPlayerHealth <integer >
- Sets the player's health to this value.
- RequestAmmoState
- Request the ammo state of the player. It will fire PlayerHasAmmo or PlayerHasNoAmmo outputs.
- LowerWeapon
- Lowers the players weapon.
- EnableCappedPhysicsDamage
- Cause player to take less damage from physics objects, and never more than 30 points from any individual strike.
- DisableCappedPhysicsDamage
- Undo effects of EnableCappedPhysicsDamage
- SetLocatorTargetEntity <string > (only in
)
- Set the entity that the HUD locator should track. (Usually a vehicle)
Note:Also works in Episode One since Source 2007, if the resources are ported.
- SuppressCrosshair (only in
) !FGD
- Hides the crosshair.
Note:Unlike the command
crosshair 0
, the crosshair is enabled again when a new game is started or a save made before firing the input is loaded.Note:Added in the March 3rd, 2010 update. Seems to be a backported Portal 2 input that was removed from Portal 2 before release.
Portal 2
- AddPotatosToPortalgun
- Change portalgun bodygroup to show PotatOS.
- RemovePotatosFromPortalgun
- Change portalgun bodygroup to not show PotatOS.
- SetDropEnabled
- Set whether the player is allowed to drop a carried object.
- ForceVMGrabController
- Force the player to use the view model grab controller for all objects that are picked up.
- ForcePhysicsGrabController
- Force the player to use the physics grab controller for all objects that are picked up.
- ResetGrabControllerBehavior
- Resets the grab controller used by the player to its default behavior.
- SetMotionBlurAmount <float >
- Forces the motion blur effect on the player. Set to <= 0 to disable this override.
- PaintPlayerWithPortalPaint !FGD
- Displays a Conversion Gel splashing effect on the player's screen.
- SetFallDamageEnabled <boolean > (only in
)
- Enables or disables fall damage on the player.
Base
DamageFilter:
- SetDamageFilter <string >
- Sets the entity to use as damage filter. Pass in an empty string (no parameter) to clear the damage filter.
Outputs

Half-Life 2, HL2 Episodes, and Portal
- PlayerHealth <integer >
- Outputs the player's current health value.
- OnFlashlightOn <float >
- Fired when the player turns on their flashlight. This output has the value of how much energy the player had when this happened [0..1].
- OnFlashlightOff <float >
- Fired when the player turns off their flashlight. This output has the value of how much energy the player had when this happened [0..1].
- PlayerHasAmmo
- Fired by request if the player has any ammo.
- PlayerHasNoAmmo
- Fired by request if the player doesn't have any ammo.
Portal 2
- OnPrimaryPortalPlaced
- Fired when a Portal player successfully places the primary portal.
- OnSecondaryPortalPlaced
- Fired when a Portal player successfully places the secondary portal.
- OnCoopPing !FGD
- Fired in response to the unused
+coop_ping
command. Normal pings do not fire this output; use info_player_ping_detector instead.
Base
- PlayerDied
- Fires when the player dies.
- OnDuck (in all games since
)
- Fired when a player starts to duck.
- OnUnDuck (in all games since
)
- Fired when a player releases the duck button.
- OnJump (in all games since
)
- Fired when a player jumps.