Npc sniper: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Fixing 'See Also' header level)
m (Formatting)
Line 10: Line 10:


* '''Name''' ''targetname <target_source>''   
* '''Name''' ''targetname <target_source>''   
** The name that other entities refer to this entity by.
: The name that other entities refer to this entity by.
 
* '''Pitch Yaw Roll (Y Z X)''' ''angles <angle>''  
* '''Pitch Yaw Roll (Y Z X)''' ''angles <angle>''  
** This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
: This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
 
* '''Render FX''' ''renderfx <choices>''
* '''Render FX''' ''renderfx <choices>''
* '''Render Mode''' ''rendermode <choices>''
* '''Render Mode''' ''rendermode <choices>''
** Used to set a non-standard rendering mode on this entity. See also 'FX Amount' and 'FX Color'.
: Used to set a non-standard rendering mode on this entity. See also 'FX Amount' and 'FX Color'.
 
* '''FX Amount (0 - 255)''' ''renderamt <integer>''  
* '''FX Amount (0 - 255)''' ''renderamt <integer>''  
** The FX amount is used by the selected Render Mode.
: The FX amount is used by the selected Render Mode.
 
* '''FX Color (R G B)''' ''rendercolor <color255>''
* '''FX Color (R G B)''' ''rendercolor <color255>''
** The FX color is used by the selected Render Mode.
: The FX color is used by the selected Render Mode.
 
* '''Disable Receiving Shadows''' ''disablereceiveshadows <choices>''
* '''Disable Receiving Shadows''' ''disablereceiveshadows <choices>''
* '''Damage Filter''' ''damagefilter <target_destination>''
* '''Damage Filter''' ''damagefilter <target_destination>''
** Name of the filter entity that controls which entities can damage us.
: Name of the filter entity that controls which entities can damage us.
 
* '''Response Contexts''' ''ResponseContext <string>''
* '''Response Contexts''' ''ResponseContext <string>''
** Response system context(s) for this entity. Format should be: 'key:value,key2:value2,etc'. When this entity speaks, the list of keys & values will be passed to the response rules system.
: Response system context(s) for this entity. Format should be: 'key:value,key2:value2,etc'. When this entity speaks, the list of keys & values will be passed to the response rules system.
 
* '''Disable shadows''' ''disableshadows <choices>''  
* '''Disable shadows''' ''disableshadows <choices>''  
* '''Target Path Corner''' ''target <target_destination>''  
* '''Target Path Corner''' ''target <target_destination>''  
** If set, the name of a path corner entity that this NPC will walk to, after spawning.
: If set, the name of a path corner entity that this NPC will walk to, after spawning.
 
* '''Squad Name''' ''squadname <string>''
* '''Squad Name''' ''squadname <string>''
** NPCs that are in the same squad (i.e. have matching squad names) will share information about enemies, and will take turns attacking and covering each other.
: NPCs that are in the same squad (i.e. have matching squad names) will share information about enemies, and will take turns attacking and covering each other.
 
* '''Hint Group''' ''hintgroup <string>''
* '''Hint Group''' ''hintgroup <string>''
** Hint groups are used by NPCs to restrict their hint-node searching to a subset of the map's hint nodes. Only hint nodes with matching hint group names will be considered by this NPC.
: Hint groups are used by NPCs to restrict their hint-node searching to a subset of the map's hint nodes. Only hint nodes with matching hint group names will be considered by this NPC.
 
* '''Hint Limit Nav''' ''hintlimiting <choices>''
* '''Hint Limit Nav''' ''hintlimiting <choices>''
** Limits NPC to using specified hint group for navigation requests, but does not limit local navigation.
: Limits NPC to using specified hint group for navigation requests, but does not limit local navigation.
 
* '''spawnflags''' ''spawnflags <flags>''  
* '''spawnflags''' ''spawnflags <flags>''  
* '''Sleep State''' ''sleepstate <choices>''
* '''Sleep State''' ''sleepstate <choices>''
** Holds the NPC in stasis until specified condition. See also 'Wake Radius' and 'Wake Squad'.
: Holds the NPC in stasis until specified condition. See also 'Wake Radius' and 'Wake Squad'.
 
