Player (Half-Life 2 series): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "{{Ent not in fgd|nolink=1}} {{Tabs|player|source=1|main=source | custom1=player (Left 4 Dead series)|custom1alt=Left 4 Dead series | custom2=player (Half-Life series)|custom2a...")
 
No edit summary
 
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Ent not in fgd|nolink=1}}
{{LanguageBar}}
{{Tabs|player|source=1|main=source
{{TabsBar|main=Player}}
| custom1=player (Left 4 Dead series)|custom1alt=Left 4 Dead series
{{Ent not in fgd|codeonly=1}}
| custom2=player (Half-Life series)|custom2alt=Half-Life series
{{Preserved entity|.|in={{hl2dm}}}}
| custom3=player (Counter-Strike series)|custom3alt=Counter-Strike series
{{CD|CHL2_Player|file1=1}}
| portal=1
{{CD|CHL2MP_Player|file1=1|game={{hl2dm|4}}}}
| portal2=1
{{This is a|entity|name=player|game=Half-Life 2 series}} The player itself or a [[bot]]. [[NPC]]s are not players. This entity still exists even if the player is dead.
| tf2=1
}}
{{this is a|point entity|name=player}} The player itself or a [[bot]]. [[NPC]]s are not players. This entity still exists even if the player is dead.
 
{{PreservedEnt|player}}
 
== Limitations/Bugs ==
{{Important|This entity is not intended to be placed in a map manually. Doing so will result in an instant fatal error on map load!}}


== Inputs ==
== Inputs ==
{{IO|SetHealth|param=integer|Sets the player's health. Values clamped between 0 and <code>max_health</code>.}}
{{I|SetHealth|param=integer|Sets the player's health. Values clamped between 0 and <code>max_health</code>.}}
{{IO|HandleMapEvent|param=string|Tells the game to perform a function, such as unlock an achievement. Hardcoded for specific map names.}}
{{I|HandleMapEvent|param=string|Tells the game to perform a function, such as unlock an achievement. Hardcoded for specific map names.}}
{{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).}}
{{I|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).}}
{{IO|IgnoreFallDamageWithoutReset|param=float|Absolutely prevent the player from taking fall damage for [n] seconds.}}<br>
{{I|IgnoreFallDamageWithoutReset|param=float|Absolutely prevent the player from taking fall damage for [n] seconds.}}<br>
:{{note|Should use "OnStartTouch - !activator - IgnoreFallDamageWithoutReset - 5 - Delay of 0". To disable fall damage for five seconds. Don't give it too much time, else players can exploit it to continue falling nearby areas without taking any damage.}}  
:{{note|Should use "OnStartTouch - !activator - IgnoreFallDamageWithoutReset - 5 - Delay of 0". To disable fall damage for five seconds. Don't give it too much time, else players can exploit it to continue falling nearby areas without taking any damage.}}  
{{IO|OnSquadMemberKilled|Notification of a player's [[NPC]] ally in the players squad being killed.}}
{{I|OnSquadMemberKilled|Notification of a player's [[NPC]] ally in the players squad being killed.}}
{{IO|DisableFlashlight|Disables the player's flashlight.}}
{{I|DisableFlashlight|Disables the player's flashlight.}}
{{IO|EnableFlashlight|Enables the player's flashlight.}}
{{I|EnableFlashlight|Enables the player's flashlight.}}
{{IO|ForceDropPhysObjects|Force the player to drop any [[prop_physics|physics objects]] they are carrying.}}
{{I|ForceDropPhysObjects|Force the player to drop any [[prop_physics|physics objects]] they are carrying.}}

Latest revision as of 18:19, 10 May 2025

English (en)Translate (Translate)
edit
Icon-NotInFGD.png
This entity is not in the FGD by default.
It should not be put directly in a map because it can only be configured through code.
Recycle-warning.png
This is a preserved entity in Half-Life 2: Deathmatch
If the game has round restart mechanics this entity may not behave as expected.
C++ Class hierarchy
CHL2_Player
CBasePlayer
CBaseCombatCharacter
CBaseFlex
CBaseAnimatingOverlay
CBaseAnimating
CBaseEntity
C++ hl2_player.cpp
C++ Class hierarchy
Half-Life 2: Deathmatch Half-Life 2: Deathmatch
CHL2MP_Player
CHL2_Player
CBasePlayer
CBaseCombatCharacter
CBaseFlex
CBaseAnimatingOverlay
CBaseAnimating
CBaseEntity
C++ hl2mp_player.cpp

player is an entity available in Half-Life 2 series Half-Life 2 series. The player itself or a bot. NPCs are not players. This entity still exists even if the player is dead.

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.
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.
Note.pngNote:Should use "OnStartTouch - !activator - IgnoreFallDamageWithoutReset - 5 - Delay of 0". To disable fall damage for five seconds. Don't give it too much time, else players can exploit it to continue falling nearby areas without taking any damage.
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 they are carrying.