Revision Difference
ENTITY:TranslateNavGoal#563337
<title>ENTITY:TranslateNavGoal</title>
<function name="TranslateNavGoal" parent="ENTITY" type="hook">
<added>2024.12.12</added>
<description>
Called by the engine to alter NPC's final position to reach its enemy or target.
Called by the engine to alter NPC's final position to reach its enemy or target. This is called twice for `GOALTYPE_PATHCORNER`; first is for the first path_corner and second for the next connected path_corner.
<note>This hook only exists for `ai` type SENTs.</note>
</description>
<realm>Server</realm>
<args name="Chasing Enemy">
<arg name="enemy" type="Entity" default="GetEnemy()">The enemy being chased.</arg>
<arg name="currentGoal" type="Vector" default="GetEnemyLastKnownPos()">The enemy's chase position.</arg>
</args>⤶
<args name="Moving to target">⤶
<arg name="target" type="Entity">The path_corner in query.</arg>⤶
<arg name="currentGoal" type="Vector">path_corner's origin.</arg>⤶
<arg name="target" type="NPC|Entity" default="GetEnemy() or m_hGoalEnt">The enemy being chased or the path_corner in query.</arg>
<arg name="currentGoal" type="Vector" default="GetEnemyLastKnownPos() or m_hGoalEnt:GetPos()">The target's origin.</arg>
</args>
<rets>
<ret name="" type="Vector">The actual point that NPC will move to reach its enemy or target. For the path to get updated, the new move path must be away from the current <page>NPC:GetGoalPos</page> by 120 units.
Do not return anything to not override.</ret>
</rets>
</function>