* '''Wake Radius''' ''wakeradius <float>''
* '''Wake Radius''' ''wakeradius <float>''
** Auto-wake if player within this distance
: Auto-wake if player within this distance
 
* '''Wake Squad''' ''wakesquad <choices>''
* '''Wake Squad''' ''wakesquad <choices>''
** Wake all of the NPCs squadmates if the NPC is woken
: Wake all of the NPCs squadmates if the NPC is woken
 
* '''Physics Impact Damage Scale''' ''physdamagescale <float>''
* '''Physics Impact Damage Scale''' ''physdamagescale <float>''
** Scales damage energy when this character is hit by a physics object. With a value of 0 the NPC will take no damage from physics.
: Scales damage energy when this character is hit by a physics object. With a value of 0 the NPC will take no damage from physics.
 
* '''Patience Radius''' ''radius <integer>''
* '''Patience Radius''' ''radius <integer>''
* '''Initial Misses''' ''misses <integer>''
* '''Initial Misses''' ''misses <integer>''
Line 52: Line 67:


* '''Kill'''
* '''Kill'''
** Removes this entity from the world.
: Removes this entity from the world.
 
* '''KillHierarchy'''   
* '''KillHierarchy'''   
** Removes this entity and all its children from the world.
: Removes this entity and all its children from the world.
 
* '''AddOutput''' ''<string> <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>''  
* '''AddOutput''' ''<string> <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>''  
** Adds an entity I/O connection to this entity. Very dangerous, use with care
: Adds an entity I/O connection to this entity. Very dangerous, use with care
 
* '''FireUser1'''  
* '''FireUser1'''  
** Causes this entity's OnUser1 output to be fired.
: Causes this entity's OnUser1 output to be fired.
 
* '''FireUser2'''  
* '''FireUser2'''  
** Causes this entity's OnUser2 output to be fired.
: Causes this entity's OnUser2 output to be fired.
 
* '''FireUser3'''  
* '''FireUser3'''  
** Causes this entity's OnUser3 output to be fired.
: Causes this entity's OnUser3 output to be fired.
 
* '''FireUser4'''  
* '''FireUser4'''  
** Causes this entity's OnUser4 output to be fired.
: Causes this entity's OnUser4 output to be fired.
 
* '''SetDamageFilter <string>'''
* '''SetDamageFilter <string>'''
** Sets the entity to use as damage filter. Pass in an empty string to clear the damage filter.
: Sets the entity to use as damage filter. Pass in an empty string to clear the damage filter.
 
* '''AddContext <string>'''
* '''AddContext <string>'''
** Adds a context to this entity's list of response contexts. The format should be 'key:value'.
: Adds a context to this entity's list of response contexts. The format should be 'key:value'.
 
* '''RemoveContext <string>'''
* '''RemoveContext <string>'''
** Remove a context from this entity's list of response contexts. The name should match the 'key' of a previously added context.
: Remove a context from this entity's list of response contexts. The name should match the 'key' of a previously added context.
 
* '''ClearContext'''
* '''ClearContext'''
** Removes all contexts in this entity's list of response contexts.
: Removes all contexts in this entity's list of response contexts.
 
* '''DisableShadow'''
* '''DisableShadow'''
** Turn shadow off.
: Turn shadow off.
 
* '''EnableShadow'''
* '''EnableShadow'''
** Turn shadow on.
: Turn shadow on.
 
* '''SetRelationship <string>'''
* '''SetRelationship <string>'''
** Changes this entity's relationship with another entity or class. Format: ''<entityname/classname> <D_HT/D_FR/D_LI/D_NU> <priority>''
: Changes this entity's relationship with another entity or class. Format: ''<entityname/classname> <D_HT/D_FR/D_LI/D_NU> <priority>''
 
* '''SetHealth <integer>'''
* '''SetHealth <integer>'''
** Set this NPC's health.
: Set this NPC's health.
 
* '''SetBodyGroup <integer>'''
* '''SetBodyGroup <integer>'''
** HACK: Sets this NPC's body group (from 0 - n). You'd better know what you are doing!
: HACK: Sets this NPC's body group (from 0 - n). You'd better know what you are doing!
 
