News:

Rings of Reznor!

Main Menu

FFX in mods question

Started by abenavides, April 28, 2020, 03:42:53 PM

Previous topic - Next topic

abenavides

Hey, glad to see this place is still around!
Dusted off my FF games recently and installed to tinker a bit.
Had a question and hope someone can answer.

I'm updating a mod to use FFX. Started with the FFX3 folder, copied it and added stuff to DATS and artwork.
One character who is using SUMMONER attrib works perfectly well in Rumble Room but not in my mission.

I assumed it's because I have add "from ffx import * " and/or "import ffx" at top of my mission.py file. Tried it but still no luck.
I do have a "SetMission(1)" in my mission script as well.

Everything is working fine except this 1 character isn't getting the FFX attribs I want? What step am I missing?

(p.s. I have run the control centre on the mod folder. Like I said, the same character works fine in rumble room)
www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.

spydermann93

Welcome back, Alex! Hope you're doing well!

I'm not 100% familiar with how missions work, but if you're using "import ffx" (that's what you want to use), make sure that you have "ffx." in front of any ffx functions you call.

Like, say you're using "FFX_ObjectSetAttr(char,'attribute',0)"

in your file, you'll have to use "ffx.FFX_ObjectSetAttr(char,'attribute',0)"

abenavides

Hey spydermann93, good to hear from you.

Thanks for the advice. I'm not calling any ffx functions myself. (maybe I will in a future mission).
Right now, I just want the fancy FFX attribs I added to the character to show up and work.

They work flawlessly rumble room, so it must be something I need to do in my simple script.
The rest of the script works great, I just don't have any ffx goodness.
www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.

BentonGrey

Howdy Alex!

Hmm, this definitely sounds like some kind of breakdown in the script, but I don't know much about that side of things.  If it's working in RR but not in missions, it almost has to be that.  Does anything else FFX related work in that mission?

There are some attributes that don't work in campaign, but those aren't among them.  I've had a lot of trouble with FFX and complex IDs in the DCUG because I have several new civilian objects, which don't get branded by the editor, but if that were the case for you, he wouldn't be working in RR either.

My only advice would be to check out some FFX enabled mission scripts and just make sure you're not missing anything.  I glanced at Prev's PCT missions, and they look like this at the top:
Quotefrom cshelper import *
from js import *
from event import *
from m25ai import *
from ffx import *

You started with the latest edition of FFX?  (Silly question)
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out mymods and blog!
https://bentongrey.wordpress.com/

abenavides

yep, loaded FFv3R and FFX33 on a clean pc.

Then copied the ffx3 folder , and started making my changes on the copy.
Agree that it's got be my mod script as rumble room works fine.

my first few lines are:

from js import *
from cshelper import *
from event import *
from sound import *
from prestige import *

from ffx import *

don't have that m25 line, let me try that and see
www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.

abenavides

OK as a test, I just created a new test mission

this is the entire script:
# test2
from cshelper import *
from js import *
from event import *
from m25ai import *
from ffx import *

def OnPostInit():
   print 'TEST MISSION'
   setMission(1)

still no ffx attributes?
www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.

spydermann93

#6
Try add these (where applicable):

import m25minimod
from m25minimod import *


def OnPostInit():
m25minimod.OnPostInit(campaign=1)



or maybe you just need this in your OnPostInit()?

ffx.FFX_InitMission()

BentonGrey

Spyder, that last one might be it!  Prev's script had that too...
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out mymods and blog!
https://bentongrey.wordpress.com/

abenavides

I really thought you'd figured it out, but still no luck :(
is there a mod that uses ffx I could look through? (it would have to be one that doesn't use ez script)
or should I post my log file?
www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.

spydermann93

Try looking at the missions included in FFX3. They're just the base game's missions with FFX3 enabled.

I don't believe they use EZScript and I know FFX attributes work in that.

abenavides

Good idea. Will see what I can figure out.
www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.

abenavides

#11
Looked at a few campaign missions that are in the ffx3 folder, they all basically have that FFX_InitMission() command. So I think that's all that is required. I think I see something weird when I look at the logs, but not sure why there's a problem or how to fix.

This is the log when I take my GL out in the rumble room (everything works). I can see his ffx atrributes get activated in the log:

>>> system/init.py executed
>>> system/localinit.py executed
>>> system\tredir.py executed
loading datfiles version 0.256000
loading cshelper ...
Starting ffx.py v. 3.3.1 build 0; branch = main release update
Loading m25ai.py v. 3.3.0 build 3; branch = Gold v.3.3 with Patch
importing missionobjvar.py v1.20
importing MLOG Reader 1.0.23
Starting General Utilities 1.0.1
missionobjvar(FixLongs): Fixing overflow issue with <SCSTATE_BUOYANT>
missionobjvar defining functions for Campaign play.
Loading m25cutscene.py v.3.2.0 final; May 27, 2007
CustomHeadCurrentTime 1588113570.528000
Starting Height Check module 1.4
Starting System Utilities 1.5
OBJECTS_HEIGHT: 604 entries
NIF_OBJECTS: 482 entries
BUILDINGS_IN_OBJECTS_DAT: 30 entries
BUILDING_DIMENSIONS: 30 entries
Starting skXMapInfo.py  v 0.79 beta
skXMapInfo: m25ai available
Loading m25aiopt.py v.3.2.0 final; branch = swingman 4
FFX Mission Plugin 'firehydrant' imported
FFX Mission Plugin 'zombie' imported
Loading freeroam_keepbuildingdamage.py v.1.0.0 build 0; branch = main
FFX Mission Plugin 'freeroam_keepbuildingdamage' imported
FFX Mission Plugin 'm25ai_lowjumper' imported
FFX Mission Plugin 'm25ai_realitymanipulation' imported
FFX Mission Plugin 'cutscene_power' imported
Loading     m25enc_OPENDOOR.py v.1.0.0 build 0; branch = main
Loading m25enc.py v.3.2.0 July 27, 2008
FFX Mission Plugin 'm25enc_opendoor' imported
Loading     m25enc_simplechoice.py v.1.0.0 build 0; branch = main
FFX Mission Plugin 'm25enc_simplechoice' imported
Starting Built-In Function Wrapper 1.5
('Object_CalcPrestige', 'js')
sk: missionobjvar already loaded; resetting mission type to skirmish for mission and object vars
missionobjvar.SetFunctionsByMissionType: isCampaignMission=0, long variable cache has already been written to.
__MISSIONVARS = {'_event_freeroam_initmission': [['FreeroamKBD_StartMission', 0]], '_event_pstory_cutsceneline': [['CutscenePower_CheckPower', 1]], 'heightcheck_sampling_default': (1, 8), '_event_freeroam_exitmission': [['FreeroamKBD_EndMission', 0]]}
__OBJECTVARS = {}
missionobjvar defining functions for Rumble Room play.
jla\Missions\Scripts\sk.py importing FFX
jla\Missions\Scripts\sk.py loaded
>>> C:\Users\abena\AppData\Local\Irrational Games\Freedom Force vs the 3rd Reich\temp\battle.py executed
>>> C:\Users\abena\AppData\Local\Irrational Games\Freedom Force vs the 3rd Reich\temp\danger.py executed
>>> C:\Users\abena\AppData\Local\Irrational Games\Freedom Force vs the 3rd Reich\temp\battle.py executed
>>> OnReceiveSelectedEnemies(('alien_warrior', 'alien_warrior', 'alien_warrior', 'alien_warrior', ))
try to spawn alien_warrior
sk.SpawnEnemy: energy for _skalien_warrior01 (alien_warrior) changed from 4 to 4
try to spawn alien_warrior
sk.SpawnEnemy: energy for _skalien_warrior02 (alien_warrior) changed from 4 to 4
try to spawn alien_warrior
sk.SpawnEnemy: energy for _skalien_warrior03 (alien_warrior) changed from 4 to 4
try to spawn alien_warrior
sk.SpawnEnemy: energy for _skalien_warrior04 (alien_warrior) changed from 4 to 4
MLOG_Init(keepRunningModules=0): starting up
mlogreader.MLOG_Init: current mission = 'MP_CITY'
initialising FFX: skirmish=1
numberStr=48
storing hero_0: id_1,-48
! GetMapInfo
initialising FFQ_initialiseExtras()
FFX_UpdateSun: getting default sun
FFX_UpdateSun: setting = (-140.0, 70.0, 1.0, 0.800000011921, (0.699999988079, 0.600000023842, 0.600000023842))
addArrow _sk_arrow _skalien_warrior03 0 0
initAttribsForChar: working on _skalien_warrior03 (alien_warrior)
initAttribsForChar (alien_warrior): looking at attribute thin skinned
initAttribsForChar (alien_warrior): looking at attribute invertebrate
initAttribsForChar (alien_warrior): looking at attribute strange visitor
initAttribsForChar: working on _skalien_warrior04 (alien_warrior)
initAttribsForChar (alien_warrior): looking at attribute thin skinned
initAttribsForChar (alien_warrior): looking at attribute invertebrate
initAttribsForChar (alien_warrior): looking at attribute strange visitor
initAttribsForChar: working on _skalien_warrior02 (alien_warrior)
initAttribsForChar (alien_warrior): looking at attribute thin skinned
initAttribsForChar (alien_warrior): looking at attribute invertebrate
initAttribsForChar (alien_warrior): looking at attribute strange visitor
initAttribsForChar: working on _skalien_warrior01 (alien_warrior)
initAttribsForChar (alien_warrior): looking at attribute thin skinned
initAttribsForChar (alien_warrior): looking at attribute invertebrate
initAttribsForChar (alien_warrior): looking at attribute strange visitor
initAttribsForChar: working on hero_0 (glantern_kyle)
initAttribsForChar (glantern_kyle): looking at attribute fastflier
execInitAttrib: init fastflier attribute
    on hero_0 of template custom_template_48 (glantern_kyle)
initAttribsForChar (glantern_kyle): looking at attribute flier
initAttribsForChar (glantern_kyle): looking at attribute light speed
initAttribsForChar (glantern_kyle): looking at attribute plasmasculptor
execInitAttrib: init plasmasculptor attribute
    on hero_0 of template custom_template_48 (glantern_kyle)
initAttribsForChar (glantern_kyle): looking at attribute summoner3
execInitAttrib: init summoner3 attribute
    on hero_0 of template custom_template_48 (glantern_kyle)
Plugin 'firehydrant' OnPostInit() called
Plugin 'zombie' has no OnPostInit()
Plugin 'freeroam_keepbuildingdamage' OnPostInit() called
Plugin 'm25ai_lowjumper' has no OnPostInit()
Plugin 'm25ai_realitymanipulation' has no OnPostInit()
Plugin 'cutscene_power' has no OnPostInit()
Plugin 'm25enc_opendoor' has no OnPostInit()
Plugin 'm25enc_simplechoice' has no OnPostInit()
Traceback (innermost last):
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\ffx.py", line 9170, in OnMakeObjectA
    alignWith(name,char)
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\ffx.py", line 23214, in alignWith
    Object_SetOrientation(char,angle,(0,0,1))
SystemError: NULL result without error in call_object
Traceback (innermost last):
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\ffx.py", line 9170, in OnMakeObjectA
    alignWith(name,char)
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\ffx.py", line 23214, in alignWith
    Object_SetOrientation(char,angle,(0,0,1))
SystemError: NULL result without error in call_object
plasmatic: obj=mobjdummy_6 char=hero_0 cost=2
creationDestroy
hero_0
1.0
Campaign_MakeHeroIndex: Making index <c:\gog games\freedom force vs the 3rd reich\jla\HeroIndexData.txt>
---combos found
[]
-----------------
mobjdummy_8
['armoured', 'grim resolve', 'ponderous', 'solid skeleton', 'disciplined']
-----------------
mobjdummy_8
[]
plasmatic: obj=mobjdummy_8 char=hero_0 cost=1
initAttribsForChar: working on mobjdummy_8 (ffx_green_tank)
initAttribsForChar (ffx_green_tank): looking at attribute armoured
initAttribsForChar (ffx_green_tank): looking at attribute grim resolve
initAttribsForChar (ffx_green_tank): looking at attribute ponderous
initAttribsForChar (ffx_green_tank): looking at attribute solid skeleton
initAttribsForChar (ffx_green_tank): looking at attribute disciplined
---combos found
[]
-----------------
mobjdummy_10
['cybernetic brain']
-----------------
mobjdummy_10
[]
plasmatic: obj=mobjdummy_10 char=hero_0 cost=0
initAttribsForChar: working on mobjdummy_10 (ffx_green_mech_man)
initAttribsForChar (ffx_green_mech_man): looking at attribute cybernetic brain



To test missions - I made an entire new mission with just this code:

from cshelper import *
from js import *
from event import *
from ffx import *

def OnPostInit():
print 'test mission'
setMission(1)
ffx.FFX_InitMission()


This doesn't work , though I don't see why not. The log for this does show some error "IndexError: string index out of range" and never does the initattrib stuff. So that's what's ot working. Not sure why. I even added Alchemiss to this test mission, gave her summoner, and ran control centre - it doesn't work for her either.


>>> system/init.py executed
>>> system/localinit.py executed
>>> system\tredir.py executed
loading datfiles version 0.256000
loading cshelper ...
Starting ffx.py v. 3.3.1 build 0; branch = main release update
Loading m25ai.py v. 3.3.0 build 3; branch = Gold v.3.3 with Patch
importing missionobjvar.py v1.20
importing MLOG Reader 1.0.23
Starting General Utilities 1.0.1
missionobjvar(FixLongs): Fixing overflow issue with <SCSTATE_BUOYANT>
missionobjvar defining functions for Campaign play.
Loading m25cutscene.py v.3.2.0 final; May 27, 2007
CustomHeadCurrentTime 1588127016.277000
Starting Height Check module 1.4
Starting System Utilities 1.5
OBJECTS_HEIGHT: 604 entries
NIF_OBJECTS: 482 entries
BUILDINGS_IN_OBJECTS_DAT: 30 entries
BUILDING_DIMENSIONS: 30 entries
Starting skXMapInfo.py  v 0.79 beta
skXMapInfo: m25ai available
Loading m25aiopt.py v.3.2.0 final; branch = swingman 4
FFX Mission Plugin 'firehydrant' imported
FFX Mission Plugin 'zombie' imported
Loading freeroam_keepbuildingdamage.py v.1.0.0 build 0; branch = main
FFX Mission Plugin 'freeroam_keepbuildingdamage' imported
FFX Mission Plugin 'm25ai_lowjumper' imported
FFX Mission Plugin 'm25ai_realitymanipulation' imported
FFX Mission Plugin 'cutscene_power' imported
Loading     m25enc_OPENDOOR.py v.1.0.0 build 0; branch = main
Loading m25enc.py v.3.2.0 July 27, 2008
FFX Mission Plugin 'm25enc_opendoor' imported
Loading     m25enc_simplechoice.py v.1.0.0 build 0; branch = main
FFX Mission Plugin 'm25enc_simplechoice' imported
Starting Built-In Function Wrapper 1.5
('Object_CalcPrestige', 'js')
>>> C:\Users\abena\AppData\Local\Irrational Games\Freedom Force vs the 3rd Reich\temp\mission.py executed
test mission
MLOG_Init(keepRunningModules=0): starting up
mlogreader.MLOG_Init: current mission = 'M01'
initialising FFX: skirmish=0
storing glantern_kyle: id_1,68
storing alchemiss1: id_2,120
storing flash_wally: id_3,14
Traceback (innermost last):
  File "C:\Users\abena\AppData\Local\Irrational Games\Freedom Force vs the 3rd Reich\temp\mission.py", line 9, in OnPostInit
    ffx.FFX_InitMission()
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\ffx.py", line 258, in FFX_InitMission
    initialise(0)
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\ffx.py", line 403, in initialise
    FFX_Transformers = getBuiltinTransformers()
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\ffx.py", line 744, in getBuiltinTransformers
    for char in getAllCharacters(checkLiving = 1, lures = 0, specialCharacters = 0):
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\ffx.py", line 20512, in getAllCharacters
    specialChar = isSpecialChar(object)
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\ffx.py", line 20457, in isSpecialChar
    return FFX_GetTemplate(obj) in ('ffx_tiggot', 'ffx_tiggot1', '------------', '---Buddies---',) #please update as needed
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\ffx.py", line 937, in FFX_GetTemplate
    return chardata.GetCharacterData(char).get('charName')
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\chardata.py", line 301, in GetCharacterData
    _SavedData = Campaign_ReadCharactersFromSavedGame()
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\datfiles.py", line 1483, in Campaign_ReadCharactersFromSavedGame
    FileName = GetMostRecentSavedGameFile()
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\datfiles.py", line 2807, in GetMostRecentSavedGameFile
    missions = map(string.upper,Campaign_ReadCampaignDefinitions(os.path.join(ModPath,'campdef.dat'))['missions'])
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\datfiles.py", line 1437, in Campaign_ReadCampaignDefinitions
    _CampdefData[FileName]['totalMissions'] = ord(dat[4389])
IndexError: string index out of range
! GetMapInfo
initialising FFQ_initialiseExtras()
FFX_UpdateSun: getting default sun
FFX_UpdateSun: setting = (-45.0, 45.0, 1.0, 0.800000011921, (1.0, 1.0, 1.0))
Character_HasAttribute: error checking 'evilcop09' (duplicate_cop) for tempform
Character_HasAttribute: error checking 'evilcop09' (duplicate_cop) for involuntaryform
Character_HasAttribute: error checking 'evilcop09' (duplicate_cop) for ffqamalgam
Traceback (innermost last):
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\ffx.py", line 658, in initAttribs
    object=initialiseChar(object)
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\ffx.py", line 788, in initialiseChar
    t=FFX_GetTemplate(char)
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\ffx.py", line 937, in FFX_GetTemplate
    return chardata.GetCharacterData(char).get('charName')
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\chardata.py", line 301, in GetCharacterData
    _SavedData = Campaign_ReadCharactersFromSavedGame()
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\datfiles.py", line 1483, in Campaign_ReadCharactersFromSavedGame
    FileName = GetMostRecentSavedGameFile()
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\datfiles.py", line 2807, in GetMostRecentSavedGameFile
    missions = map(string.upper,Campaign_ReadCampaignDefinitions(os.path.join(ModPath,'campdef.dat'))['missions'])
KeyError: missions
Plugin 'firehydrant' OnPostInit() called
Traceback (innermost last):
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\ffx.py", line 21734, in OnPseudoOnPostInitGo
    exec OnPostInit
  File "<string>", line 1, in ?
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\ffx3\missions\scripts\ffxplugins\active\ffq_zombie\zombie.py", line 65, in OnPostInit
    for char in ffx.getAllCharacters(): #register existing characters
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\ffx.py", line 20512, in getAllCharacters
    specialChar = isSpecialChar(object)
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\ffx.py", line 20457, in isSpecialChar
    return FFX_GetTemplate(obj) in ('ffx_tiggot', 'ffx_tiggot1', '------------', '---Buddies---',) #please update as needed
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\ffx.py", line 937, in FFX_GetTemplate
    return chardata.GetCharacterData(char).get('charName')
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\chardata.py", line 301, in GetCharacterData
    _SavedData = Campaign_ReadCharactersFromSavedGame()
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\datfiles.py", line 1483, in Campaign_ReadCharactersFromSavedGame
    FileName = GetMostRecentSavedGameFile()
  File "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\datfiles.py", line 2807, in GetMostRecentSavedGameFile
    missions = map(string.upper,Campaign_ReadCampaignDefinitions(os.path.join(ModPath,'campdef.dat'))['missions'])
KeyError: missions
Plugin 'freeroam_keepbuildingdamage' OnPostInit() called
Plugin 'm25ai_lowjumper' has no OnPostInit()
Plugin 'm25ai_realitymanipulation' has no OnPostInit()
Plugin 'cutscene_power' has no OnPostInit()
Plugin 'm25enc_opendoor' has no OnPostInit()
Plugin 'm25enc_simplechoice' has no OnPostInit()


www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.

BentonGrey

Hmm, weird! 

Given positioning, I'd assume it's this:
QuoteFile "C:\GOG Games\Freedom Force vs the 3rd Reich\.\ffx3\missions\scripts\datfiles.py", line 1437, in Campaign_ReadCampaignDefinitions
    _CampdefData[FileName]['totalMissions'] = ord(dat[4389])
IndexError: string index out of range

So, just a wild guess based on that section of the code and my own deep, deep ignorance, but I wonder if there's something in your campaign, specifically whatever is stored in campdef, that might be causing it to choke.  Specifically, it might be something about mission names or numbers.  I have had FF do weird stuff because of mission names before, but it's usually more like crashing or having the campaign not work.  Post a screenie of your campaign tab, and maybe I can spot something weird?

Here's the pertinent part of the datfiles.py script:
Quote# Read a campdef.dat file and return a dictionary with the data for each
# mission, which is the list of mission names, and for each mission whether
# the mission is a submission, the number of allowable characters, the
# list of required characters, and the list of disallowed characters.
def Campaign_ReadCampaignDefinitions(FileName='',ForceRead=0,verbose=0):
    global _CampdefData
    if FileName=='': # try to guess the current DAT file
        FileName = GetDatFile('campdef.dat')
    FileName = os.path.abspath(FileName)
    if ( not ForceRead ) and ( '_CampdefData' in globals().keys() ) and ( FileName in _CampdefData.keys() ):
        return _CampdefData[FileName].copy()
    if not ( '_CampdefData' in globals().keys() ):      # entirely new dictionary
        _CampdefData = {}
    _CampdefData[FileName] = {}
    try:
        f = open(FileName,'rb')
        dat = f.read()
        f.close()
    except:
        print 'Campaign_ReadCampaignDefinitions: unable to read data from %s' % FileName
        return _CampdefData[FileName]
    datlen = len(dat)
    _CampdefData[FileName]['totalMissions'] = ord(dat[4389])
    pos = 4393
    missions = []
    while ( len(missions) < _CampdefData[FileName]['totalMissions'] ):
        missionName = string.split(dat[pos:],'\x00',1)[0]
        #print 'Campaign_ReadCampaignDefinitions: pos=%5d len(missions)=%d read missionName=<%s>' % (pos,len(missions),missionName)
        if missionName: # check shouldn't be needed
            missions.append(missionName)
            _CampdefData[FileName][missionName] = {}
            _CampdefData[FileName][missionName]['missionName'] = missionName
            _CampdefData[FileName][missionName]['isSubmission'] = ord(dat[pos+30])
            num = ord(dat[pos+36])
            _CampdefData[FileName][missionName]['numAllowed'] = num
            required = []
            for i in range(num):
                char = string.split(dat[pos+40+i*30:],'\x00',1)[0]
                if char:
                    required.append(char)
            _CampdefData[FileName][missionName]['required'] = required
            disallowed = []
            for i in range(10):
                char = string.split(dat[pos+160+i*30:],'\x00',1)[0]
                if char:
                    disallowed.append(char)
            _CampdefData[FileName][missionName]['disallowed'] = disallowed
        pos = pos + 460
    _CampdefData[FileName]['missions'] = missions
    return _CampdefData[FileName].copy()
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out mymods and blog!
https://bentongrey.wordpress.com/

abenavides

I think you're right - here's my camdef setup (I added all 3 of these missions while testing)



I was looking through the datfiles code too - line cited as a problem is "    _CampdefData[FileName]['totalMissions'] = ord(dat[4389])"
www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.

abenavides

Used a hex editor look at the campdef , position 4389 and value stored there is 3. makes sense since I have 3 missions and that is what the code seems to be trying to get.
www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.

GogglesPizanno

I haven't done anything with this stuff in forever, but did you run through the steps in the documentation (start with the easy):
http://www.ffx.freedomforceforever.com/manual.htm


  • Copy in ALL the mission/script files from data => mod folder
  • Copy the Skirmish folder and run the power ID generator rumble room mission to generate ID's *This seems like it might be a winner
  • Run the control Center on the correct mod folder
  • Merge DAT files from FFX into your mod files
  • Generate Strings
  • Call SetMission()

abenavides

Hey GP, I've done everything on the list except the Power IDs.

Will give it a try.
Strange that the attribs work in rumble room but not campaign mission? But I'll give it a shot. Thx
www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.

abenavides

Ran the powerIds thing in rumble room, but still no luck  :(

Hoping someone has an idea .

Otherwise I may have to uninstall and install everything (again) and start over
www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.

BentonGrey

Goggles!  Hey man, great to see you again!  I am constantly using your mappack.  :D

Alex, I always leave all of the vanilla missions in the campaign, just after my own.  I have a vague memory of having started that habit because of some weirdness with campaign mission numbers.  Try that.
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out mymods and blog!
https://bentongrey.wordpress.com/

abenavides

Thx Benton, I'll give it a try.
Appreciate all the help guys.

Do have a release (other than this mod) soon.
www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.

abenavides

Finally some light at the end of this tunnel.

I ended up having to totally rebuild my PC (I am constantly doing dev stuff that messes it up every few months anyway  :D )

All I have installed right now is FFv3R , Mod tools, and FFX3.
I copied Alchemiss in FFEDIT and gave her summoner.
Ran Control centre and made a new mission (map and script from scratch)

# Missions

from cshelper import *
from js import *
import event
from ffx import *

def OnPostInit():
setMission(1)
FFX_InitMission()


added it to top of Mission list (haven't removed any)
and it works !

Rumble room works also (but that was working last time too)

I'm going to slowly start adding my mod stuff to this folder and hopefully it will keep working.

New question: not critical but I'm curious . For my new mission (created by pressing create in FFEDIT and choosing a layout - I get an eeror message when running:
"Alert: Mission contained no extents info"

I just click Ok and everything still works fine (it's using defaults).
How can I avoid this message. Haven't seen it before. (that is , how do I get extents info where this mission can see it?)

www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.

spydermann93

Woohoo!!

Glad you got it fixed!

Afraid I don't know what the other error you got means, though.

abenavides

BTW I've explored my original problem a bit more and it definitely happens once I remove the other missions from the campdef.dat file. I've managed to keep it working if I have 1 other mission in there plus my own. Might be a bug in the FFX3 code that assumes you will always have multiple missions (which you would really).

www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.

BentonGrey

Alex, great news!  I thought that might be it.  Yeah.  Ha, sorry I didn't think of that earlier.  These days half of what I do is ritual for which I have forgotten the purpose!

As for your error message, I'm guessing it's about the mission map missing the extents file.  If you find the appropriate file for your map and put it in the appropriate level layout directory, that SHOULD do the trick.
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out mymods and blog!
https://bentongrey.wordpress.com/

abenavides

Thx Benton. I knew it was related to the extents file, just had no idea where to put it.
I'll try in the same folder as the mission
www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.

BentonGrey

That may work, Alex.  I've got at least one mission folder in the DCUG that has an extents file in it.  I think they really belong in the level layout folder, though.  What's the base map?
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out mymods and blog!
https://bentongrey.wordpress.com/

abenavides

base map was one of the berlin ones. probably the first one (5a)
www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.

BentonGrey

Interesting.  I'd recommend copying over the level_layouts from your data directory.  That might take care of it.
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out mymods and blog!
https://bentongrey.wordpress.com/