Using m25 AI in mods
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:
- Import the FFX module using the following command:
from ffx import * - Under your OnPostInit() section, add the following lines of code:
setMission(numerical value),InitScripts(), andFFX_InitMission()
- Still under OnPostInit(), add the following lines of code:
- And when you’re ready to activate the custom AI, call
SetupAI()with the appropriate character name.
heroes = getAllHeroes() for h in heroes: SetupAI(h) AIDisableCustom(h)
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.