[BUG Mod] Icons not displayed

Alright ! Thank you, NobleZarkon !
I didn't understand the use of your method. Now I've tried to rename the User Folders, it failed, and I can see the light :goodjob:

Sorry I wasn't clear earlier but glad you got it to work, renaming a load of system folders was a painful way to go and would probably just cause random crashes even if you managed to get it to work.

Have fun! :D
 
This is the exact problem I am having to a tee.
How do I change the username?
 
See your original thread for the answer.
 
I run Windows 10 and have the same problem as described in the OP: no icons for a variety of things after installing BUG mod. After originally having an 'ö' in my Windows user account name and changing that (I restarted my computer twice after that already), the problem is still there.
So basically the solution that worked for OP does not work for me. Any advice?
 
I see what the problem could be. I changed the name of my Windows account but going to C:/Users it still displays my old account name for the folder that should now be called my new account name.

Could be the problem, right? Anyways, I have found easy solutions for this for Windows 7 and Windows 8, but a solution for Windows 10 I cannot find, while on the other hand finding a couple of people asking about the same problem and not getting any answers.

I suppose if I ever want to get BUG to work properly I'd need to create a whole new account on which to install Steam and Civ IV + BUG again.
 
That is exactly the problem. BUG reads the user path and has particular issues with non standard characters. Can you install (reinstall) Civ IV + BUG to your new windows account? That should fix the problem.
 
Alright, thanks. I have fixed the problem now by creating a new user account on my computer and I will just switch to that account every time I want to play Civ IV.
 
Iirc, when I had the same issue, I migrated all of my other files to the new account, which allowed me to delete the former account. So I could avoid the bother of having 2 accounts.

You may want to do the same. However, I had a new computer, which made the migration a rather simple matter.
 
Any chance of fixing that bug? I know python, but I don't know the BUG code base nor the Civ IV interface. But if someone can point me to where they mess up the path handling I might give a go fixing it myself.

I have an old account, and changing it's name is equivalent to a clean windows install. Changing accounts only to play Civ IV is particularly annoying for me too, as it seems like Windows has a bug that it resets the taskbar to the main display after user change, while I want it in my portrait monitor. I can't change my main display, because many programs, like the unnaltered Civ IV itself, behave badly with portrait displays. And living with a taskbar stealing precious vertical realstate from my landscape monitor is also bad. An extra active account is also an 1+GB memory overhead.

In all those years, only one other program gave me problem due to that, and it has already been fixed after I pointed it out.
 
Last edited:
I would suggest adding a fixed / hard-coded directory in 'BugPath.py' file so that when the mod searches for the data directory, it finds your hard coded directory first.

Code:
def initDataFolder():
    """
    Finds the first directory that contains a folder named SETTINGS_FOLDER.
    """
    global _dataFolderInitDone
    if _dataFolderInitDone:
        return
    BugUtil.debug("BugPath - initializing data folder")
  
    dataDirs = (
        join(getUserDir(), getModName()),    # My Games\BUG Mod
        join(getRootDir(), getModName()),    # My Games\BTS\BUG Mod
        join(getAppDir(), getModName()),    # Civ4\BTS\BUG Mod
        join(getModDir(), DATA_FOLDER),     # Civ4\BTS\Mods\BUG Mod 3.6\Data
        join(getModDir()),                  # Civ4\BTS\Mods\BUG Mod 3.6
    )
    for dir in dataDirs:
        if setDataDir(dir):
            break
    else:
        BugUtil.error("No valid data directory containing %s found", SETTINGS_FOLDER)
    _dataFolderInitDone = True
 
Thank you for the pointers, but it doesn't appear to be it.

If any directory in BugPath.py is wrong, BUG won't even start. The game starts bare, w/o the bars on the corners of the screen, hover text, city screen, etc but with a blank window with exit button. When the python code itself is invalid (I took sometime to discover that it's indentation doesn't follow pep8) the game skips the intro video and not even that blank window appears when loading a game.

I tried hardcoding, changing the my documents finding routine in initRootFolder() for an alternative one, but all ended up the same, with bug generally working but missing icons.

There are relative paths added to the 'CIV4ArtDefines_Interface.xml' in the CustomAssets/xml/art folder. Maybe when merging those paths with the dataFolder path it mess up the encoding of the strings? I still couldn't find where that merging happens though.

By the way, how do I see the logged debug messages and/or python stacktraces?
 
I haven't looked at the code or coded in python for way too long ... not sure I remember how to do that. There might be a debug mode in the civ4.ini file that needs to be turned on.
 
Ok, I should have searched first before asking, it was quite easy to find: https://strategywiki.org/wiki/Civilization_IV/Python_Debugging

There is quite a lot of debuging output. I will list here the parts that seems anomalous:

