Merging BUG with other Mods

Is it possible to use BUG and Better Bug AI with Varietas Delectat as well as the addon civs for Varietas? I would just use BAT, but I want to use the addon civs like Poland, Hungary and Italy. Thanks for any ideas.
 
Without BUG (which does all the INI option handling), BULL cannot read options from INI files. This is what GlobalDefinesAlt.xml is for. Thus, BULLAI doesn't need a UserSettings folder at all if it doesn't include BUG.

RevDCM does include BUG, so the above doesn't apply. BUG will read the BULL options just as it reads its own options because they are all BUG options. BUG just gives BULL access to them via BugDll via CvAppInterface. BULL options are not special. BULL could access any option in BUG.

The main problem here is that BugDll.isBug() is not being exported to CvAppInterface. When BULL finds that function missing, it doesn't ask BUG for the option values.
 
I definitely do not have the BUG Mod installed, and my mod correctly reads and writes ini files in its root folder (...)\Beyond the Sword\Mods\Better BUG AI\
Which is where my installer will put UserSettings unless it detects Vista\win7. If it detects win 6.x, it will put UserSettings to $Documents/My Games/$BtS/BUG Mod - unless there is already a UserSettings folder at that location. And I was hoping that'd work..
When I installed Better BUG AI, using the installer I downloaded from Sourceforge, the BULL options could not be changed. Further, the option "Train Military Units Forever" was on, even though the option said it was off. This is exactly the same behavior I'm experiencing with RevDCM, exactly. And I did nothing to alter your mod, I just installed it, and clicked on the desktop shortcut it created.
 
Without BUG (which does all the INI option handling), BULL cannot read options from INI files. This is what GlobalDefinesAlt.xml is for. Thus, BULLAI doesn't need a UserSettings folder at all if it doesn't include BUG.

RevDCM does include BUG, so the above doesn't apply. BUG will read the BULL options just as it reads its own options because they are all BUG options. BUG just gives BULL access to them via BugDll via CvAppInterface. BULL options are not special. BULL could access any option in BUG.

The main problem here is that BugDll.isBug() is not being exported to CvAppInterface. When BULL finds that function missing, it doesn't ask BUG for the option values.
Better BUG AI and RevDCM are nearly identical. I don't understand what you're saying here. Basically they are both built around a BUG core. RevDCM just adds some more functions to the dll to deal with Revolutions, and also adds a Revolutions and RevDCM module for BUG to load (both of which are loading and working, and storing their values in the ini files fine!).

I'm getting the same behavior from both Better Bug AI and RevDCM. The regular BUG options can be changed, but the BULL options are locked.

Edit: Here are the logs for Better BUG AI, I'm willing to be they show exactly the same error as RevDCM is getting. And again, Better BUG AI was installed and played with no alterations, it is installed exactly how the installer does it (I just kept clicking yes), and BUG options can be changed, just BULL options are locked.
 
your Better BUG AI bull.log:
[83387.156] info - call to isBug() failed; BUG not present
mine:
[343584.906] info - BUG is present
which explains the behaviour. I just don't understand why this is happening.
 
OK, so I downloaded the BUG mod, installed it as a mod (multiplayer option). Then downloaded the BULL zip file (there is no BULL installer), and followed the readme instructions (cut and paste the Assets folder that is extracted from the zip into the BUG mod folder). Following these steps resulted in the exact same behavior; BUG options respond, BULL options do not. This is with straight up BUG and BULL available in the main download thread here.
 
Do you have anything in your CustomAssets folder? Do you have the original, unmodified assets in BTS/Assets? What O/S are you running? Running as admin? Anything else abnormal?
 
Windows XP, custom assets is clean. XP doesn't care about admin rights, never had any issues with other programs, and nothing abnormal. I also didn't check this because it was a problem I was noticing; this is a bug that has been reported by multiple users. I thought it was problem with the merging, but it is definitely intrinsic to some recent update, something broke in between BUG 4.2 & 4.3 (actually it could have been broken earlier, since RevDCM was using the prerelease BULL stuff before updating to 4.3).
 
What's most perplexing about this is that it happens for you for the PLE options. BULL I can understand because isBug() isn't being exposed so it doesn't check the options in BUG at all. But BUG doesn't use that. And it can't be all exported functions that don't work because then BUG wouldn't even initialize. And it says it is exporting that function, so I'm totally confused.

I'll have a chance to dig into it later tonight (maybe) but definitely tomorrow.
 
Thanks for taking a look at this. I'm surprised more people haven't reported this directly. But I don't think there are that many people who install BUG as a mod along with BULL (probably aren't that many people who install BULL period, it's pretty confusing). If BUFFY is using a recent version of BULL, I bet we could find a few HOF players who this is happening to if you want to increase the sample pool size. I don't think it's uncommon though, based on reports in RevDCM I'd say this is effecting half of the players, if not all of them that don't have the BUG mod installed in custom assets.
 
