Template:I CAI BaseNPC: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
({{minititle|AI_BaseNPC}})
m (→‎top: Substituted IO templates)
 
(3 intermediate revisions by 2 users not shown)
Line 4: Line 4:
----
----
</noinclude>{{minititle|AI_BaseNPC}}
</noinclude>{{minititle|AI_BaseNPC}}
{{IO|SetRelationship|param=string|<[[string]]&#124;[[targetname]] or [[classname]]> <[[string]]&#124;disposition> <[[int]]&#124;rank>  
{{I|SetRelationship|param=string|<[[string]]&#124;[[targetname]] or [[classname]]> <[[string]]&#124;disposition> <[[int]]&#124;rank>  
:Changes whether this NPC likes or dislikes certain others. Used like the {{ent|ai_relationship}} entity, with this NPC as the subject.
:Changes whether this NPC likes or dislikes certain others. Used like the {{ent|ai_relationship}} entity, with this NPC as the subject.
:Values for <code>disposition</code> are:
:Values for <code>disposition</code> are:
Line 11: Line 11:
:*<code>D_LI</code>: Like
:*<code>D_LI</code>: Like
:*<code>D_NU</code>: Neutral}}
:*<code>D_NU</code>: Neutral}}
{{IO|SetEnemyFilter|param=targetname|Set a [[filter]] by which to filter potential enemies.}}
{{I|SetEnemyFilter|param=targetname|Set a [[filter]] by which to filter potential enemies.}}
{{IO|SetHealth|param=int|Set the health of the NPC to this amount.}}{{#if:{{{rappel|}}}|
{{I|SetHealth|param=int|Set the health of the NPC to this amount.}}{{#if:{{{rappel|}}}|
{{IO|BeginRappel|Tells NPC to begin rappelling.}}|<noinclude>
{{I|BeginRappel|Tells NPC to begin rappelling.}}|<noinclude>
{{IO|BeginRappel|Tells NPC to begin rappelling.}}</noinclude>}}
{{I|BeginRappel|Tells NPC to begin rappelling.}}</noinclude>}}<!--
{{IO|SetSquad|param=string|Changes the name of this NPC's [[squad]]. Leaving the parameter blank will remove the NPC from any existing squad.}}
-->{{I|SetSquad|param=string|Changes the name of this NPC's [[squad]]. Leaving the parameter blank will remove the NPC from any existing squad.}}
{{IO|Wake|Wakes up the NPC if it is sleeping.{{clarify}}}}
{{I|Wake|Wakes up the NPC if it is sleeping.{{clarify}}}}
{{IO|UpdateEnemyMemory|param=targetname|since=EP1|Update (or create) this NPC's memory of of the given entity.}}
{{I|UpdateEnemyMemory|param=targetname|since=EP1|Update (or create) this NPC's memory of of the given entity.}}
{{IO|ForgetEntity|param=targetname|Clears out the NPC's knowledge of a named entity.}}
{{I|ForgetEntity|param=targetname|Clears out the NPC's knowledge of a named entity.}}
{{IO|IgnoreDangerSounds|param=float|Ignore danger sounds for the specified number of seconds. {{todo|Clarify what a "danger sound" is.}}}}
{{I|IgnoreDangerSounds|param=float|Ignore danger sounds for the specified number of seconds. {{todo|Clarify what a "danger sound" is.}}}}
{{IO|Break|Makes the NPC die and disappear.}}
{{I|Break|Makes the NPC die and disappear.}}
{{IO|StartScripting|Puts the NPC into a "scripted" state. It will ignore a variety of stimuli, such as {{ent|+use}}, danger sounds, and idle speech.}}
{{I|StartScripting|Puts the NPC into a "scripted" state. It will ignore a variety of stimuli, such as {{ent|+use}}, danger sounds, and idle speech.}}
{{IO|ExitScripting|Puts the NPC into their normal state again.}}
{{I|ExitScripting|Puts the NPC into their normal state again.}}
{{IO|GagEnable|Prevents the NPC from making any vocalized sounds or speech, unless they are in a choreographed scene.}}
{{I|GagEnable|Prevents the NPC from making any vocalized sounds or speech, unless they are in a choreographed scene.}}
{{IO|GagDisable|Allow the NPC to make vocalizations again.}}
{{I|GagDisable|Allow the NPC to make vocalizations again.}}
{{IO|InsideTransition|nofgd=1|Tells the NPC to stop any ''choreography'' (but not scripted speech) its a part of. Usually this is only done by a {{ent|trigger_changelevel}} when a player steps inside it, and the NPC is inside an associated {{ent|trigger_transition}}.}}
{{I|InsideTransition|nofgd=1|Tells the NPC to stop any ''choreography'' (but not scripted speech) its a part of. Usually this is only done by a {{ent|trigger_changelevel}} when a player steps inside it, and the NPC is inside an associated {{ent|trigger_transition}}.}}
{{IO|OutsideTransition|nofgd=1|Tells the NPC to teleport to an {{ent|info_node_hint}} with the '''Hint''' set to ''Player squad transition point''. Usually this is only done by a {{ent|trigger_changelevel}} when a player steps inside it, and the NPC (if it is vital that it transitions) is ''not'' inside an associated {{ent|trigger_transition}}.}}
{{I|ActivateSpeedModifier|nofgd=1|}}
{{IO|ActivateSpeedModifier|nofgd=1|}}
{{I|DisableSpeedModifier|nofgd=1|}}
{{IO|DisableSpeedModifier|nofgd=1|}}
{{I|SetSpeedModRadius|nofgd=1|}}
{{IO|SetSpeedModRadius|nofgd=1|}}
{{I|SetSpeedModSpeed|nofgd=1|}}
{{IO|SetSpeedModSpeed|nofgd=1|}}
{{I|HolsterWeapon|Makes the NPC put their weapon away.}}
{{IO|HolsterWeapon|Makes the NPC put their weapon away.}}
{{I|UnholsterWeapon|Makes the NPC take out their weapon, if they have one.}}
{{IO|UnholsterWeapon|Makes the NPC take out their weapon, if they have one.}}
{{I|HolsterAndDestroyWeapon|Makes the NPC holster their weapon and then never unholster it again.}}
{{IO|HolsterAndDestroyWeapon|Makes the NPC holster their weapon and then never unholster it again.}}
{{I|ForceInteractionWithNPC|param=string|since=EP1|Force the NPC to use a dynamic interaction with another NPC. Syntax is <code><[[targetname]]> <dynamic interaction></code>.}}<noinclude>
{{IO|ForceInteractionWithNPC|param=string|since=EP1|Force the NPC to use a dynamic interaction with another NPC. Syntax is <code><[[targetname]]> <dynamic interaction></code>.}}
[[Category:Input Templates|CAI_BaseNPC]]
{{IO|physdamagescale|param=float|Scales the damage taken when this NPC is hit by a physics object.}}
</noinclude>
{{IO|KilledNPC|Tells the NPC it killed something.}}

Latest revision as of 12:54, 21 April 2025

This template is our holder for all inputs assigned through CAI_BaseNPC.

Add |rappel=1 to display the BeginRappel input.


AI_BaseNPC:

SetRelationship <string>
<string|targetname or classname> <string|disposition> <int|rank>
Changes whether this NPC likes or dislikes certain others. Used like the ai_relationship entity, with this NPC as the subject.
Values for disposition are:
  • D_HT: Hate
  • D_FR: Fear
  • D_LI: Like
  • D_NU: Neutral
SetEnemyFilter <targetname>
Set a filter by which to filter potential enemies.
SetHealth <integer>
Set the health of the NPC to this amount.
BeginRappel
Tells NPC to begin rappelling.
SetSquad <string>
Changes the name of this NPC's squad. Leaving the parameter blank will remove the NPC from any existing squad.
Wake
Wakes up the NPC if it is sleeping.[Clarify]
UpdateEnemyMemory <targetname> (in all games since Half-Life 2: Episode One)
Update (or create) this NPC's memory of of the given entity.
ForgetEntity <targetname>
Clears out the NPC's knowledge of a named entity.
IgnoreDangerSounds <float>
Ignore danger sounds for the specified number of seconds.
Todo: Clarify what a "danger sound" is.
Break
Makes the NPC die and disappear.
StartScripting
Puts the NPC into a "scripted" state. It will ignore a variety of stimuli, such as +use, danger sounds, and idle speech.
ExitScripting
Puts the NPC into their normal state again.
GagEnable
Prevents the NPC from making any vocalized sounds or speech, unless they are in a choreographed scene.
GagDisable
Allow the NPC to make vocalizations again.
InsideTransition  !FGD
Tells the NPC to stop any choreography (but not scripted speech) its a part of. Usually this is only done by a trigger_changelevel when a player steps inside it, and the NPC is inside an associated trigger_transition.
ActivateSpeedModifier  !FGD
DisableSpeedModifier  !FGD
SetSpeedModRadius  !FGD
SetSpeedModSpeed  !FGD
HolsterWeapon
Makes the NPC put their weapon away.
UnholsterWeapon
Makes the NPC take out their weapon, if they have one.
HolsterAndDestroyWeapon
Makes the NPC holster their weapon and then never unholster it again.
ForceInteractionWithNPC <string> (in all games since Half-Life 2: Episode One)
Force the NPC to use a dynamic interaction with another NPC. Syntax is <targetname> <dynamic interaction>.