Bug Reporting

Just fired up the latest BUG version from SVN and got the infamous "No interface" error. This is what the logs say:
Spoiler PythonDBG.log (excerpt) :
14:34:48 WARN : BugPath - cannot find asset file init.xml in Config
14:34:48 ERROR: BugInit - cannot find XML file for mod init
14:34:48 WARN : BugCore - mod Advisors not initialized; removing
14:34:48 WARN : BugCore - mod MainInterface not initialized; removing
14:34:48 WARN : BugCore - mod Autolog not initialized; removing
14:34:48 WARN : BugCore - mod CityScreen not initialized; removing
14:34:48 WARN : BugCore - mod BetterEspionage not initialized; removing
14:34:48 WARN : BugCore - mod PLE not initialized; removing
14:34:48 WARN : BugCore - mod TechWindow not initialized; removing
14:34:48 WARN : BugCore - mod Scores not initialized; removing
14:34:48 WARN : BugCore - mod Reminder not initialized; removing
14:34:48 WARN : BugCore - mod NJAGC not initialized; removing
14:34:48 DEBUG: Timer - BUG init [read configs] took 4 ms
14:34:48 DEBUG: BugInit - calling init functions...
14:34:48 DEBUG: Timer - BUG init [call inits/events] took 0 ms
14:34:48 DEBUG: Timer - BUG init [total] took 4 ms


Spoiler PythonERR.log :
Traceback (most recent call last):

File "CvAppInterface", line 79, in preGameStart

File "CvScreensInterface", line 72, in showMainInterface

File "CvMainInterface", line 2237, in interfaceScreen

File "CvMainInterface", line 2193, in initState

File "CvMainInterface", line 748, in getMaxRow

ZeroDivisionError: integer division or modulo by zero
ERR: Python function preGameStart failed, module CvAppInterface
 
@The Doc - I changed BugPath slightly by renaming the optional CvPathOverride module to CvAltRoot. Were you using this module?
 
@The Doc - I changed BugPath slightly by renaming the optional CvPathOverride module to CvAltRoot. Were you using this module?

Dunno. Just updated my local repository to 1610 and copied the stuff to my Mods directory.
 
Ah, since you run it as a mod you need to copy the file CvModFolder.py from the "BUG Mod" folder (where the help files are located) to "Assets/Python" and follow the instructions inside it. Open it up in Notepad and change the string to match the name of the mod folder, e.g. "BUG Mod SVN".
 
Ah, since you run it as a mod you need to copy the file CvModFolder.py from the "BUG Mod" folder (where the help files are located) to "Assets/Python" and follow the instructions inside it. Open it up in Notepad and change the string to match the name of the mod folder, e.g. "BUG Mod SVN".

Works now. :D I guess, I shouldn't ask why the file isn't there in the first place.
s000.gif
 
That's a valid question. The answer is because some people install BUG to the CustomAssets folder instead as a mod, and that file would break their installs.

The EXE installer will actually install that file as necessary with the correct folder name, so non-SVN users won't have to deal with it. Life's just a little tougher on the bleeding edge. :mischief:
 
don't hate me ... but ... isn't there a way for BUG to know if it is running from customassets or mod/assets?
 
All my attempts have been denied so far.