In the xml.log there is 3 MB of things like that for many xml files:
Code:
[45655.813] Loading XML file xml\Events/CIV4EventInfos.xml
[45655.859] Load XML file xml\Events/CIV4EventInfos.xml SUCCEEDED
[45655.859] SetGlobalClassInfo (Civ4EventInfos/EventInfos/EventInfo)
[45655.859] info type NONE not found, Current XML file is: xml\Events/CIV4EventInfos.xml
[45655.859] info type NONE not found, Current XML file is: xml\Events/CIV4EventInfos.xml
[45655.859] info type NONE not found, Current XML file is: xml\Events/CIV4EventInfos.xml
[45655.859] info type NONE not found, Current XML file is: xml\Events/CIV4EventInfos.xml
[45655.859] info type NONE not found, Current XML file is: xml\Events/CIV4EventInfos.xml
[45655.859] info type NONE not found, Current XML file is: xml\Events/CIV4EventInfos.xml
[45655.859] info type NONE not found, Current XML file is: xml\Events/CIV4EventInfos.xml
[45655.859] info type NONE not found, Current XML file is: xml\Events/CIV4EventInfos.xml
[45655.859] info type NONE not found, Current XML file is: xml\Events/CIV4EventInfos.xml
[45655.859] info type NONE not found, Current XML file is: xml\Events/CIV4EventInfos.xml
[45655.859] info type  not found, Current XML file is: xml\Events/CIV4EventInfos.xml
[45655.859] info type NONE not found, Current XML file is: xml\Events/CIV4EventInfos.xml
[45655.859] info type NONE not found, Current XML file is: xml\Events/CIV4EventInfos.xml
[45655.859] info type NONE not found, Current XML file is: xml\Events/CIV4EventInfos.xml
[45655.859] info type NONE not found, Current XML file is: xml\Events/CIV4EventInfos.xml
[45655.859] info type NONE not found, Current XML file is: xml\Events/CIV4EventInfos.xml
[45655.859] info type NONE not found, Current XML file is: xml\Events/CIV4EventInfos.xml
[45655.859] info type NONE not found, Current XML file is: xml\Events/CIV4EventInfos.xml
and it continues for hundreds of lines, then changing to other files. I may post all the files that gave this problem if you want.

in rsmgr.log contains the following:
Code:
RESMGR: Texture FlagDECAL.dds failed to load
RESMGR: Texture PlayerColor01.tga failed to load
RESMGR: Texture PlayerColor02.tga failed to load
RESMGR: ---- Unloading ----

Near the end of the PythonDbg.log, where BUG writes all its steps, there is this:
Code:
01:56:19 DEBUG: GameSetUpCheck - module disabled
01:56:19 DEBUG: Timer - BUG init [call inits/events] took 92 ms
01:56:19 DEBUG: Timer - BUG init [total] took 354 ms
01:56:19 DEBUG: BugData - loading root
01:56:19 DEBUG: BugData - opening root.SpyUtil: {}
01:56:19 DEBUG: SpyUtil - loaded: {}
01:56:19 DEBUG: SpyUtil - no data found
01:56:19 DEBUG: AbstractOption - setting Autolog__LoggingOn to True
01:56:19 DEBUG: BugOptions - setting Autolog__LoggingOn to True
01:56:19 DEBUG: BugOptions - option Autolog.Autolog__LoggingOn changed from True to True
01:56:19 DEBUG: BugTable - Reminders not found in root
01:56:19 DEBUG: BugTable - Reminders not found in root
01:56:19 DEBUG: FavoriteCivicDetector.initHelpers() gDetectionNecessary: False
01:56:19 DEBUG: EventSignsEventHandler.onLoadGame()
01:56:19 DEBUG: EventSigns.initOptions() initializing. g_bShowSigns is True.
01:56:19 DEBUG: BugTable - EventSigns not found in root
01:56:19 DEBUG: EventSigns has no saved data. Initializing new data.
01:56:19 DEBUG: EventSigns.initData() initializing gSavedSigns
01:56:19 DEBUG: BugTable - StrategyOverlay not found in root
01:56:19 DEBUG: BugEventManager - event PreGameStart
01:56:19 DEBUG: BugInit - init() already complete
8500 - gold

8501 - research

8502 - culture

8503 - espionage

8483 - food

8484 - production

8485 - commerce

8550 - judaism

8551 - judaism

8552 - christianity

8553 - christianity

8554 - islam

8555 - islam

8556 - hinduism

8557 - hinduism

8558 - buddhism

8559 - buddhism

8560 - confucianism

8561 - confucianism

8562 - taoism

8563 - taoism

3 SCREEN TURNED ON

99 SCREEN TURNED ON

Those 4 lines with "not found in root" may be some problem.

And the end there is the following, maybe reflecting me hovering my mouse over things:

Code:
01:56:21 DEBUG: updatePlotListButtons_Orig - column 0, offset 225
01:56:21 DEBUG: BugOptions - writing INI file 'Autolog.ini'
load_module encodings.ascii

01:56:21 DEBUG: updatePlotListButtons_Orig - column 0, offset 225
01:56:21 DEBUG: updatePlotListButtons_Orig - iCount(225), iSkipped(0)
01:56:21 DEBUG: Timer - scores took 2 ms
01:56:21 DEBUG: BugEventManager - event BeginActivePlayerTurn: (0, 0)
01:56:21 DEBUG: MapSigns.processSigns() starting. bShow = True and g_bShowSigns = True
01:56:21 DEBUG: EventSigns.updateCurrentSigns() finished.
 MapSigns { plotDict = { } }
01:56:21 DEBUG: BugEventManager - event endTurnReady: (0,)
01:56:22 DEBUG: Timer - scores took 2 ms
01:56:35 DEBUG: updatePlotListButtons_Orig - column 0, offset 225
01:56:35 DEBUG: updatePlotListButtons_Orig - iCount(225), iSkipped(225)
01:56:39 DEBUG: updatePlotListButtons_Orig - column 0, offset 225
01:56:39 DEBUG: updatePlotListButtons_Orig - iCount(225), iSkipped(0)
01:56:39 DEBUG: Timer - scores took 2 ms
01:56:41 DEBUG: AbstractOption - setting MainInterface__FieldOfView_Value to 40
01:56:41 DEBUG: BugOptions - setting MainInterface__FieldOfView_Value to 40
01:56:41 DEBUG: BugEventManager - event UnInit
PY:OnUnInit
UnInit Python

I don't know if those things in those log files are normal or not.

And reading the logs, maybe the FontUtil.py is of interest. I will look into it more tomorow.
 
Last edited:
Top Bottom