Info snipertarget: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (removed {{DISPLAYTITLE}}, covered by the hl2 point template. also fixed the incorrect entity name, which really perplexes me how anybody can get that wrong)
(updates)
Line 1: Line 1:
{{hl2 point|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.


==Entity description==
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.)
[[File:info_target.png|left]] An [[npc_sniper]] will take shots at this target, but only if he is told to (with the ''SweepTarget'', ''SweepTargetHighestPriority'' or ''SweepGroupRandomly'' [[input]]s). (You can not make the sniper take shots at something by naming an entity as the target or by using a normal [[info_target]] entity. He will just ignore such inputs.)
The info_snipertarget has several parameters that will determine the snipers behavior toward this target.


To make the sniper take shots at a moving target, you'll need to parent the info_snipertarget to it, but there is currently a bug preventing the sniper from actually hitting parented targets.
See {{ent|d1_town_05}} for multiple examples of its use.


==Keyvalues==
{{code class|CSniperTarget|proto_sniper.cpp}}
{{KV Targetname}}
{{KV Parentname}}
{{KV|Sweep to Speed|float|Sweep to speed. (Default 2)}}
{{KV|Group Name|string|The name of the group which the info_snipertarget belongs to. Used as a parameter for ''SweepGroupRandomly'' inputs.}}


==Flags==
==Flags==
*1 : Shoot Me
*1: Shoot Me - Sniper will shoot at this target once satisfied with aim.
:Probably makes the sniper take a shot at this target after having swept to it, but a crash bug currently prevents me from confirming this, so until it has been fixed always keep this flag checked.
*2: No Interruptions - All other targets will be ignored while sniper aims for this.
*2 : No Interruptions
*4: Snap Shot {{not in FGD}}
:Seeing the player or NPCs will not distract the sniper from taking the shot at this target.
: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]].
*4 : Snap Shot
*8: Resume if Interrupted
:If a more important target comes into view as the sniper is aiming for this target, he will fire a so called "snap shot" before aiming for the more important target, hoping his current aim will be accurate enough to hit it. 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. {{EP1 add|Obsolete}}
: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
*16: Snap to me
: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.
: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==
{{KV|Sweep to Speed (speed)|float|Seconds it takes for the sniper to align their shot onto the target.}}
{{KV|Group Name (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>.}}
{{KV BaseEntity|base=1}}


==Inputs==
==Inputs==
{{I Targetname}}
{{I BaseEntity|prel4d=1|base=1}}
{{I Parentname}}


==Outputs==
==Outputs==
{{O Targetname}}
{{O BaseEntity}}


==See also==
==See also==
* [[npc_sniper]] - Entity that use this target.
*{{ent|npc_bullseye}}, a similar entity that can be used by other NPCs as well.
 
[[Category:Entities]]

Revision as of 23:29, 10 September 2018

English (en)Translate (Translate)
Info target.png

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

  • 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.
  • 4: Snap Shot !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.
  • 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.
  • 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

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.