• 0

    posted a message on Switch between Melee and Campaign AI

    In reply to _ForgeUser4342312:

    Dead thread maybe lol, but i found a solution to end the melee AI. (it does not end the loop the melee AI runs on, but it prevents it from doing anything.)

     

    First you have to call the EndMeleeAI function as seen in the picture below (after having started the melee AI), next you can overwrite the MeleeAI.galaxy script (second attachment) to prevent the error message being displayed each time. (i modified it by adding "HI." to the beginning as a showcase it works) 

     

    Edit:

    I tried to put wait functions to maybe slow down the loop as needed, but the problem is then everything stops as this is getting called on the "native" thread. So theres no way to make the loop wait like this unfortunately.

     

    I also made it so that I overwrote the start melee AI function to just "return;" right away in BaseAI.galaxy. When using a extension mod I can in this way prevent the normal melee AI from getting started. And then I can call my own start AI functions as I please.

    Posted in: AI Development
  • 0

    posted a message on Melee AI

    To set the starting locations of the AI you should create your own custom scripts for starting the AI based on the default scripts found in the Editor Console -> Browse.

     

    Copy the BaseAI.galaxy functions for starting the campaign and melee AI and replace any reference to the PlayerStartLocation(int player) function with your start locations.


    Now call these functions to start the AI instead.

    Posted in: Triggers
  • To post a comment, please or register a new account.