Since this has been asked a few times, I’m going to put it on the blog so that it’s easily findable in the future.

How do you use m25′s AI in a mod or campaign setting?

Simple, dear asker. Just follow these steps:

  1. Import the FFX module using the following command: from ffx import *
  2. Under your OnPostInit() section, add the following lines of code:
    1. setMission(numerical value), InitScripts(), and FFX_InitMission()
  3. Still under OnPostInit(), add the following lines of code:
  4. heroes = getAllHeroes()
        for h in heroes:
        	SetupAI(h)
        	AIDisableCustom(h)
    
  5. And when you’re ready to activate the custom AI, call SetupAI() with the appropriate character name.

The completed file will look similarly to this:

# Sample

from cshelper import *
from ffx import *
   
def OnPostInit():
    print "start"
    setMission(1)
    InitScripts()
    FFX_InitMission()
    heroes = getAllHeroes()
    for h in heroes:
         SetupAI(h)
         AIDisableCustom(h)        

def super(event):
    m25ai.SetupAI('superguy')

That’s the gist of it, but if you want to know more about this process and what other commands you’re able to use, check out this thread: Using m25 AI. Hope this helps.