AI NavGoal t: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
m (Robot: fixing template case.)
 
(4 intermediate revisions by one other user not shown)
Line 12: Line 12:


;<code>[[Activity]] activity</code>
;<code>[[Activity]] activity</code>
:The activity to use when moving.
:The activity to use when moving. Overwritten by all of Valve's stock movement tasks except <code>TASK_SCRIPT_CUSTOM_MOVE_TO_TARGET</code>, so not useful unless you're using either that task or one of your own making.
;<code>[[Activity]] arrivalActivity</code>
;<code>[[Activity]] arrivalActivity</code>
;<code>[[int]] arrivalSequence</code>
;<code>[[int]] arrivalSequence</code>
:The activity or [[sequence]] to play on arriving at the goal.
:The activity or [[sequence]] to play on arriving at the goal. Will be blended with the NPC's idle animation in Valve's stock movement tasks.
;<code>[[float]] tolerance</code>
;<code>[[float]] tolerance</code>
:When the NPC reaches this distance from the goal, it will stop. Useful for targets within entities - e.g. a collidable model's origin.  
:NPCs closer to their target than this value won't fail their task if they are blocked. See <code>pTarget</code> if you want the NPC to ignore a certain entity when navigating.
;<code>[[AI_NavGoalFlags_t]] flags</code>
;<code>[[AI_NavGoalFlags_t]] flags</code>
:Movement flags - click link for detail.
:Movement flags - click link for detail.
;<code>[[CBaseEntity]]* pTarget</code>
;<code>[[CBaseEntity]]* pTarget</code>
:"The target of the navigation, primarily used to ignore the entity in hull and line traces".
:<code>pTarget</code> will be ignored by the navigator - i.e. the NPC won't try and find a way around it. Very useful when the goal is a model entity's origin.
;<code>[[float]] maxInitialSimplificationDist</code>
;<code>[[float]] maxInitialSimplificationDist</code>
:How far to simplify the path. Game default sets the minimum.
:How far to simplify the path. Game default sets the minimum.
:{{todo|What is simplification?}}
:{{TODO|What is simplification?}}




[[Category:AI Programming]]
[[Category:AI Programming]]
[[Category:Structures]]
[[Category:Structures]]

Latest revision as of 20:17, 19 January 2009

The AI_NavGoal_t structure is used to encapsulate a navigation request. It has five constructors, which accept varying destination parameters:

  1. Unspecified goal/location
  2. Vector destination
  3. Vector destination and GoalType_t
  4. AI_PathNode_t destination
  5. AI_PathNode_t destination and GoalType_t

Parameters

Alongside the parameters in the list above:

Activity activity
The activity to use when moving. Overwritten by all of Valve's stock movement tasks except TASK_SCRIPT_CUSTOM_MOVE_TO_TARGET, so not useful unless you're using either that task or one of your own making.
Activity arrivalActivity
int arrivalSequence
The activity or sequence to play on arriving at the goal. Will be blended with the NPC's idle animation in Valve's stock movement tasks.
float tolerance
NPCs closer to their target than this value won't fail their task if they are blocked. See pTarget if you want the NPC to ignore a certain entity when navigating.
AI_NavGoalFlags_t flags
Movement flags - click link for detail.
CBaseEntity* pTarget
pTarget will be ignored by the navigator - i.e. the NPC won't try and find a way around it. Very useful when the goal is a model entity's origin.
float maxInitialSimplificationDist
How far to simplify the path. Game default sets the minimum.
Todo: What is simplification?