Player Companion: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Half-Life 2 so far)
mNo edit summary
 
Line 2: Line 2:


In some games a Player Companion is invincible; they may be knocked down or play pain animations but cannot actually die. In other cases the Companion has signifiantly more health than normal, but can still die, resulting in a game over.
In some games a Player Companion is invincible; they may be knocked down or play pain animations but cannot actually die. In other cases the Companion has signifiantly more health than normal, but can still die, resulting in a game over.
Setting an NPC as vital/essential can be done several ways.
=Keyvalues=
This NPC will cause the game to end if killed.
* Is this a vital ally? ('''GameEndAlly''') <boolean> (in all games since Half-Life 2: Episode One)
=Inputs=
Determines whether the game should end if this character dies.
* '''MakeGameEndAlly'''  (in all games since Half-Life 2: Episode One)
* '''MakeRegularAlly'''  (in all games since Half-Life 2: Episode One)
{{stub}}
{{stub}}
[[Category:Half-Life 2]]
[[Category:Half-Life 2]]

Latest revision as of 14:11, 27 October 2024

A player companion helps the player through the majority of the game. Examples include NPCs npc_alyx and npc_barney. Distinguished from a Player Ally who is a generic expendable character (such as a rebel) and assists the player only briefly.

In some games a Player Companion is invincible; they may be knocked down or play pain animations but cannot actually die. In other cases the Companion has signifiantly more health than normal, but can still die, resulting in a game over.

Setting an NPC as vital/essential can be done several ways.

Keyvalues

This NPC will cause the game to end if killed.

  • Is this a vital ally? (GameEndAlly) <boolean> (in all games since Half-Life 2: Episode One)

Inputs

Determines whether the game should end if this character dies.

  • MakeGameEndAlly (in all games since Half-Life 2: Episode One)
  • MakeRegularAlly (in all games since Half-Life 2: Episode One)


Stub

This article or section is a stub. You can help by expanding it.