* '''physdamagescale <float>'''
* '''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.
: 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'''
** Ignite, burst into flames ''(Ow!)''
: Ignite, burst into flames ''(Ow!)''
 
* '''Break'''
* '''Break'''
** Break, smash into pieces
: Break, smash into pieces
 
* '''StartScripting'''
* '''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.
: 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'''
* '''StopScripting'''
** Exit scripting state.
: Exit scripting state.
 
* '''Assault <string>'''
* '''Assault <string>'''
** Start an assault. Parameter passed in should be the name of the rally point.
: Start an assault. Parameter passed in should be the name of the rally point.
 
* '''SetSquad <string>'''
* '''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.
: 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'''
* '''Wake'''
** Wakes up the NPC if it is sleeping.
: Wakes up the NPC if it is sleeping.
 
* '''ForgetEntity <string>'''
* '''ForgetEntity <string>'''
** Clears out the NPC's knowledge of a named entity.
: Clears out the NPC's knowledge of a named entity.
 
* '''GagEnable'''
* '''GagEnable'''
** Turn on the NPC Gag flag. NPC won't speak outside of choreographed scenes.
: Turn on the NPC Gag flag. NPC won't speak outside of choreographed scenes.
 
* '''GagDisable'''
* '''GagDisable'''
** Turn off the NPC Gag flag.
: Turn off the NPC Gag flag.
 
* '''IgnoreDangerSounds <float>'''
* '''IgnoreDangerSounds <float>'''
** Ignore danger sounds for the specified number of seconds.
: Ignore danger sounds for the specified number of seconds.
 
* '''EnableSniper'''
* '''EnableSniper'''
** Enable Shooting
: Enable Shooting
 
* '''DisableSniper'''
* '''DisableSniper'''
** Disable Shooting
: Disable Shooting
 
* '''SetDecoyRadius <integer>'''
* '''SetDecoyRadius <integer>'''
** Set Decoy Radius
: Set Decoy Radius
 
* '''SweepTarget <string>'''
* '''SweepTarget <string>'''
** Sweep a Target
: Sweep a Target
 
* '''SweepTargetHighestPriority <string>'''  
* '''SweepTargetHighestPriority <string>'''  
** Drop everything and sweep this target!
: Drop everything and sweep this target!
 
* '''SweepGroupRandomly <string>'''  
* '''SweepGroupRandomly <string>'''  
** Randomly Sweep a Group
: Randomly Sweep a Group


===Outputs===
===Outputs===


* '''OnUser1'''  
* '''OnUser1'''  
** Fired in response to FireUser1 input.
: Fired in response to FireUser1 input.
 
* '''OnUser2'''  
* '''OnUser2'''  
** Fired in response to FireUser2 input.
: Fired in response to FireUser2 input.
 
* '''OnUser3'''  
* '''OnUser3'''  
** Fired in response to FireUser3 input.
: Fired in response to FireUser3 input.
 
* '''OnUser4'''  
* '''OnUser4'''  
** Fired in response to FireUser4 input.
: Fired in response to FireUser4 input.
 
* '''OnDamaged'''
* '''OnDamaged'''
** Fired when this NPC takes damage.
: Fired when this NPC takes damage.
 
* '''OnDeath'''
* '''OnDeath'''
** Fired when this NPC is killed.
: Fired when this NPC is killed.
 
* '''OnHalfHealth'''
* '''OnHalfHealth'''
** Fired when this NPC reaches half of its maximum health.
: Fired when this NPC reaches half of its maximum health.
 
* '''OnHearWorld'''
* '''OnHearWorld'''
** Fired when this NPC hears a sound (other than combat or the player).
: Fired when this NPC hears a sound (other than combat or the player).
 
* '''OnHearPlayer'''
* '''OnHearPlayer'''
** Fired when this NPC hears the player.
: Fired when this NPC hears the player.
 
* '''OnHearCombat'''
* '''OnHearCombat'''
** Fired when this NPC hears combat sounds.
: Fired when this NPC hears combat sounds.
 
