• Welcome to Freedom Reborn Archive.
 

FFX / M25 AI Help Request

Started by rmt, October 08, 2007, 06:15:02 PM

Previous topic - Next topic

rmt

OK, I'm probably doing something hideously stupid, but I can't figure this out and it's driving me crazy.

I am using FF 1.2 and this is for a mod, not danger room.

I have done a complete clean install in the default directory in this order:

FF
Patch
EZ FX
FFX 2.6 Gold

I'm under the impression M25 AI is built into FFX now, right?  I am playing the Redeemers against the Squadron Supreme.  I gave Whizzer a speeding bullet attack and using Alex's EZ AI tool, added it as an M25 tactic with 100%, but Whizzer has never used it.  Honestly I'm not even sure the M25 AI is working at all.

I am getting a ton of errors in my script log, most of which are:


Traceback (innermost last):
  File ".\Data\Missions\Scripts\ffx.py", line 368, in parseLogFile
    m252.InitScripts()
  File ".\Data\Missions\Scripts\m252.py", line 61, in InitScripts
    NextStage()
  File ".\Data\Missions\Scripts\m25script2.py", line 28, in NextStage
    m252.SetupScripts()
  File ".\Data\Missions\Scripts\m252.py", line 78, in SetupScripts
    SetupOneChar(c)
  File ".\Data\Missions\Scripts\m252.py", line 84, in SetupOneChar
    SetupTeam(c)
  File ".\Data\Missions\Scripts\m25script2.py", line 37, in SetupTeam
    if isHero(char) or isCop(char):
NameError: isHero
Traceback (innermost last):
  File ".\Data\Missions\Scripts\ffx.py", line 11296, in FFQ_initialiseExtras
    FFQ_toConsole(text)
  File ".\Data\Missions\Scripts\ffx.py", line 15412, in FFQ_toConsole
    if FFQ_VERBOSE:
NameError: FFQ_VERBOSE


or

Traceback (innermost last):
  File ".\Data\Missions\Scripts\ffx.py", line 718, in initAttribsEvent
    initAttribsForChar(event.object,event.user)
  File ".\Data\Missions\Scripts\ffx.py", line 714, in initAttribsForChar
    m252.SetupOneChar(char)
  File ".\Data\Missions\Scripts\m252.py", line 84, in SetupOneChar
    SetupTeam(c)
  File ".\Data\Missions\Scripts\m25script2.py", line 37, in SetupTeam
    if isHero(char) or isCop(char):
NameError: isHero
Traceback (innermost last):
  File ".\Data\Missions\Scripts\ffx.py", line 718, in initAttribsEvent
    initAttribsForChar(event.object,event.user)
  File ".\Data\Missions\Scripts\ffx.py", line 714, in initAttribsForChar
    m252.SetupOneChar(char)
  File ".\Data\Missions\Scripts\m252.py", line 84, in SetupOneChar
    SetupTeam(c)
  File ".\Data\Missions\Scripts\m25script2.py", line 37, in SetupTeam
    if isHero(char) or isCop(char):
NameError: isHero
Traceback (innermost last):
  File ".\Data\Missions\Scripts\ffx.py", line 718, in initAttribsEvent
    initAttribsForChar(event.object,event.user)
  File ".\Data\Missions\Scripts\ffx.py", line 714, in initAttribsForChar
    m252.SetupOneChar(char)
  File ".\Data\Missions\Scripts\m252.py", line 84, in SetupOneChar
    SetupTeam(c)
  File ".\Data\Missions\Scripts\m25script2.py", line 37, in SetupTeam
    if isHero(char) or isCop(char):
NameError: isHero

Feels like maybe there's something I should turn off from skirmish mode where I don't need 4-5 teams or something.

What I am playing is 1 hero, 7 allies (COP class) and 8 villains (VILLIAN class)

Is there a particular default AI required to make speeding bullet attacks (like how you have to use Microwave to teleport if I recall correctly)?  Are the errors above "normal" or indicative I've done something wrong?  Help!!   And thanks!

:cool:

Epimethee

