Info snipertarget: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(updates)
(Update template formatting.)
Line 1: Line 1:
{{lang|Info snipertarget}}
{{lang|Info snipertarget}}
[[File:info_target.png|left]]{{hl2 point|info_snipertarget}} 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.
{{hl2 point|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.


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}} This parenting issue was noted back in 2006 and may not apply anymore.)
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|This parenting issue was noted back in 2006 and may not apply anymore.}}


See {{ent|d1_town_05}} for multiple examples of its use.
See {{ent|d1_town_05}} for multiple examples of its use.
Line 9: Line 10:


==Flags==
==Flags==
*1: Shoot Me - Sniper will shoot at this target once satisfied with aim.
{{Fl|1|Shoot Me|Sniper will shoot at this target once satisfied with aim.}}
*2: No Interruptions - All other targets will be ignored while sniper aims for this.
{{Fl|2|No Interruptions|All other targets will be ignored while sniper aims for this.}}
*4: Snap Shot {{not in FGD}}
{{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]].}}
: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.}}
*8: Resume if Interrupted
{{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.}}
: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.
*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.


==Keyvalues==
==Keyvalues==

Revision as of 06:25, 16 September 2021

English (en)Translate (Translate)

Template:Hl2 point 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:This parenting issue was noted back in 2006 and may not apply anymore.

See d1_town_05 for multiple examples of its use.

C++ In code, it is represented by theCSniperTargetclass, defined in theproto_sniper.cppfile.

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.

Keyvalues

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


Inputs

Outputs

See also

  • npc_bullseye, a similar entity that can be used by other NPCs as well.