No Title

From DarkAI

AI ADD VIEW BLOCKING OBSTACLE

This command adds an view blocking 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.

View blocking obstacles are a special type of obstacle that do not obstruct the movement of entities but still prevent entities from seeing through the edges of the obstacle. Unlike normal obstacles view blocking obstacles do not affect the waypoint network when added or removed, as such view blocking obstacle can be added or removed with very little impact on performance and can be done in real-time. This could be used to represent a door which prevents entities from seeing through it, but can be removed when the door is opened, and re-added when it is closed.


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. 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 Static Obstacle for adding obstacles that obstruct movement.

Syntax
AI Add View Blocking Obstacle Obstacle Number
AI Add View Blocking Obstacle Obstacle Number, Height
AI Add View Blocking 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