The FFQ_VERBOSE error: apparently the global variable disappeared before releasing 2.6, sorry... :( (This functionwas removed in FFX 3.0, since there was better code doing the same.

This can be solved by adding among the other global variables at the begining of the ffx.py file the following:
FFQ_VERBOSE =1

The isHero() error:
It looks like your data\missions\scripts\cshelper.py file (a file modified by FFX, IIRC) is missing. Maybe. If it is indeed the case, you may try installing FFX to a temporary folder and copy its cshelper.py.

rmt

Thank you for such a speedy response.

I had installed clean again, this time skipping FFX and putting the original version of M25's AI in place.

I received no script errors, but still no speeding bullet.  Makes me think I'm doing something wrong even without the FFX errors.

I had backed up my original install.  I'm going to see if I can restore it and will then start fixing the bugs per your advice above.  But not sure it will get me where I need to be if I've done something more basic wrong, which the above experiment would seem to indicate.

:banghead:

I have now removed the FFQ error with your help (thanks!).

I did not have a cshelper.py in my ffx mod folder.  I do have one in data/missions/scripts which I have copied over to the mod/mission/scripts folder even though I believe it was likely drawing from the data version when it didn't find one of its own.  Still getting those isHero errors.


Example:

Traceback (innermost last):
  File ".\Data\Missions\Scripts\ffx.py", line 720, in initAttribsEvent
    initAttribsForChar(event.object,event.user)
  File ".\Data\Missions\Scripts\ffx.py", line 716, in initAttribsForChar
    m252.SetupOneChar(char)
  File ".\Data\Missions\Scripts\m252.py", line 84, in SetupOneChar
    SetupTeam(c)
  File ".\Data\Missions\Scripts\m25script2.py", line 37, in SetupTeam
    if isHero(char) or isCop(char):
NameError: isHero


I get a lot of them in a row, during my cutscene (which just looks at the heroes then calls war).  I count 16, which seems to be one per character.


Epimethee

Quote from: rmt on October 08, 2007, 07:45:09 PMI had installed clean again, this time skipping FFX and putting the original version of M25's AI in place.
Note (just in case) that in FF1, FFX is installed to \data; as such, it is automatically set for every mod (not a good thing in retrospect, but hindsight is 20/20).

As such I don't think using the older pre-FFX 2.2 version of M25's AI is very safe.

QuoteI did not have a cshelper.py in my ffx mod folder.  I do have one in data/missions/scripts which I have copied over to the mod/mission/scripts folder even though I believe it was likely drawing from the data version when it didn't find one of its own.Still getting those isHero errors.
Indeed. Sorry for not being clear on this: the cshelper.py should go in your data folder. IIn fact, there's a bug in FF (we've only found a workaround in FFX 3.2) which means that a mod's cshelper.py won't be read, only the version in \data.

So the file itself is not missing. Interesting. Maybe there's a missing
from cshelper import *
in \data\missions\scripts\m252.py?

Otherwise, is the isHero() function defined in \data\missions\scripts\cshelper.py?

No further idea for the moment... it's getting late and it's been years since I've touched FF1.  :mellow:




M25

You have a namespace error.  Normally I'd say to reinstall, but you've already tried that.

Try adding

import cshelper
from cshelper import *

to the top of m25script2.py


If that doesn't work, change isHero(  to cshelper.isHero(


rmt

Thanks, will give this a go as soon as possible.  Got distracted with some family drama as my father ended up in the hospital suddenly and unexpectedly.

Epimethee

Ouch. I wish him a prompt and full recovery.

GGiant

Quote from: rmt on October 10, 2007, 07:05:38 PM
Thanks, will give this a go as soon as possible.  Got distracted with some family drama as my father ended up in the hospital suddenly and unexpectedly.
I wish your father heals.
Anyways, have you tried installing the patch first before ffx?
If you did then I'm dumb!

rmt

My father is better, thanks.  He had surgery Friday and should get out of the hospital soon (Wednesday or Thursday).

I worked on the mod today as I was off work.  COuldn't get cshelper to import so I used the prefix method (liberally) and seem to have stamped out the errors.  Thanks for the help.  I haven't tested any custom AI, but villains are using the ffx commands like summon storm, so I think it's likely working.  If not, I will post back.

Thanks guys!