* '''OnFoundEnemy <string>'''
* '''OnFoundEnemy <string>'''
** Fired when this NPC establishes line of sight to its enemy (outputs entity).
: Fired when this NPC establishes line of sight to its enemy (outputs entity).
 
* '''OnLostEnemyLOS'''
* '''OnLostEnemyLOS'''
** Fired when this NPC loses line of sight to its enemy.
: Fired when this NPC loses line of sight to its enemy.
 
* '''OnLostEnemy'''
* '''OnLostEnemy'''
** Fired when this NPC loses its enemy. Usually due to the enemy being killed/removed, or because this NPC has selected a newer, more dangerous enemy.
: Fired when this NPC loses its enemy. Usually due to the enemy being killed/removed, or because this NPC has selected a newer, more dangerous enemy.
 
* '''OnFoundPlayer <string>'''
* '''OnFoundPlayer <string>'''
** Fired when this NPC establishes line of sight to its enemy, and that enemy is a player (outputs player entity).
: Fired when this NPC establishes line of sight to its enemy, and that enemy is a player (outputs player entity).
 
* '''OnLostPlayerLOS'''
* '''OnLostPlayerLOS'''
** Fired when this NPC loses line of sight to its enemy, and that enemy is a player.
: Fired when this NPC loses line of sight to its enemy, and that enemy is a player.
 
* '''OnLostPlayer'''
* '''OnLostPlayer'''
** Fired when this NPC loses its enemy, and that enemy was a player. Usually due to the enemy being killed/removed, or because this NPC has selected a newer, more dangerous enemy.
: Fired when this NPC loses its enemy, and that enemy was a player. Usually due to the enemy being killed/removed, or because this NPC has selected a newer, more dangerous enemy.
 
* '''OnDamagedByPlayer'''
* '''OnDamagedByPlayer'''
** Fired when this NPC is hurt by a player.
: Fired when this NPC is hurt by a player.
 
* '''OnDamagedByPlayerSquad'''
* '''OnDamagedByPlayerSquad'''
** Fired when this NPC is hurt by a player OR by one of the player's squadmates.
: Fired when this NPC is hurt by a player OR by one of the player's squadmates.
 
* '''OnDenyCommanderUse'''
* '''OnDenyCommanderUse'''
** Fired when this NPC has refused to join the player's squad.
: Fired when this NPC has refused to join the player's squad.
 
* '''OnWake'''  
* '''OnWake'''  
** Fired when this NPC comes out of a sleep state.
: Fired when this NPC comes out of a sleep state.


==See Also==
==See Also==

Revision as of 08:08, 9 July 2005

Template:Wrongtitle

Entity Description

Entity Name: npc_sniper

Sniper

Entity Values

Keys

  • Name targetname <target_source>
The name that other entities refer to this entity by.
  • Pitch Yaw Roll (Y Z X) angles <angle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
  • Render FX renderfx <choices>
  • Render Mode rendermode <choices>
Used to set a non-standard rendering mode on this entity. See also 'FX Amount' and 'FX Color'.
  • FX Amount (0 - 255) renderamt <integer>
The FX amount is used by the selected Render Mode.
  • FX Color (R G B) rendercolor <color255>
The FX color is used by the selected Render Mode.
  • Disable Receiving Shadows disablereceiveshadows <choices>
  • Damage Filter damagefilter <target_destination>
Name of the filter entity that controls which entities can damage us.
  • Response Contexts ResponseContext <string>
Response system context(s) for this entity. Format should be: 'key:value,key2:value2,etc'. When this entity speaks, the list of keys & values will be passed to the response rules system.
  • Disable shadows disableshadows <choices>
  • Target Path Corner target <target_destination>
If set, the name of a path corner entity that this NPC will walk to, after spawning.
  • Squad Name squadname <string>
NPCs that are in the same squad (i.e. have matching squad names) will share information about enemies, and will take turns attacking and covering each other.
  • Hint Group hintgroup <string>
Hint groups are used by NPCs to restrict their hint-node searching to a subset of the map's hint nodes. Only hint nodes with matching hint group names will be considered by this NPC.
  • Hint Limit Nav hintlimiting <choices>
Limits NPC to using specified hint group for navigation requests, but does not limit local navigation.
  • spawnflags spawnflags <flags>
  • Sleep State sleepstate <choices>
