Player

From Valve Developer Community
Revision as of 12:09, 15 May 2013 by Powerlord (talk | contribs) (SetCustomModel notes)
Jump to navigation Jump to search
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 with hammer.
Note.pngNote:Key/values, inputs and outputs vary depending on game and engine version. (needs more research- this stuff is from EP2)

Keyvalues

health ([todo internal name (i)]) <integer>
The player's health.
max_health ([todo internal name (i)]) <integer>
The value of "health" cannot exceed this.
Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Parentname:
Parent (parentname) <targetname>
Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma.

CBaseAnimating:

World Model (model) <model path>
The model this entity should appear as. 128-character limit.
Skin (skin) <integer>
Some models have multiple skins. This value selects from the index, starting with 0. May be overridden by game code.
Tip.pngTip:Hammer's model browser automatically updates this value if you use it to view different skins.
Model Scale (modelscale) <float> (in all games since Alien Swarm) (also in Source 2013)
A multiplier for the size of the model.
Tip.pngTip:In Hammer++ Hammer++ with a prop selected in 3D view, hold Ctrl and scroll the mouse wheel to change the modelscale in increments of 0.5. Holding Shift will scale it in smaller increments of 0.05.
Bodygroup (body / SetBodyGroup) <integer>
Some models have multiple submodels. This value selects from the index, starting with 0. May be overridden by animations and/or game code.
Note.pngNote:If both body and SetBodyGroup are present (even if set to 0), body will be prioritized.
Sequence (sequence) <integer> !FGD
Default animation sequence for the model to be playing after spawning. May be overridden by game code.
Lighting Origin (lightingorigin) <targetname>
Select an entity (not info_lighting!) from which to sample lighting and cubemaps instead of the entity's $illumposition.

Shadow:

Disable Shadows (disableshadows) <boolean>
Prevents the entity from creating cheap render-to-texture shadows, or lightmap shadows if the entity is a prop_static. Does not affect shadow mapping.
Disable Receiving Shadows (disablereceiveshadows) <boolean>
Prevent the entity from receiving dynamic shadows on itself.
Shadow Cast Distance (shadowcastdist) <integer> !FGD
Sets how far the entity casts dynamic shadows. 0 means default distance from the shadow_control entity.
Disable Shadow Depth (disableshadowdepth) <boolean> (in all games since Portal 2)
Used to disable rendering into shadow depth (for projected textures) for this entity.
Disable flashlight (disableflashlight) <boolean> (in all games since Portal 2)
Used to disable projected texture lighting and shadows on this entity.
Projected Texture Cache (shadowdepthnocache) <integer choices> (in all games since Portal 2)
Used to hint projected texture system whether it is sufficient to cache shadow volume of this entity or to force render it every frame instead.
Choices
  • 0 : Default
  • 1 : No cache - render every frame
  • 2 : Cache it - render only once
Render in Fast Reflections (drawinfastreflection) <boolean> (in all games since Portal 2)
If enabled, this entity will render in fast water reflections (i.e. when a water material specifies $reflectonlymarkedentities) and in the world impostor pass.
Global:
Global Entity Name (globalname) <string>
Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state.

Inputs

SetHealth <integerRedirectInput/integer>
Sets the player's health. Values clamped between 0 and max_health.
SetHUDVisibility <booleanRedirectInput/boolean>
Hides or displays the HUD.
SetFogController <stringRedirectInput/string>
Set the fog controller data per player.
IgnoreFallDamage <floatRedirectInput/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).
IgnoreFallDamageWithoutReset <floatRedirectInput/float>
Absolutely prevent the player from taking fall damage for [n] seconds.
OnSquadMemberKilled
Notification of a player's npc ally in the players squad being killed.
DisableFlashlight
Disables the player's flashlight.
EnableFlashlight
Enables the player's flashlight.
ForceDropPhysObjects
Force the player to drop any physics objects he's carrying.
SpeakResponseConcept <stringRedirectInput/string>
Speak the specified response concept immediately.
DisableLedgeHang
Left 4 Dead 2 Disable ledge hanging by player.
EnableLedgeHang
Left 4 Dead 2 Enable ledge hanging by player.
SetCustomModel <stringRedirectInput/string>
Team Fortress 2 Set a custom player model
SetCustomModelOffset <vectorRedirectInput/Vector>
Team Fortress 2 Set a custom player model's position on the player
SetCustomModelRotation <vectorRedirectInput/Vector>
Team Fortress 2 Set a custom player model's rotation on the player


Parentname:
SetParent <stringRedirectInput/string>
Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment <stringRedirectInput/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 <stringRedirectInput/string>
As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
ClearParent
Removes this entity from the the movement hierarchy, leaving it free to move independently.
Studiomodel:
Skin <integerRedirectInput/integer>
Changes the model's skin to the specified number.
SetBodyGroup <integerRedirectInput/integer>
Set the model's body group.
AlternativeSorting <booleanRedirectInput/boolean>
Uses an alternative method for telling which objects are in front of others. Use if this object draws incorrectly when seen through transparent things.
SetModelScale <stringRedirectInput/string> (in all games since Alien Swarm) (also in Source 2013)
Sets the model scale. Takes two values separated by a space. The first is the target model scale. The second value is the number of seconds the change in scale will be spread over. If there is no second value, the model will scale instantly.
Warning.pngWarning:Negative or extremely high values can cause crashes!

Shadow:

DisableShadow
Turn dynamic shadows off for this entity. Identical to applying  EF_NOSHADOW.
EnableShadow
Turn dynamic shadows on for this entity.
DisableReceivingFlashlight  (in all games since Portal 2)
This object will not receive light or shadows from projected textures.
EnableReceivingFlashlight  (in all games since Portal 2)
This object may receive light or shadows from projected textures.

Reflection:

DisableDrawInFastReflection  (in all games since Portal 2)
Turns off rendering of this entity in reflections when using $reflectonlymarkedentities in water material.
EnableDrawInFastReflection  (in all games since Portal 2)
Turn on rendering of this entity in reflections when using $reflectonlymarkedentities in water material.
ToggleDraw:
DisableDraw  (in all games since Portal 2)
Add the EF_NODRAW flag to this entity. Some entities manage this on their own so be aware you can override that value.
EnableDraw  (in all games since Portal 2)
Remove the EF_NODRAW flag from this entity. Some entities manage this on their own so be aware you can override that value.

Outputs

Studiomodel:
OnIgnite
Fired when this object catches fire.