[GS] CityBannerManager.lua

Arstahd

Chieftain
Joined
Apr 20, 2006
Messages
85
I've made a small edit to the file that handles city banners and had no problems under Vanilla. My trouble came with the expansions. Each has their own iteration of CityBannerManager.lua that the game chooses to run when that particular ruleset is being used. If I edit the files directly, I can get it to work, but I an unable to make it function as a mod.

No matter what I tried, the mod would only update the Vanilla version of the file. Is there a way to update an expansion file? Ideally the mod would be able to update all three files, but I'd settle for just being able to update the GS version.
 
After some more experimenting, I've determined that the game is overwriting my updated LUA when I play a GS game. If I delete the CityBannerManager.lua from the expansion2 folder, my mod works, my custom LUA is loaded when I play a GS game.

My original mod was made before I owned the expansions. The modinfo just listed my modified lua and imported it as an InGameAction. Didn't even specify a loadorder. It worked fine. When I Upgraded to R&F/GS, the mod continued to work when I used standard rules, but not while playing by expansion rules. It would seem that the expansion versions of the LUA were overwriting my file. They are loading after my mod loads.

Trying to get this to work, I've refined my original mod. It now has both a vanilla version and GS version of the LUA and I've set criteria so that each only gets loaded when that version of the game is being run. I tried messing with Loadorder, setting it high to 12000, setting low to -100, with no effect.

What is causing the expansion files to load after my mod? Here is my current modinfo file.

Code:
    <ActionCriteria>
        <Criteria id="Vanilla">
            <GameCoreInUse>Base</GameCoreInUse>
        </Criteria>
        <Criteria id="GatheringStorm">
            <GameCoreInUse>Expansion2</GameCoreInUse>
        </Criteria>
    </ActionCriteria>


    <InGameActions>
        <Properties>
            <LoadOrder>12010</LoadOrder>
        </Properties>
        <ImportFiles id="CityBanner_Vanilla" criteria="Base">
            <File>Base/CityBannerManager.lua</File>
        </ImportFiles>
        <ImportFiles id="CityBanner_GatheringStorm" criteria="Expansion2">
            <File>Exp2/CityBannerManager.lua</File>
        </ImportFiles>
    </InGameActions>


    <Files>
        <File>Base/CityBannerManager.lua</File>
        <File>Exp2/CityBannerManager.lua</File>
    </Files>


</Mod>
 
Your LoadOrder method is incorrect. LoadOrder is part of an individual action, not part of the overall InGameActions
Code:
    <InGameActions>
        <ImportFiles id="CityBanner_Vanilla" criteria="Base">
             <Properties>
                 <LoadOrder>12010</LoadOrder>
             </Properties>
            <File>Base/CityBannerManager.lua</File>
        </ImportFiles>
        <ImportFiles id="CityBanner_GatheringStorm" criteria="Expansion2">
             <Properties>
                 <LoadOrder>12010</LoadOrder>
             </Properties>
            <File>Exp2/CityBannerManager.lua</File>
        </ImportFiles>
    </InGameActions>
 
Now I feel stupid. That was it. I went through 7 other mods where I used LoadOrder and each of them had it implemented correctly. I botched it when adding it to this one. Well, at least this fiasco taught me how to use Criteria properly.

Thank you LeeS.
 
Back
Top Bottom