Player: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(Overhauled the page.)
Line 3: Line 3:
{{base point|player}} The player itself. This entity still exists even if the player is dead. A pointer to the player can be acquired by using <code>UTIL_GetLocalPlayer()</code>.
{{base point|player}} The player itself. This entity still exists even if the player is dead. A pointer to the player can be acquired by using <code>UTIL_GetLocalPlayer()</code>.


{{Note|This entity is not listed in the FGD, and is not intended to be placed in a map with hammer.}}
{{Note|This entity is not listed in the FGD, and is not intended to be placed in a map at all.}}
{{Note|Key/values, inputs and outputs vary depending on game and engine version. (needs more research- this stuff is from EP2)}}
{{Note|Keyvalues, inputs and outputs vary depending on game and engine version.}}
{{Warning|Placing a player entity in a map will result in an instant fatal error on map load!}}
{{Warning|Placing a player entity in a map will result in an instant fatal error on map load!}}


== Keyvalues ==
== Keyvalues ==
{{KV|health|integer|The player's health.}}
{{KV|Health (health)|integer|The player's health.}}
{{KV|max_health|integer|The value of "health" cannot exceed this.}}
{{KV|Maximum Health (max_health)|integer|The value of "health" cannot exceed this.}}
{{KV Targetname}}
{{KV|ModelIndex|integer|Changes the player's model to a precached model on the map. Not available in {{tf2}}.}}
{{KV Parentname}}
{{KV BaseEntity}}
{{KV Studiomodel}}
{{KV Global}}


== Inputs ==
== Inputs ==
{{IO|SetHealth|param=integer|Sets the player's health. Values clamped between 0 and max_health.}}
{{IO|SetHealth|param=integer|Sets the player's health. Values clamped between 0 and <code>max_health</code>.}}
{{IO|SetHUDVisibility|param=boolean|Hides or displays the HUD.}}
{{IO|HandleMapEvent|param=string|Tells the game to perform a function, such as unlock an achievement. Hardcoded for specific map names.}}
{{IO|SetFogController|param=string|Set the fog controller data per player.}}
{{IO|SetHUDVisibility|param=boolean|Hides or displays the HUD. Not available in {{hl2}} series.}}
{{IO|IgnoreFallDamage|param=float|Prevent the player from taking fall damage for [n] seconds, but reset back to taking fall damage after the first impact (so players will be hurt if they bounce off what they hit).}}
:{{note|The menu can still be accessed, and some HUD elements such as kill-icons may still be visible.}}
{{IO|IgnoreFallDamageWithoutReset|param=float|Absolutely prevent the player from taking fall damage for [n] seconds.}}
{{IO|SetFogController|param=string|Sets the [[env_fog_controller|fog controller]] to use for the [[!activator]]. Not available in {{hl2}} series.}}
{{IO|OnSquadMemberKilled|Notification of a player's npc ally in the players squad being killed.}}
{{IO|IgnoreFallDamage|param=float|{{hl2}} Prevent the player from taking fall damage for [n] seconds, but reset back to taking fall damage after the first impact (so players will be hurt if they bounce off what they hit).}}
{{IO|DisableFlashlight|Disables the player's flashlight.}}
{{IO|IgnoreFallDamageWithoutReset|param=float|{{hl2}} Absolutely prevent the player from taking fall damage for [n] seconds.}}
{{IO|EnableFlashlight|Enables the player's flashlight.}}
{{IO|OnSquadMemberKilled|{{hl2}} Notification of a player's [[NPC]] ally in the players squad being killed.}}
{{IO|ForceDropPhysObjects|Force the player to drop any physics objects he's carrying.}}
{{IO|DisableFlashlight|{{hl2}} Disables the player's flashlight.}}
{{IO|SpeakResponseConcept|param=string|Speak the specified [[Response System|response concept]] immediately.}}
{{IO|EnableFlashlight|{{hl2}} Enables the player's flashlight.}}
{{IO|ForceDropPhysObjects|{{hl2}} Force the player to drop any [[prop_physics|physics objects]] they are carrying.}}
{{IO|SpeakResponseConcept|param=string|Speak the specified [[Response System|response concept]] immediately. Not available in {{hl2}} series.}}
{{IO|OnRescueZoneTouch|{{css}}{{csgo}} Fired when a [[hostage_entity|hostage]] is rescued. This input is also available in the code for {{l4d}} and {{l4d2}}.}}
{{IO|SetCommentaryStatueMode|{{l4d}} {{todo}}.}}
{{IO|DisableLedgeHang|{{l4d2}} Disable ledge hanging by player.}}
{{IO|DisableLedgeHang|{{l4d2}} Disable ledge hanging by player.}}
{{IO|EnableLedgeHang|{{l4d2}} Enable ledge hanging by player.}}
{{IO|EnableLedgeHang|{{l4d2}} Enable ledge hanging by player.}}
{{IO|SetCustomModel|param=string|{{tf2}} Set a custom player model}}
{{IO|IgnitePlayer|param=integer|{{tf2}} Ignites the player with a specified lifetime and causes a reaction (sound and speech).}}
{{IO|SetCustomModelOffset|param=vector|{{tf2}} Set a custom player model's position on the player}}
:{{note|Does not fire the <code>OnIgnite</code> output.}}
{{IO|SetCustomModelRotation|param=vector|{{tf2}} Set a custom player model's rotation on the player}}
:{{bug|Broken since the [https://wiki.teamfortress.com/wiki/Jungle_Inferno_Update Jungle Inferno] update, only initiates sound and speech but no actual fire. Use [[trigger_ignite]] as a workaround.}}
{{IO|SetCustomModelRotates|param=boolean|{{tf2}} Set if a custom model rotates or not}}
{{IO|ExtinguishPlayer|{{tf2}} Extinguishes the player.}}
{{IO|SetCustomModelVisibleToSelf|param=boolean|{{tf2}} Set if a custom model is visible to the player}}
{{IO|BleedPlayer|param=integer|{{tf2}} Bleeds the player with a specified length.}}
{{IO|ModelIndex|param=integer|Changes the player's model to a precached model on the map.}}
{{IO|RollRareSpell|{{tf2}} Forces the player to roll a rare spell. Only available if spells are enabled on the map.}}
{{I Targetname}}
{{IO|SetCustomModel|param=string|{{tf2}} Set a custom player model ''without'' animations.}}
{{I Parentname}}
{{IO|SetCustomModelOffset|param=vector|{{tf2}} Set a custom player model position on the player.}}
{{I Studiomodel}}
{{IO|SetCustomModelRotation|param=vector|{{tf2}} Set a custom player model rotation on the player.}}
{{IO|ClearCustomModelRotation|{{tf2}} Clears the custom player model rotation.}}
{{IO|SetCustomModelRotates|param=boolean|{{tf2}} Set if the custom model rotates or not to the player's angles.}}
{{IO|SetCustomModelVisibleToSelf|param=boolean|{{tf2}} Set if the custom model is visible to the player, in thirdperson.}}
{{IO|SetForcedTauntCam|param=boolean|{{tf2}} Forces the player into thirdperson mode.}}
{{IO|SpeakResponseConcept|param=string|{{tf2}} Forces the player to speak the specified response concept, an example being <code>halloweenlongfall</code>.}}
{{IO|TriggerLootIslandAchievement|{{tf2}} {{todo}}.}}
{{IO|TriggerLootIslandAchievement2|{{tf2}} {{todo}}.}}
{{IO|RoundSpawn|{{tf2}} {{todo}}.}}
{{I BaseEntity}}
{{I BaseAnimating}}


== Outputs ==  
== Outputs ==  
{{O Targetname}}
{{O BaseEntity|l4d=1}}
{{O Studiomodel}}
{{O BaseAnimating}}

Revision as of 16:23, 20 October 2018

Icon-NotInFGD.png
This entity is not in the FGD by default.
See below for instructions on making it available.

Template:Base point The player itself. This entity still exists even if the player is dead. A pointer to the player can be acquired by using UTIL_GetLocalPlayer().

Note.pngNote:This entity is not listed in the FGD, and is not intended to be placed in a map at all.
Note.pngNote:Keyvalues, inputs and outputs vary depending on game and engine version.
Warning.pngWarning:Placing a player entity in a map will result in an instant fatal error on map load!

Keyvalues

Health (health) ([todo internal name (i)]) <integer>
The player's health.
Maximum Health (max_health) ([todo internal name (i)]) <integer>
The value of "health" cannot exceed this.
ModelIndex ([todo internal name (i)]) <integer>
Changes the player's model to a precached model on the map. Not available in Team Fortress 2.


Inputs

SetHealth <integerRedirectInput/integer>
Sets the player's health. Values clamped between 0 and max_health.
HandleMapEvent <stringRedirectInput/string>
Tells the game to perform a function, such as unlock an achievement. Hardcoded for specific map names.
SetHUDVisibility <booleanRedirectInput/boolean>
Hides or displays the HUD. Not available in Half-Life 2 series.
Note.pngNote:The menu can still be accessed, and some HUD elements such as kill-icons may still be visible.
SetFogController <stringRedirectInput/string>
Sets the fog controller to use for the !activator. Not available in Half-Life 2 series.
IgnoreFallDamage <floatRedirectInput/float>
Half-Life 2 Prevent the player from taking fall damage for [n] seconds, but reset back to taking fall damage after the first impact (so players will be hurt if they bounce off what they hit).
IgnoreFallDamageWithoutReset <floatRedirectInput/float>
Half-Life 2 Absolutely prevent the player from taking fall damage for [n] seconds.
OnSquadMemberKilled
Half-Life 2 Notification of a player's NPC ally in the players squad being killed.
DisableFlashlight
Half-Life 2 Disables the player's flashlight.
EnableFlashlight
Half-Life 2 Enables the player's flashlight.
ForceDropPhysObjects
Half-Life 2 Force the player to drop any physics objects they are carrying.
SpeakResponseConcept <stringRedirectInput/string>
Speak the specified response concept immediately. Not available in Half-Life 2 series.
OnRescueZoneTouch
Counter-Strike: SourceCounter-Strike: Global Offensive Fired when a hostage is rescued. This input is also available in the code for Left 4 Dead and Left 4 Dead 2.
SetCommentaryStatueMode
Left 4 Dead [Todo].
DisableLedgeHang
Left 4 Dead 2 Disable ledge hanging by player.
EnableLedgeHang
Left 4 Dead 2 Enable ledge hanging by player.
IgnitePlayer <integerRedirectInput/integer>
Team Fortress 2 Ignites the player with a specified lifetime and causes a reaction (sound and speech).
Note.pngNote:Does not fire the OnIgnite output.
Icon-Bug.pngBug:Broken since the Jungle Inferno update, only initiates sound and speech but no actual fire. Use trigger_ignite as a workaround.  [todo tested in ?]
ExtinguishPlayer
Team Fortress 2 Extinguishes the player.
BleedPlayer <integerRedirectInput/integer>
Team Fortress 2 Bleeds the player with a specified length.
RollRareSpell
Team Fortress 2 Forces the player to roll a rare spell. Only available if spells are enabled on the map.
SetCustomModel <stringRedirectInput/string>
Team Fortress 2 Set a custom player model without animations.
SetCustomModelOffset <vectorRedirectInput/Vector>
Team Fortress 2 Set a custom player model position on the player.
SetCustomModelRotation <vectorRedirectInput/Vector>
Team Fortress 2 Set a custom player model rotation on the player.
ClearCustomModelRotation
Team Fortress 2 Clears the custom player model rotation.
SetCustomModelRotates <booleanRedirectInput/boolean>
Team Fortress 2 Set if the custom model rotates or not to the player's angles.
SetCustomModelVisibleToSelf <booleanRedirectInput/boolean>
Team Fortress 2 Set if the custom model is visible to the player, in thirdperson.
SetForcedTauntCam <booleanRedirectInput/boolean>
Team Fortress 2 Forces the player into thirdperson mode.
SpeakResponseConcept <stringRedirectInput/string>
Team Fortress 2 Forces the player to speak the specified response concept, an example being halloweenlongfall.
TriggerLootIslandAchievement
Team Fortress 2 [Todo].
TriggerLootIslandAchievement2
Team Fortress 2 [Todo].
RoundSpawn
Team Fortress 2 [Todo].
Note.pngNote:Content moved to Rendering and studio model related KIO/Inputs for continuation of page history

Outputs

Note.pngNote:Content moved to Rendering and studio model related KIO/Outputs for continuation of page history