Unknown

From DarkAI

AI ENTITY ADD TARGET

This command will add an entity or player (Target ID) to another entity's target list (Entity Number) which will then be regarded as a valid target and fired upon as if the target was an enemy of the entity. The target will remain in the target list whilst the entity can see the target and for a short time after. Once the target has been lost for a certain amount of time it will be removed from the target list and will not be re-added unless it is re-spotted and is naturally a valid target or you add it again.

For example, normally enemy entities will only attack friendly entities or the player, but using this command you can add enemy entities to each others target lists and they will attack each other so long as they can see each other. To create a free for all style scenario you can create a group of entities, all on the same team, and use the AI Get Entity Can See command to check if each entity can see any other, and if so to add it to the target list using this command.

If the target already exists in the target list it will not be added again, so this command can safely be used many times on the same target. If you want to remove a target from the list before it loses sight use the AI Entity Remove Target command. The target does not have to exist, if it does not no change is made.

Entities are allowed any number of targets in their target list and it will be sorted automatically to select what the entity thinks is the biggest threat to it at the time, this is mostly based on distance.


Syntax
AI Entity Add Target Entity Number, Target ID

Parameters
Entity Number, The id of the entity you want to add the target to
Target ID, The id of the target object you want to add to the entity's target list.

Return
n/a