Player: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Technically the player pretty much /has/ to be in the map, so this is a better description)
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 at all.}}
{{Note|This entity is not listed in the FGD, and is not intended to be placed in a map manually.}}
{{Note|Keyvalues, inputs and outputs vary depending on game and engine version.}}
{{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!}}

Revision as of 04:07, 22 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 manually.
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.
Model Index (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.
SpeakResponseConcept <stringRedirectInput/string>
Speak the specified response concept immediately. 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.
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