Combining Better BUG AI and BAT

Public maps: What really puzzles me about the error is that some python code is looking for these files, which it can only do if it knows that these files exist, which it should only know when it actually sees these files, but how can it still fail to find them afterwards?
Copy the PublicMap folder to both BUG and BAT, and then, just to be sure, copy the files from that folder to the PublicMaps folder of the actual Beyond the Sword game install. If it can't find the files then, it just isn't looking.
edit: ok, phungus knows. Well it's not gamebreaking anyway.

I probably should be more clear on exactly what is happening.

If I run Better BUG AI mod by itself, it works perfectly. If I run BAT mod by itself, it runs perfectly. By running perfectly, I mean I do not get the errors presented in the OP, AND I am able to use the PLE widgets just fine (or turn them off at my pleasure).

However, when I combine the two mods, I get the errors stated in the OP. I do know about turning the widgets on and off. I checked to make sure I had them turned on. They are. Frankly, I don't care about the PLE icons. I don't like them anyway.
That's still a bug I can't reproduce on my install then, if these buttons are gone and can't be turned on. Very strange.

However . . .

The error with diplomacy is obviously not good (and is unplayable).

I first noticed the error when the AI initiated contact (upon first contact). I also tested it by initiating contact myself. The same thing happens.
Diplomacy: I have one single idea for this: DELETE the complete Python folder from \BAT 2.1\Assets\, then copy my files there.



Also, I notice that the BAT mod install sets up a BAT folder in the MODS folder of My Games\BTS and also sets up a BUG mod folder in the main BTS directory of My Games. The BUG mod folder contains the following folders: Info, UserSettings, and Autolog. Could there be some conflict here?
Definitely, there could be some root of the problem for the PublicMaps files failing to load, it should not affect anything else though, as the Assets are all in the BAT folder.

If all fails:
  1. Uninstall/completely remove BAT (that includes that dummy BUG mod folder)
  2. Reinstall it without the "share options with BUG Mod" option
  3. Apply the 2.1.1 Patch
  4. Delete Python folder from BAT
  5. Delete your usersettings (only the .ini files in it, not the folders), just to be sure
  6. Copy everything from my mod to the BAT mod folder, except for Usersettings and Info, those are not needed
  7. Post me the errors you get, if any
 
The error is caused by the fact BtS sets the last use map script in the Civ4 config file. You switch to a different mod, or play default BtS after using a map in a mod's private or public maps folder, the engine can't locate this referenced script in it's config. The way I've figured to get around it is to install the public maps into the user's custom maps directory, should solve the problem.
 
The error is caused by the fact BtS sets the last use map script in the Civ4 config file. You switch to a different mod, or play default BtS after using a map in a mod's private or public maps folder, the engine can't locate this referenced script in it's config. The way I've figured to get around it is to install the public maps into the user's custom maps directory, should solve the problem.

Interestingly enough, I had suspected this could be a problem, so I had already installed Fuyu's Public Maps into My Games\BTS folder. I assume this is where you mean, Phungus. Otherwise, please direct me to where you mean by "user's custom maps directory."

Thanks. :)
 
Sorry, I just saw this thread just now. First, BAT can live in either My Games or BTS folder. If running WinXP or Win7 you may need to run BTS as Administrator.

Now as for copying the assets over . . . Fuyu: is your current merge using the latest from SVN? I removed several modules from Python/EntryPoints, but copying over the new merge into BAT won't remove those files. :(

Go to Assets/Python/EntryPoints and remove these files:

  • CvAppInterface.py
  • CvDiplomacyInterface.py
  • CvOptionsScreenCallbackInterface.py
  • CvRandomEventInterface.py
Move them to a folder outside of the BAT Mod folder for safe keeping and see if that fixes the problem.

As for having a merged version of Better BUG AI with BAT, that would be great. :) Maybe Fuyu and Lemon Merchant can figure out a way to integrate it as an option. Correct me if I'm wrong, Fuyu, but all that would be needed is a second DLL as an option during install, correct?
 