On an unrelated note I've been trying to track the cause of an Assert in RevDCM, and the debugger shows it's being caused by isHasMet, which is being called by Python (which unfortunately makes it impossible to track, as it just goes into Assembler code). The assert is caused by iTeam being out of bounds (-1). Most likely this is being caused by the BUG mod, as RevDCM hasn't added much python that would be making a new call to isHasMet in CyTeam recently. So if you have any ideas of anywhere new an isHasMet call has been added since BUG 4.2 where it could be passing in NO_TEAM, please let me know.
 
You could throw an exception in C++ when that happens so it gets caught by Python, and then you'd see the Python stack trace. I haven't used exceptions in C++ before, but I believe you can do this in CyTeam::isHasMet():

Code:
bool CyTeam::isHasMet(int iTeam)
{
    if (iTeam == -1)
    {
        throw exception;
    }
    ...
}

I put it in CyTeam so it doesn't get triggered by any SDK calls to CvTeam::isHasMet(). Let me know if you try this because if you don't I eventually will, but I'm going to work on the other problem first.
 
Test #1

0. Leave existing CustomAssets and UserSettings in BTS folder.
1. Install BUG Mod 4.3 as a mod.
2. Install BULL into same folder.
3. Start new game and change ACO options.

Result: Works fine.

Test #2

1. Remove CustomAssets folder.

Result: Works fine.

Test #3

1. Remove UserSettings folder.

Result: Works fine.

However

I have been changing the various ACO options. On a whim I tried flipping the master ACO Enabled switch . . . and it only turns off.

1. You can turn it off but not back on.
2. BUG doesn't log that it gets turned off but it does log all the other options.
3. It doesn't get written to the iNI file.
4. BULL sees that it's off.

AFAICT this boolean option is no different from the hundred other boolean options. There are no exceptions raised--it's simply broken. I'll keep digging, but I wonder is this what you're talking about? Do all other ACO options work? The error about isBug() not being there is very real for you, and that will force BULL to rely on the XML file, so I don't think this is the same problem.
 
Okay, I fixed the problem with ACO's Enabled option. Turns out there were two bugs hitting that one options:

1. <option>s that had no key were turned into Unsaved options instead of defaulting the key to their id. Fixed.
2. Unsaved options were not converting the checkbox value (0, 1) to a boolean value (True, False) so they could only be turned off. Fixed.

And of course these problems have nothing to do with the problem you're seeing in BULL. :( I need to figure out why your BULL is not seeing isBug(), but I cannot reproduce the problem here. Can you try this next time:

1. Launch LoR
2. Open Python console (~)
3. Enter these commands:
Code:
import CvAppInterface as app
print app.isBug
print app.getOptionBOOL
 
Invalid Sytax is all I get when typing those commands in the console

Also no reason to use LoR, I get this error with just the regular old BUG mod with the BULL dll installed in the BUG mod folder.

I will try the throwing an exception command with python for the isHasMet function, hope that works.
 
Invalid Sytax is all I get when typing those commands in the console

You get that for the import command? Are you using the correct console (SHIFT + `)? Does it say Python console?
 
You get that for the import command? Are you using the correct console (SHIFT + `)? Does it say Python console?

No, I was not. Using shift worked. Nothing was printed, just a bunch of hex values in the console itself, here are the logs:

Also trying the code you posted to get python to throw an exception results in this compiling error (too bad too, that was an ingenious way to track the problem):
Code:
1>CyTeam.cpp
1>CyTeam.cpp(667) : error C2275: 'exception' : illegal use of this type as an expression
1>        C:\Program Files\Microsoft Visual C++ Toolkit 2003\include\exception(39) : see declaration of 'exception'
 
Perhaps

Code:
throw new exception();

That looks more like what I would expect, but the page I linked had what I posted.

I'm looking at the logs now . . . I don't see where you typed those commands in the console. Are you sure those are the correct logs? It looks like you hit end turn because I see culture growth events.
 
That compiles. Now to see if it works in actual testing.
 
Sorry, did not realize you needed the logs right afterwards, I went a couple turns forward to see if those commands fixed things, which they did not. Here are the logs from right after typing those commands in the console:


Edit: As for the second debugging part about isHas met (this is with RevDCM but Civ4lerts is unaltered from BUG so it should relate fine), here is the exception that code is throwing:

"Unidentified C++ Exception"
"File "Civ4lerts", line 950, check"
"File "Civ4lerts", line 904, in OnBeginActivePlayerTurn"
"File "BugEventManager", line 361, in handle_DefaultEvent"
"Traceback (most recent callback)"

I'll look at civ4lerts.py now and see if anything isn't self aparent, figured you'd want to know.
 
Back
Top Bottom