Manual Control of AI

  • November 3, 2017 at 14:59 #22317

    How would I be able to create an AI that only runs when needed? Right now I have the AI running as normal, with a flag check at the beginning to see if it needs to continue on. I’d like to change it so the AI never runs until I specifically ask it to.

    Any thoughts on this?

    November 3, 2017 at 15:24 #22320

    Hi Shawn,

    Thanks for your post.

    AIs can be manually executed through the Execute method on UtilityAIClients, although this would require you to have a reference to those clients, usually by writing your own UtilityAIComponent.

    There is also a “LoadBalancedExecuteOnce” method on the UtilityAIComponent, but you would need to set the startDelay/interval on it to a very large number to prevent it from executing regularly.

    The optimal solution would be for you to write your own version of the UtilityAIComponent and UtilityAIClient, which gives you complete control over its execution.

    Alternatively, if it is a matter of simply starting and stopping the AI at certain times, the UtilityAIComponent and UtilityAIClients have Stop, Start, Resume and Wait methods for this purpose.

    • This reply was modified 1 year, 4 months ago by Rami.

You must be logged in to reply to this topic.