Holds the NPC in stasis until specified condition. See also 'Wake Radius' and 'Wake Squad'.
  • Wake Radius wakeradius <float>
Auto-wake if player within this distance
  • Wake Squad wakesquad <choices>
Wake all of the NPCs squadmates if the NPC is woken
  • Physics Impact Damage Scale physdamagescale <float>
Scales damage energy when this character is hit by a physics object. With a value of 0 the NPC will take no damage from physics.
  • Patience Radius radius <integer>
  • Initial Misses misses <integer>
  • 'Beam Brightness (0 to 255) beambrightness <integer>
  • Bullet shield distance shielddistance <float>
  • Bullet shield radius shieldradius <float>

Inputs

  • Kill
Removes this entity from the world.
  • KillHierarchy
Removes this entity and all its children from the world.
  • AddOutput <string> <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>
Adds an entity I/O connection to this entity. Very dangerous, use with care
  • FireUser1
Causes this entity's OnUser1 output to be fired.
  • FireUser2
Causes this entity's OnUser2 output to be fired.
  • FireUser3
Causes this entity's OnUser3 output to be fired.
  • FireUser4
Causes this entity's OnUser4 output to be fired.
  • SetDamageFilter <string>
Sets the entity to use as damage filter. Pass in an empty string to clear the damage filter.
  • AddContext <string>
Adds a context to this entity's list of response contexts. The format should be 'key:value'.
  • RemoveContext <string>
Remove a context from this entity's list of response contexts. The name should match the 'key' of a previously added context.
  • ClearContext
Removes all contexts in this entity's list of response contexts.
  • DisableShadow
Turn shadow off.
  • EnableShadow
Turn shadow on.
  • SetRelationship <string>
Changes this entity's relationship with another entity or class. Format: <entityname/classname> <D_HT/D_FR/D_LI/D_NU> <priority>
  • 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 (Ow!)
  • 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 <string>
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 <string>
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.
  • EnableSniper
Enable Shooting
  • DisableSniper
Disable Shooting
  • SetDecoyRadius <integer>
Set Decoy Radius
  • SweepTarget <string>
Sweep a Target
  • SweepTargetHighestPriority <string>
Drop everything and sweep this target!
  • SweepGroupRandomly <string>
Randomly Sweep a Group

Outputs

  • OnUser1
Fired in response to FireUser1 input.
  • OnUser2
Fired in response to FireUser2 input.
  • OnUser3
Fired in response to FireUser3 input.
  • OnUser4
Fired in response to FireUser4 input.
  • OnDamaged
Fired when this NPC takes damage.
  • OnDeath
Fired when this NPC is killed.
  • OnHalfHealth
Fired when this NPC reaches half of its maximum health.
  • OnHearWorld
Fired when this NPC hears a sound (other than combat or the player).
  • OnHearPlayer
Fired when this NPC hears the player.
  • OnHearCombat
Fired when this NPC hears combat sounds.
  • OnFoundEnemy <string>
Fired when this NPC establishes line of sight to its enemy (outputs entity).
  • OnLostEnemyLOS
Fired when this NPC loses line of sight to its enemy.
  • OnLostEnemy
Fired when this NPC loses its enemy. Usually due to the enemy being killed/removed, or because this NPC has selected a newer, more dangerous enemy.
  • OnFoundPlayer <string>
Fired when this NPC establishes line of sight to its enemy, and that enemy is a player (outputs player entity).
  • OnLostPlayerLOS
Fired when this NPC loses line of sight to its enemy, and that enemy is a player.
  • OnLostPlayer
Fired when this NPC loses its enemy, and that enemy was a player. Usually due to the enemy being killed/removed, or because this NPC has selected a newer, more dangerous enemy.
  • OnDamagedByPlayer
Fired when this NPC is hurt by a player.
  • OnDamagedByPlayerSquad
Fired when this NPC is hurt by a player OR by one of the player's squadmates.
  • OnDenyCommanderUse
Fired when this NPC has refused to join the player's squad.
  • OnWake
Fired when this NPC comes out of a sleep state.

See Also