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

ai_changetarget

From Valve Developer Community
Revision as of 13:06, 3 January 2024 by WisdomBot (talk | contribs) (Updated old entity format to {{this is a}}. This action was perfomed by a bot under supervision.)
Jump to navigation Jump to search
C++ Class hierarchy
CAI_ChangeTarget
CBaseEntity
C++ triggers.cpp

ai_changetarget is an e0 available in all Source Source games. It's main use is for changing the target keyvalue of NPCs, but it can change the target of any entity if applicable. This task can also be done using AddOutput.

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

Keyvalues

Target (target) <targetname>
Entity(s) that should have target changed.
NewTarget (m_iszNewTarget) <targetname>
New targetname for the targeted entity(s) to target.
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

Inputs

Activate
Trigger the target change.