No Title

From DarkAI

AI ADD STATIC OBSTACLE

This command adds an obstacle to the AI system from a specified DarkBasic object. The AI system will create a convex shape from the object by looking top down on the object and joining the outside points in a circular fashion. Therefore this is best suited to objects that are already convex in nature such as cubes and spheres, and other more complex shapes should be made using AI Start New Obstacle. This command does not require the DarkBasic object to exist after it has been called and does not update the internal state if the object is moved or rotated.


Obstacles can be created as full height or half height, the only difference being that half height objects do not block an entity's view whilst it is standing, but do when it is ducking. Both block an entity's path from one point to another. The default is full height (1).

The container number allows you to add the obstacle to a different container, the default is 0.

For dynamic obstacles (that obstruct movement) it is recommended that you use an external collision or physics system and report such collisions to the entity using AI Set Entity Collide.

See AI Add View Blocking Obstacle for adding obstacles that do not obstruct movement.

You must call AI Complete Obstacles sometime after this command, after all static obstacles have been added, to complete the setup and create waypoint and collision data for all obstacles. If you add an obstacle after calling AI Complete Obstacles you must call it again to see any changes you make.

Syntax
AI Add Static Obstacle Obstacle Number
AI Add Static Obstacle Obstacle Number, Height
AI Add Static Obstacle Obstacle Number, Height, Container Number

Parameters
Obstacle Number, The id of the object you want to add
Height, (optional) 1 for full height, 0 for half height
Container Number, The id of the container you want to add the obstacle to.

Return
n/a