Template:I BaseNPC: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Restructured a bit.)
(Reformatted, refering to ai_relationship (so it won't take up so much space).)
Line 10: Line 10:


* '''SetRelationship <string>'''
* '''SetRelationship <string>'''
: Changes this entity's relationship with another entity or class.
: Changes this entity's relationship toward another entity or class. (Used like the [[ai_relationship]] entity, with this NPC as the ''subject''.)
: Format: <code><NPC name or classname> <new relationship> <priority></code>
: Format: <code><target> <disposition> <rank></code>
: <NPC name or classname> - The name of the NPC or class to change relation towards. You can set this parameter to <code>!player</code> to have this relation be against the player.
: <disposition> values:
: <new relationship> - The type of relationship to have against NPC(s) specified in <NPC name or classname>.
:{|
: New relationships:
! Literal Value || Description
: <code>D_NU</code> - Neutral (Will not attack. Rebels avoid excusingly, and can not be commanded.)
|-
: <code>D_HT</code> - Hate (Considers the target NPC(s) an enemy/enemies and will attack.)
| D_HT || Hate
: <code>D_LI</code> - Like (Will not attack. Rebels follow automatically, and can be commanded.)
|-
: <code>D_FR</code> - Fear (Headcrabs runs away without attacking, metropolice attacks, rebels avoids without attacking.)
| D_FR || Fear
: <priority> - {{todo|Write a description about what priorities are.}}
|-
| D_LI || Like
|-
| D_NU || Neutral
|}


* '''SetHealth <integer>'''
* '''SetHealth <integer>'''

Revision as of 07:19, 8 April 2006

Template:I targetname

  • SetRelationship <string>
Changes this entity's relationship toward another entity or class. (Used like the ai_relationship entity, with this NPC as the subject.)
Format: <target> <disposition> <rank>
<disposition> values:
Literal Value Description
D_HT Hate
D_FR Fear
D_LI Like
D_NU Neutral
  • SetHealth <integer>
Set this NPC's health.
  • SetBodyGroup <integer>
HACK: Sets this NPC's body group (from 0 - n). You'd better know what you are doing!
  • physdamagescale <float>
Sets the value that scales damage energy when this character is hit by a physics object. NOTE: 0 means this feature is disabled for backwards compatibility.
  • Ignite
Ignite, burst into flames
  • Break
Break, smash into pieces
  • StartScripting
Enter scripting state. In this state, NPCs ignore a variety of stimulus that would make them break out of their scripts: They ignore danger sounds, ignore +USE, don't idle speak or respond to other NPC's idle speech, and so on.
  • StopScripting
Exit scripting state.
  • Assault <target_destination>
Start an assault. Parameter passed in should be the name of the rally point.
  • SetSquad <string>
Set the name of this NPC's squad. It will be removed from any existing squad automatically. Leaving the parameter blank will remove the NPC from any existing squad.
  • Wake
Wakes up the NPC if it is sleeping.
  • ForgetEntity <target_destination>
Clears out the NPC's knowledge of a named entity.
  • GagEnable
Turn on the NPC Gag flag. NPC won't speak outside of choreographed scenes.
  • GagDisable
Turn off the NPC Gag flag.
  • IgnoreDangerSounds <float>
Ignore danger sounds for the specified number of seconds.