logic_playerproxy
![]() |
---|
CLogicPlayerProxy |
![]() hl2_player.cpp
|
![Playerproxy this icon from black mesa game.png](/w/images/a/a6/Playerproxy_this_icon_from_black_mesa_game.png)
logic_playerproxy
is a point entity available in Half-Life 2,
Portal,
Alien Swarm,
Portal 2,
Counter-Strike: Global Offensive, and
Black Mesa.
It is used to relay inputs/outputs to the player and back to the world.
![Note.png](/w/images/thumb/c/cc/Note.png/10px-Note.png)
![Note.png](/w/images/thumb/c/cc/Note.png/10px-Note.png)
- 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 do nothing and produce the console message
Can't use logic player proxy in multiplayer!
(which is slightly erroneous, as outputs still work as mentioned previously). - In Alien Swarm and CS:GO (which are multiplayer only), the entity does not function at all.
Contents
Keyvalues
CBaseEntity:
- Name
(targetname)
<string> - The name that other entities use to refer to this entity.
- Parent
(parentname)
<targetname> - Maintain the same initial offset to this entity. An attachment point can also be used if separated by a comma at the end. (
parentname [targetname],[attachment]
)Tip:Entities transition to the next map with their parents
Tip:
phys_constraint
can be used as a workaround if parenting fails. - Origin (X Y Z)
(origin)
<coordinates> - The position of this entity's center in the world. Rotating entities typically rotate around their origin.
Bug:Hammer does not move the entities accordingly in the editor. [todo tested in?]
- Pitch Yaw Roll (Y Z X)
(angles)
<angle> - This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
Note:This works on brush entities, although Hammer doesn't show the new angles.
- Classname
(classname)
<string> !FGD - Determines the characteristics of the entity before it spawns.
Tip:Changing this on runtime still has use, like making matching an entry in S_PreserveEnts will persist the entity on new rounds!
- Spawnflags
(spawnflags)
<flags> !FGD - Toggles exclusive features of an entity, its specific number is determined by the combination of flags added.
- Effects
(effects)
<flags> !FGD - Combination of effect flags to use.
- Entity Scripts
(vscripts)
<scriptlist> (in all games since) (also in
)
- Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions. Scripts executed on the worldspawn entity will be placed in root scope.
- Think function
(thinkfunction)
<string> (in all games since) (also in
)
- Name of the function within this entity's script that'll be called automatically every 100 milliseconds, or a user-defined interval if the function returns a number. Avoid expensive operations in this function, as it may cause performance problems.
- Lag Compensation
(LagCompensate)
<boolean> (in all games since) !FGD
- Set to Yes to lag compensate this entity. Should be used very sparingly!
- Is Automatic-Aim Target
(is_autoaim_target)
<boolean> (in all games since) !FGD
- If set to 1, this entity will slow down aiming movement for consoles and joystick controllers when the entity is under the crosshairs.
DamageFilter:
- Damage Filter
(damagefilter)
<targetname> - Name of the
filter_damage_type
entity that controls which entities can damage us.
Inputs
![Half-Life 2](/w/images/thumb/6/60/Hl2_icon.png/18px-Hl2_icon.png)
![Portal](/w/images/thumb/6/6d/Portal_icon.png/16px-Portal_icon.png)
Half-Life 2, HL2 Episodes, Portal and Black Mesa
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.
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
![Half-Life 2](/w/images/thumb/6/60/Hl2_icon.png/18px-Hl2_icon.png)
Half-Life 2, HL2 Episodes and Portal
LowerWeapon
- Lowers the players weapon.
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
CBaseEntity:
AddContext
<string>- Adds to the entity's list of response contexts. See Context.
AddOutput
<string>- Assigns a new keyvalue/output on this entity. For keyvalues, some rely on extra necessary code to be ran and won't work if its simply just changed through this input. There is a strict format that must be followed:
// Format of changing KeyValues: "AddOutput [key] [value]"
//// Raw text:
"OnUser1" "!self,AddOutput,targetname new_name"
// Format of adding an Output: "AddOutput {targetname}:{inputname}:{parameter}:{delay}:{max times to fire, -1 means infinite}"
//// Raw text:
"OnUser1" "!self,AddOutput,OnUser1:SetParent:!activator:0.0:-1"
// Arguments can be left blank, but the empty blank should still be contained.
//// Raw text:
"OnUser1" "!self,AddOutput,OnUser1:ClearParent::0.0:-1"
|
ClearContext
- Removes all contexts from this entity's list.
ClearParent
- Removes this entity from the movement hierarchy, leaving it free to move independently.
FireUser1
toFireUser4
- Fires the respective
OnUser
outputs; see User Inputs and Outputs.
Kill
- Removes this entity and any entities parented to it from the world.
KillHierarchy
- Functions the same as
Kill
, although this entity and any entities parented to it are killed on the same frame, being marginally faster thanKill
input.
RemoveContext
<string>- Remove a context from this entity's list. The name should match the key of an existing context.
SetParent
<string>- Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment
<string>- Change this entity to attach to a specific attachment point on its parent. The entity will teleport so that the position of its root bone matches that of the attachment. Entities must be parented before being sent this input.
SetParentAttachmentMaintainOffset
<string>- As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
DispatchEffect
<string> (removed since) !FGD
- Dispatches a special effect from the entity's origin; See also List of Client Effects. Replaced by the particle system since
.
RunScriptFile
<script> (in all games since) (also in
)
- Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode
<string> (in all games since) (also in
)
- Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console.
CallScriptFunction
<string> (in all games since) (also in
) !FGD
- Calls a VScript function defined in the scope of the receiving entity.
TerminateScriptScope
(only in) !FGD
- Destroys the script scope of the receiving entity.
SetLocalOrigin
<coordinates> (in all games since) !FGD
- Send this entity to a spot in the map. If the entity is parented to something, it will be offset from the parent by this amount.
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](/w/images/thumb/6/60/Hl2_icon.png/18px-Hl2_icon.png)
![Portal](/w/images/thumb/6/6d/Portal_icon.png/16px-Portal_icon.png)
Half-Life 2, HL2 Episodes, Portal and Black Mesa
PlayerDied
- Fires when the player dies.
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](/w/images/thumb/3/3c/Portal2_icon.png/16px-Portal2_icon.png)
![Black Mesa](/w/images/thumb/3/31/Bms_icon.png/16px-Bms_icon.png)
Portal 2, Counter-Strike Global Offensive and Black Mesa
OnDuck
- Fired when a player starts to duck.
OnUnDuck
- Fired when a player releases the duck button.
OnJump
- Fired when a player jumps.
Bug:These are technically in Counter-Strike: Global Offensive and Black Mesa, but don't work. [todo tested in?]
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; useinfo_player_ping_detector
instead.
Base
CBaseEntity:
OnUser1
toOnUser4
- These outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see User Inputs and Outputs.
Categories:
- Half-Life 2 entities
- Half-Life 2 point entities
- Portal entities
- Portal point entities
- Alien Swarm entities
- Alien Swarm point entities
- Portal 2 entities
- Portal 2 point entities
- Counter-Strike: Global Offensive entities
- Counter-Strike: Global Offensive point entities
- Black Mesa entities
- Black Mesa point entities
- IO System