Player (Left 4 Dead series): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
Line 4: Line 4:
{{CD|CTerrorPlayer}}
{{CD|CTerrorPlayer}}


{{this is a|entity|name=player|series=Left 4 Dead}} Human players of any team are this entity.
{{This is a|entity|name=player|series=Left 4 Dead}} Human players of any team are this entity.
{{note|Bot zombies' player entity exists for 7 seconds after they die while a survivor bot's player entity remains forever (or until human player takes their places)}}
{{note|Bot zombies' player entity exists for 7 seconds after they die while a survivor bot's player entity remains forever (or until human player takes their places)}}
{{note|Survivor bots, SI and Tank's classname in-game is also <code>player</code>.}}
{{note|Survivor bots, SI and Tank's classname in-game is also <code>player</code>.}}
Line 11: Line 11:


==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|SetHUDVisibility|param=boolean|Hides or displays the HUD.
{{I|SetHUDVisibility|param=boolean|Hides or displays the HUD.
{{warning|Can't switch items when HUD is disabled}}}}
{{warning|Can't switch items when HUD is disabled}}}}
{{IO|SetFogController|param=string|Sets the {{ent|env_fog_controller}} to use.}}
{{I|SetFogController|param=string|Sets the {{ent|env_fog_controller}} to use.}}
{{IO|SpeakResponseConcept|param=string|Speak the specified [[Response System|response concept]] immediately.}}
{{I|SpeakResponseConcept|param=string|Speak the specified [[Response System|response concept]] immediately.}}
{{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.}}  
{{I|IgnoreFallDamageWithoutReset|param=float|Absolutely prevent the player from taking fall damage for [n] seconds.}}  
:{{note|Should use "OnStartTrouch - !activator". Consider the Time to be short, if there's another ledge they could jump off while being in the "no damage" timer.}}
:{{note|Should use "OnStartTrouch - !activator". Consider the Time to be short, if there's another ledge they could jump off while being in the "no damage" timer.}}
:{{note|Affects AI [[boomer|boomers]] who by default take fall damage}}
:{{note|Affects AI [[boomer|boomers]] who by default take fall damage}}
{{IO|SetCommentaryStatueMode|param=boolean|When set to 1, player bot will be stopped and have HP set to 1048576 (2^20). Setting it back to 0 will leave the bot with 1 HP}}
{{I|SetCommentaryStatueMode|param=boolean|When set to 1, player bot will be stopped and have HP set to 1048576 (2^20). Setting it back to 0 will leave the bot with 1 HP}}
{{IO|DisableLedgeHang|Disable ledge hanging by player.}}
{{I|DisableLedgeHang|Disable ledge hanging by player.}}
{{IO|EnableLedgeHang|Enable ledge hanging by player.}}
{{I|EnableLedgeHang|Enable ledge hanging by player.}}
{{IO|TeleportToSurvivorPosition|param=string|Teleport a player to an {{ent|info_survivor_position}} entity, then freezes them. To unfreeze them, use the <code>ReleaseSurvivorPositions</code> input from {{ent|info_director}} or the player's <code>ReleaseFromSurvivorPosition</code> input.}}
{{I|TeleportToSurvivorPosition|param=string|Teleport a player to an {{ent|info_survivor_position}} entity, then freezes them. To unfreeze them, use the <code>ReleaseSurvivorPositions</code> input from {{ent|info_director}} or the player's <code>ReleaseFromSurvivorPosition</code> input.}}
{{IO|ReleaseFromSurvivorPosition|Unfreezes and releases the player from an {{ent|info_survivor_position}} entity if they are at one.}}
{{I|ReleaseFromSurvivorPosition|Unfreezes and releases the player from an {{ent|info_survivor_position}} entity if they are at one.}}
{{IO|CancelCurrentScene|Cancels scene that's currently playing. Used in c6m3 to stop L4D2 survivors talking with L4D1 survivors when they start the elevator.}}
{{I|CancelCurrentScene|Cancels scene that's currently playing. Used in c6m3 to stop L4D2 survivors talking with L4D1 survivors when they start the elevator.}}
{{IO|OnRescueZoneTouch|{{todo|[[Player (Counter-Strike series)|Leftover from]] {{css}}?}}}}
{{I|SetGlowEnabled|param=boolean|Sets if this player is allowed to glow through walls if not visible.|only={{l4d2}}}}
{{IO|SetGlowEnabled|param=boolean|Sets if this player is allowed to glow through walls if not visible.|only={{l4d2}}}}
{{I|RemoveWeaponUpgrades|Removes laser sights from guns.|only={{l4d2}}}}
{{IO|RemoveWeaponUpgrades|Removes laser sights from guns.|only={{l4d2}}}}
{{I|OnRescueZoneTouch|Leftover from {{css}}}}


==See also==
==See also==

Revision as of 11:14, 25 March 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.
C++ Class hierarchy
CTerrorPlayer
CCSPlayer
CBaseMultiplayerPlayer
CBasePlayer
CBaseCombatCharacter
CBaseFlex
CBaseAnimatingOverlay
CBaseAnimating
CBaseEntity

player is an entity available in Left 4 Dead seriesLeft 4 Dead series Left 4 Dead series. Human players of any team are this entity.

Note.pngNote:Bot zombies' player entity exists for 7 seconds after they die while a survivor bot's player entity remains forever (or until human player takes their places)
Note.pngNote:Survivor bots, SI and Tank's classname in-game is also player.
Warning.pngWarning:This entity is not intended to be placed in a map manually. Doing so will result in an instant fatal error on map load!
Icon-Important.pngImportant:This is a preserved entity.
If the game has round restart mechanics this entity may not behave as expected:
More info
  • On a new round entities with this classname will intentionally not reset. You can use logic_auto to emulate resetting it.
  • Killing it removes it forever, as it is not respawned on a new round.
  • It cannot be spawned with a point_template.
  • Parenting this with non-preserved entities may have undesirable effects.

Inputs

SetHealth <integerRedirectInput/integer>
Sets the player's health. Values clamped between 0 and max_health.
SetHUDVisibility <booleanRedirectInput/boolean>
Hides or displays the HUD.
Warning.pngWarning:Can't switch items when HUD is disabled
SetFogController <stringRedirectInput/string>
Sets the env_fog_controller to use.
SpeakResponseConcept <stringRedirectInput/string>
Speak the specified response concept immediately.
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 "OnStartTrouch - !activator". Consider the Time to be short, if there's another ledge they could jump off while being in the "no damage" timer.
Note.pngNote:Affects AI boomers who by default take fall damage
SetCommentaryStatueMode <booleanRedirectInput/boolean>
When set to 1, player bot will be stopped and have HP set to 1048576 (2^20). Setting it back to 0 will leave the bot with 1 HP
DisableLedgeHang
Disable ledge hanging by player.
EnableLedgeHang
Enable ledge hanging by player.
TeleportToSurvivorPosition <stringRedirectInput/string>
Teleport a player to an info_survivor_position entity, then freezes them. To unfreeze them, use the ReleaseSurvivorPositions input from info_director or the player's ReleaseFromSurvivorPosition input.
ReleaseFromSurvivorPosition
Unfreezes and releases the player from an info_survivor_position entity if they are at one.
CancelCurrentScene
Cancels scene that's currently playing. Used in c6m3 to stop L4D2 survivors talking with L4D1 survivors when they start the elevator.
SetGlowEnabled <booleanRedirectInput/boolean> (only in Left 4 Dead 2)
Sets if this player is allowed to glow through walls if not visible.
RemoveWeaponUpgrades  (only in Left 4 Dead 2)
Removes laser sights from guns.
OnRescueZoneTouch
Leftover from Counter-Strike: Source

See also