No, Better BTS AI has an AIAutoPlay.py, Tester.py and ChangePlayer.py in Python\Contrib and they are being loaded from BetterAI.xml, which is called from init.xml. No clue if they are actually needed for autoplay or anything though, I just followed the instructions from the stickied thread in the BBAI forums when I first merged Better AI with BUG (at that time without BULL).
There's also quite a few XML assets, though they don't clash (except for eventinfos where you choose the BUG file with its pythoncallbacks)
But apart from the dll, that would be all.

If Lemon wants to include BAIT as an option in the next BAT installer, she may do so. And if there are any questions that this post here doesn't answer, I'll try to help. I never touched nsis or any other install script thing though, I'm not sure I can contribute much -_-
 
If all fails:
  1. Uninstall/completely remove BAT (that includes that dummy BUG mod folder)
  2. Reinstall it without the "share options with BUG Mod" option
  3. Apply the 2.1.1 Patch
  4. Delete Python folder from BAT
  5. Delete your usersettings (only the .ini files in it, not the folders), just to be sure
  6. Copy everything from my mod to the BAT mod folder, except for Usersettings and Info, those are not needed
  7. Post me the errors you get, if any

Ok, I tried your above method. Here are some interesting observations:

  • Your mod adds a rocket icon in the upper left corner that allows access to the BUG mod options screen
    (this is not present when I run BAT by itself).
  • Your mod does not allow the PLE icons on the main map screen.
  • Your mod does not allow access to the BUG mod help file.
  • I successfully obtained diplomacy text!

I consider this playable!

The game reports I have the following installed:

  • BTS 3.19
  • Unofficial Patch 1.40
  • Better BTS AI 0.84b with AI Logging
  • BUG Mod 4.3 [Build 2158]
  • BULL 1.1 [Build 152]

Attached is the Python Debug. A Python Error log was not generated.

Thanks for your awesome help! :goodjob:
 

Attachments

  • PythonDebug.txt
    282.7 KB · Views: 108
Sorry, I just saw this thread just now. First, BAT can live in either My Games or BTS folder. If running WinXP or Win7 you may need to run BTS as Administrator.

Thank you for letting me know about this. I am running as Admin. I may try moving the mod to the Mods folder in the main Firaxis BTS directory.

Go to Assets/Python/EntryPoints and remove these files:

  • CvAppInterface.py
  • CvDiplomacyInterface.py
  • CvOptionsScreenCallbackInterface.py
  • CvRandomEventInterface.py
Move them to a folder outside of the BAT Mod folder for safe keeping and see if that fixes the problem.

None of these files were present in my copy.
 
Interestingly enough, I had suspected this could be a problem, so I had already installed Fuyu's Public Maps into My Games\BTS folder. I assume this is where you mean, Phungus. Otherwise, please direct me to where you mean by "user's custom maps directory."

Thanks. :)
Yeah, this should work. If it doesn't, I'm confused, and I'll need to reassess my code for installing new map scripts in my installer.
 
* That rocket has since been replaced with a bug icon
* I can definitely see the PLE filter buttons here
* There is a help file?.. Ok you want that to open, put it into your BUG\Info\ folder, that might work
* So after deleting the python files that screwed you, all is working again. nice

I am not sure if the art is working as it should though. Maybe someone can tell from a screenshot? I did rename BlueMarble because I don't like it, and I renamed the 80 versions of VD and CulturalCityStyles because the patcher contained older ones to replace them.

Yes it's playable, probably. But until a new and fixed version comes around I'll be playing without it again.
 

Attachments

  • Civ4ScreenShot0057.JPG
    Civ4ScreenShot0057.JPG
    435.4 KB · Views: 355
If Lemon wants to include BAIT as an option in the next BAT installer, she may do so.
I'll be happy to discuss that in about a week or so, when I've released the new BAT version.

Till then, this little Lemon has her head down, grinding away at some XML, and an installer. :)
 
* That rocket has since been replaced with a bug icon
* I can definitely see the PLE filter buttons here

Strange, strange beyond strange. :crazyeye:

