This article's documentation is for anything that uses the Source engine. Click here for more information.

Info snipertarget: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Formatting)
(Rewrite Template:Lang to Template:LanguageBar. This action was performed by a bot.)
 
(28 intermediate revisions by 13 users not shown)
Line 1: Line 1:
{{wrongtitle|title=info_snipertarget}}
{{LanguageBar}}
==Entity Description==
{{CD|CSniperTarget|file1=1}}
'''Entity Name:''' info_snipertarget
{{this is a|point entity|name=info_snipertarget|sprite=info_target.png}} An {{ent|npc_sniper}} will take shots at this target, but only if told to, using inputs available to that entity. The <code>info_snipertarget</code> has parameters to alter the behavior while aiming and shooting.


Sniper Target


==Entity Values==
To make the sniper take shots at a moving target, you'll need to parent the <code>info_snipertarget</code> to that target, but this appears to be bugged{{confirm}}.
===Keys===
{{Confirm|This parenting issue was noted back in 2006 and may not apply anymore.}}


* '''Name''' ''targetname <target_source>'' 
: The name that other entities refer to this entity by.


* '''Parent''' ''parentname <target_destination>''
See {{ent|d1_town_05}} for multiple examples of its use.
: The name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.


* '''Sweep to speed''' ''speed <integer>''
==Keyvalues==
* '''Group Name''' ''groupname <string>''
{{KV Targetname}}
* '''spawnflags''' ''spawnflags <flags>''
{{KV|Sweep to Speed|intn=speed|float|Seconds it takes for the sniper to align their shot onto the target.}}
{{KV|Group Name|intn=groupname|string|The name of a group which the <code>info_snipertarget</code> belongs to. Used as a parameter for <code>SweepGroupRandomly</code> inputs for <code>npc_sniper</code>.}}


===Inputs===
==Flags==
{{Fl|1|Shoot Me|Sniper will shoot at this target once satisfied with aim.}}
{{Fl|2|No Interruptions|All other targets will be ignored while sniper aims for this.}}
{{Fl|4|Snap Shot|nofgd=1|: If a more important target comes into view as the sniper is aiming for this target, the sniper will fire at ''this'' target immediately, hoping the current aim was accurate enough to hit it, then focus on the higher-priority target. This shot will still count as interrupted, and the sniper will therefore resume to take another shot if the ''Resume if Interrupted'' flag is set for this target. This is considered obsolete from Episode 1 onward,{{why}} but [[This_Feature_is_Not_Available_by_Default#Flags_2|can still be used]].}}
{{Fl|8|Resume if Interrupted|If the sniper is busy taking shots at other targets when he is ordered to take a shot at this target, he will just delay the shot at this target until he is done, instead of ignoring it ''completely''. This is unless he is ordered to take another shot in this time.}}
{{Fl|16|Snap to me|The sniper will set his sight on this target before turning the dot on. This means that the dot will immediately start fixed at this position.}}


* '''Kill'''
==See also==
: Removes this entity from the world.
* {{ent|npc_sniper}}
 
*{{ent|npc_bullseye}}, a similar entity that can be used by other NPCs as well.
* '''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.
 
* '''SetParent <string>'''
: Changes the entity's parent in the movement hierarchy.
 
* '''SetParentAttachment <string>'''
: Change this entity to attach to a specific attachment point on its parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment.
 
* '''ClearParent'''
: Removes this entity from the the movement hierarchy, leaving it free to move independently.
 
===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.
 
===See Also===
 
* [[Npc_sniper|npc_sniper]] - shoots at this target.
 
[[category:Entities]]

Latest revision as of 17:25, 18 July 2025

English (en)Translate (Translate)
C++ Class hierarchy
CSniperTarget
CPointEntity
CBaseEntity
C++ proto_sniper.cpp
Info target.png

info_snipertarget is a point entity available in all Source Source games. An npc_sniper will take shots at this target, but only if told to, using inputs available to that entity. The info_snipertarget has parameters to alter the behavior while aiming and shooting.


To make the sniper take shots at a moving target, you'll need to parent the info_snipertarget to that target, but this appears to be bugged[confirm].

Confirm:This parenting issue was noted back in 2006 and may not apply anymore.


See d1_town_05 for multiple examples of its use.

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Sweep to Speed (speed) <float>
Seconds it takes for the sniper to align their shot onto the target.
Group Name (groupname) <string>
The name of a group which the info_snipertarget belongs to. Used as a parameter for SweepGroupRandomly inputs for npc_sniper.

Flags

Shoot Me : [1]
Sniper will shoot at this target once satisfied with aim.
No Interruptions : [2]
All other targets will be ignored while sniper aims for this.
Snap Shot : [4] !FGD
: If a more important target comes into view as the sniper is aiming for this target, the sniper will fire at this target immediately, hoping the current aim was accurate enough to hit it, then focus on the higher-priority target. This shot will still count as interrupted, and the sniper will therefore resume to take another shot if the Resume if Interrupted flag is set for this target. This is considered obsolete from Episode 1 onward,[Why?] but can still be used.
Resume if Interrupted : [8]
If the sniper is busy taking shots at other targets when he is ordered to take a shot at this target, he will just delay the shot at this target until he is done, instead of ignoring it completely. This is unless he is ordered to take another shot in this time.
Snap to me : [16]
The sniper will set his sight on this target before turning the dot on. This means that the dot will immediately start fixed at this position.

See also