CalcApproximatePathToPosition()
Returns an array of world positions representing the approximate path an actor will take. Calculating an approximate path will cause the AI to clear their current path.
Signature
<actor> CalcApproximatePathToPosition(<position>, [clear path])
Called on an entity: actor CalcApproximatePathToPosition(...)
Parameters
| Name | Required? | Details |
|---|---|---|
| position | Required | The goal position for the path |
| clear path | Optional | True to clear path, false otherwise. Defaults to True |
Returns
Returns an array of world positions representing the approximate path an actor will take.
Example (from Treyarch's docs)
self CalcApproximatePathToPosition( position )
Real uses in BO3's scripts
Called 8 times in the decompiled scripts. A few, zombies first:
- scripts/zm/_zm_ai_margwa_elemental.gsc, line 1754
path = self calcapproximatepathtoposition(goal_pos, 0); - scripts/zm/_zm_behavior.gsc, line 494
path = self calcapproximatepathtoposition(goalpos, 0); - scripts/zm/archetype_zod_companion.gsc, line 786
path = entity calcapproximatepathtoposition(var_c96da0a0); - scripts/shared/ai/archetype_robot.gsc, line 2371
path = entity calcapproximatepathtoposition(entity.lastvalidenemypos, 0); - scripts/shared/ai/zombie.gsc, line 809
path = self calcapproximatepathtoposition(goalpos, 0);
Related built-ins
- PathMode()Set the path mode of this actor.
- HasPath()Returns true/false if AI has a path
- UsePosition()Override where the actor should run to.
- ClearPath()Clears the AI's current path.
- SetRepairPaths()True allows havok to repath automatically if the AI moves off their predefined path.
- GetNodeOffsetPosition()Returns the position the actor thinks the node's origin is at, this can be offset from where the actual node's position in the world is.
- ClearUsePosition()Clear the override for the goal pos.
- GetPathMode()Get the path mode of this actor.
- GetFinalPathPos()Get the last position in the path
- PredictPath()Predicts the path to look for upcoming corner using havok corner predictor.
- FindReacquireDirectPath()Finds a path directly to the enemy.
- FindReacquireProximatePath()Finds a path to a point that can see the enemy without leaving goal.
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).