I see your build numbers are slightly different than mine. I can't imagine that would be the crux of the problem.

phungus said:
Check out the RevDCM install script in the current RevDCM SVN, I've commented the hell out of it, and it should do everything you want:
I'll definitely have to look into this.
 
I think phungus was talking to me there, or LemonMerchant, or both. I doubt he wants you to make an installer for our mods ;)

The bug icon was not in the release yet, so that is normal. The PLE code however didn't change as far as I can tell. That I guess will remain a mystery for now.

I will release an updated version of my mod shortly, with that icon and new BULL (but without BBAI's r523+ which adds Lead From Behind), so if you feel like trying again, wait for that and don't forget deleting the python folder. If you still have a XML/Text/BUGOptions_CIV4GameText.xml file, that is old too but I'm not sure if that can even possibly cause anything.
 
I think phungus was talking to me there, or LemonMerchant, or both. I doubt he wants you to make an installer for our mods ;)
:lol: Ok.
I will release an updated version of my mod shortly, with that icon and new BULL (but without BBAI's r523+ which adds Lead From Behind), so if you feel like trying again, wait for that and don't forget deleting the python folder. If you still have a XML/Text/BUGOptions_CIV4GameText.xml file, that is old too but I'm not sure if that can even possibly cause anything.

Outstanding! And, again, thank you for your most gracious help.

--CK
 
If all fails:
  1. Uninstall/completely remove BAT (that includes that dummy BUG mod folder)
  2. Reinstall it without the "share options with BUG Mod" option
  3. Apply the 2.1.1 Patch
  4. Delete Python folder from BAT
  5. Delete your usersettings (only the .ini files in it, not the folders), just to be sure
  6. Copy everything from my mod to the BAT mod folder, except for Usersettings and Info, those are not needed
  7. Post me the errors you get, if any

I tried this and got the following Python Exception, but everything else seems to be working okay. I used BAT 2.1 patched to 2.1.1a and your Better BUG AI r39.

@Colonel Kraken: To get the PLE buttons back, go to the BUG options, PLE tab, and set Draw Method to PLE. Thanks to Fuyu for that solution!

Spoiler Python Exception :
Code:
Traceback (most recent call last):

  File "CvWBInterface", line 18, in writeDesc

  File "CvWBDesc", line 1533, in write

  File "CvWBDesc", line 470, in write

RuntimeError: unidentifiable C++ exception
ERR: Python function writeDesc failed, module CvWBInterface
 
I tried this and got the following Python Exception, but everything else seems to be working okay. I used BAT 2.1 patched to 2.1.1a and your Better BUG AI r39.

I figured it out: I had used the settings from Better BUG AI.ini, but I needed to keep the ones from BAT instead. So in summary, here's what I did to get "Better BAT AI" working:

  1. Uninstall/completely remove BAT Mod 2.1 (that includes that dummy BUG mod folder)
  2. Reinstall it with the "Don't share options with BUG Mod" option
  3. Apply the BAT 2.1.1a Patch
  4. Delete Python folder from BAT
  5. Delete the .ini files in BAT's Usersettings folders, just to be sure (but leave BAT Mod 2.1.ini in the BAT Mod 2.1 folder intact)
  6. Copy everything from Better BUG AI to the BAT mod folder, with Usersettings and Info contents optional
  7. Launch Civ4, press Alt-Ctrl-O to access the BUG options, and set Draw Method to PLE in the PLE Plot List tab
 
Didn't I already say that in post #17 from feb 23rd?
Ok, I got it: there is the option to hide/show the button, but that is obvious. Most importantly there is a "Drawing Method" dropdown menu in the line below it. It defaults to "Vanilla", "BUG" is completely broken without the branch, and "PLE" is what you need for those buttons to show.
 
EDIT: I originally posted a bug report here, but since I discovered I was mistaken, here are instructions for a successful Better BUG AI r47 - BAT 2.2 combination!

1. Do a fresh install of BAT Mod 2.2
2. Delete Python folder from BAT area
3. Copy everything from Better BUG AI r47 to the BAT mod folder
 
Top Bottom