Player Companion

From Valve Developer Community
Jump to navigation Jump to search

A player companion helps the player through the majority of the game. Examples include NPCs like npc_alyx and npc_barney. Distinguished from a Player Ally who is a generic expendable character (such as a npc_citizen) 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 significantly 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

Is this a vital ally? (GameEndAlly) <boolean> (in all games since Half-Life 2: Episode One)
This NPC will cause the game to end if killed.

Inputs

MakeGameEndAlly  (in all games since Half-Life 2: Episode One)
Make the game end if this character dies
MakeRegularAlly  (in all games since Half-Life 2: Episode One)
Allow the game to continue if this character dies


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