CyReplay.getModName() looked promising, but that doesn't return a value for a game that's in progress. Regardless, we need the info before the game is started/loaded anyway. :(

Asking a Python module for its path returns the same partial path whether it's running as a mod or in CustomAssets, e.g. "assets/Python\BUG\BugPath.py". :cry:
 
Hey - the mod name is displayed on the main menu page before you start a game (I think). Where does the system get that information? What about something on the F8 page - doesn't that return the current mod?
 
I'm confused. Where's the difference between CvAltRoot.py and CvPathOverride.py? Do I need both if running as a (custom) mod? Both files are in your svn directory.

Oh and is this mod not compatible with vista AND XP anymore without changing one of these files? What about my mod other people can download? Do they need to change anything in case they are using vista? (I'm using XP). Meh! The ini files are in 'modname'\ini-files\. I've changed all the config files to work with this directory. Do I need one of these files (CvAltRoot.py or CvPathOverride.py) then?
 
We can get the modname through the CyReplay if we are a bit creative in its use; even though the current game's replay info isn't set until the game actually ends, we can create our own replay of an in-progress game. However that method still requires a game to be actually loaded to retrieve the info. :(

The spoiler shows all the gory details of using that method.
Spoiler :
Tests made with code similar to the below typed into the python console of a running game.
Code:
r = CyReplayInfo()
r.createInfo(CyGame().getActivePlayer())
print(r.getModName())

  • BUG Mod installed to the Mods directory in Program Files, returns "Mods\<Mod directory>"
    1229386547.jpg
  • BUG Mod installed to Mods directory in My Games, returns full path to mod directory.
    1229386476.jpg
  • Regular game with BUG active through CustomAssets, returns empty string.
    1229386499.jpg
 
I'm confused. Where's the difference between CvAltRoot.py and CvPathOverride.py? Do I need both if running as a (custom) mod? Both files are in your svn directory.

I'm sorry. I meant to rename it--not create a second file. I've deleted CvPathOverride.py in SVN. I renamed it because the main reason it is necessary is for someone using the /AltRoot command-line option.

The other reason it may be necessary is some people were saying Vista had problems, or CivGold, or CivComplete, or some foreign language XP installations. I don't have any of those, so I cannot test it to know for sure. This file is there as a catch-all solution to the "BUG cannot find init.xml" problem.

Oh and is this mod not compatible with vista AND XP anymore without changing one of these files?

So no, BUG didn't do anything to break compatibility. I recommend shipping this file with your mod but leaving them outside the Python folder. Your users will need it in the exact same scenario as BUG users.

CvModFolder.py is necessary only when installing your mod to the Mods folder. When it is in CustomAssets, it should not be included in the installation.
 
We can get the modname through the CyReplay if we are a bit creative in its use; even though the current game's replay info isn't set until the game actually ends, we can create our own replay of an in-progress game.

I just tested the above (but I passed in 0 instead of CyGame().getActivePlayer()), and it works both when starting a new game and loading a game. However, keep in mind that you can open up the Civilopedia/Sevopedia from the main menu, causing it to try to initialize BUG. Maybe that's okay, but I'd want to do a lot of testing before counting on it.
 
I don't know if this has been fixed yet or not, just posting the error as I don't now have time to do searches here. Problem is no interface with BUG 3.5 (in my Rise of Mankind mod).

Python error:
Spoiler :
Traceback (most recent call last):
File "<string>", line 1, in ?
File "<string>", line 52, in load_module
File "CvEventInterface", line 13, in ?
File "<string>", line 52, in load_module
File "BugEventManager", line 58, in ?
File "<string>", line 52, in load_module
File "CvEventManager", line 12, in ?
File "<string>", line 52, in load_module
File "CvScreensInterface", line 3, in ?
File "<string>", line 52, in load_module
File "CvMainInterface", line 12, in ?
File "<string>", line 52, in load_module
File "BugOptions", line 108, in ?
File "<string>", line 52, in load_module
File "BugPath", line 80, in ?
File "BugUtil", line 167, in debug
File "BugUtil", line 195, in log
File "BugUtil", line 203, in logToFile
File "<string>", line 13, in write
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 74: ordinal not in range(128)

This came up when I tested installing my mod on a computer which windows user name has couple scandinavian letters ä (a with dots). Any easy or quick way to fix this?

Edit: Just noticed there's v3.51 released, will grab it and check out later tonight it if that version solves my problem ;)
 
Just noticed there's v3.51 released, will grab it and check out later tonight it if that version solves my problem ;)

Yes, 3.5.1 solves this issue.
 
Installed BUG 3.5.1 with the .exe and received the no interface error.

Spoiler PythonErr.log :
Traceback (most recent call last):

File "CvAppInterface", line 84, in preGameStart

File "CvScreensInterface", line 81, in showTechChooser

File "CvTechChooser", line 193, in interfaceScreen

File "CvTechChooser", line 205, in ConstructTabs

File "CvTechChooser", line 251, in DrawTechChooser

File "CvTechChooser", line 330, in placeTechs

File "CvTechChooser", line 353, in addIconsToTechPanel

AttributeError: 'CyPlayer' object has no attribute 'getUnitButton'
ERR: Python function preGameStart failed, module CvAppInterface
Traceback (most recent call last):

File "CvScreensInterface", line 947, in forceScreenRedraw

File "CvMainInterface", line 3032, in redraw

File "CvMainInterface", line 6198, in updateScoreStrings

RuntimeError: unidentifiable C++ exception
ERR: Python function forceScreenRedraw failed, module CvScreensInterface
 
I had not; however, I reinstalled BTS and now BUG 3.5.1 seems to be working fine. Thanks for your help.
 
Back
Top Bottom