Ai changetarget: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (removed {{DISPLAYTITLE}}, covered by the hl2 point template)
(updates)
Line 1: Line 1:
{{hl2 point|ai_changetarget}}
{{hl2 point|ai_changetarget}} It's main use is for changing the <code>target</code> keyvalue of NPCs. It can be used for changing any entity however. The function can also be done using {{ent|AddOutput}}.


== Entity description ==
{{code class|CAI_ChangeTarget|triggers.cpp}}
Changes the target of an [[entity]].


{{note|This entity functions as a target changer for any entity and not just [[NPC]]s.}}
==Keyvalues==
{{KV|Target (target)|target_destination|Entity(s) that should have <code>target</code> changed.}}
{{KV|NewTarget (m_iszNewTarget)|target_destination|New <code>targetname</code> for the targeted entity(s) to target.}}
{{KV BaseEntity|base=1}}


== Keyvalues ==
==Inputs==
{{KV Targetname}}
{{KV|Target|target_destination|Entity to change the target for.}}
{{KV|NewTarget|target_destination|New target's targetname.}}
 
== Inputs ==
{{I Targetname}}
{{IO|Activate|Trigger the target change.}}
{{IO|Activate|Trigger the target change.}}
{{I BaseEntity|base=1}}


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


[[Category:AI]]
[[Category:AI]]
[[Category:Entities]]

Revision as of 16:13, 1 September 2018

Template:Hl2 point It's main use is for changing the target keyvalue of NPCs. It can be used for changing any entity however. The function can also be done using AddOutput.

C++ In code, it is represented by theCAI_ChangeTargetclass, defined in thetriggers.cppfile.

Keyvalues

Target (target) ([todo internal name (i)]) <targetname>
Entity(s) that should have target changed.
NewTarget (m_iszNewTarget) ([todo internal name (i)]) <targetname>
New targetname for the targeted entity(s) to target.


Inputs

Activate
Trigger the target change.


Outputs