[PYTHONCOMP] Civ4lerts: Alert messages about in game events

Nope.... While it gets through loading it blows up when i do anything with the menu...

How can I turn on the debug text thats in CvPath ive tried calling _test() but it ignores it or errors. I figure if I can see a print out of the directories I can figure something out...

Latest Error
Code:
Traceback (most recent call last):

  File "CvOptionsScreenCallbackInterface", line 509, in handleBugCheckboxClicked

  File "BugOptions", line 60, in setBoolean

  File "RuffModControl", line 93, in set_boolean

  File "RuffModControl", line 48, in __set_keyvalue

  File "configobj", line 337, in __getitem__

KeyError: 'RawCommerce'
ERR: Python function handleBugCheckboxClicked failed, module CvOptionsScreenCallbackInterface
Traceback (most recent call last):

  File "CvOptionsScreenCallbackInterface", line 509, in handleBugCheckboxClicked

  File "BugOptions", line 60, in setBoolean

  File "RuffModControl", line 93, in set_boolean

  File "RuffModControl", line 48, in __set_keyvalue

  File "configobj", line 337, in __getitem__

KeyError: 'RawCommerce'
ERR: Python function handleBugCheckboxClicked failed, module CvOptionsScreenCallbackInterface
Traceback (most recent call last):

  File "CvOptionsScreenCallbackInterface", line 509, in handleBugCheckboxClicked

  File "BugOptions", line 60, in setBoolean

  File "RuffModControl", line 93, in set_boolean

  File "RuffModControl", line 48, in __set_keyvalue

  File "configobj", line 337, in __getitem__

KeyError: 'NJAGCM'
ERR: Python function handleBugCheckboxClicked failed, module CvOptionsScreenCallbackInterface
 
Those errors tell me it's still not finding your file. You can do the test by using the console.

While looking at the main interface, hit ~
Type "import CvPath"
Type "CvPath._test()"
 
Does this work for anyone in a mod configuration or am I the exception?
 
Ok that does not work from the main interface...at all....

Gives me syntax errors on each command...yes im using case sensititvity
 
OK I got somewhere...
RuffMod.ini location:
AHA ITS NULL!!!!!
Code:
  print "RuffMod.ini location: " + get_INI_File("Composite XL.ini")

so get_INI_File is borked.

Secondly


Code:
configFilePath = 
  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\
  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\
  d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Beyond the Sword\Mods\Composite XL\
  d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Beyond the Sword\
activeModName = Composite XL
userDir = C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword
userAssetsDir = C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\CustomAssets
userModsDir = C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods
userActiveModDir = C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL
userActiveModAssetsDir = C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\Assets
[B]installDir = d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Beyond the Sword[/B]
installAssetsDir = d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Beyond the Sword\Assets
installModsDir = d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Beyond the Sword\Mods
installActiveModDir = d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Beyond the Sword\Mods\Composite XL
installActiveModAssetsDir = d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Beyond the Sword\Mods\Composite XL\Assets
assetsPath = 
  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\Assets
  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\CustomAssets
  d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Beyond the Sword\Mods\Composite XL\Assets
  d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Beyond the Sword\Assets
pythonPath = 
  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\Assets\Python
  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\Assets\Python\BUG
  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\Assets\Python\BUG\Options
  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\Assets\Python\BUG\Tabs
  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\Assets\Python\DrEJlib
  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\Assets\Python\entrypoints
  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\Assets\Python\screens

Anything dealing with the D: (install directory) is doubleing the beyond the sword...
 
The reason the INI filename comes back as empty ("") is because it can't find the expected file in the two or four directories in which it looks. So far, I can not get this to work in a mod configuration -- only from CustomAssets.

As well, the bug I reported above is actually a misunderstanding on my part. The get_INI_Path() function expects the INI to be located next to Assets or CustomAssets -- not inside it. However, I still have the same problem in mod configuration. :(

Using regedit or regedt32, what is the value of the INSTALLDIR key under HKEY_LOCAL_MACHINE?
 
In my case this would be correct. So it does seem to know where to look.
What tells it the ini file name to look for? Or does it just look for whats in cvModName and appends an .ini to it?
Code:
configFilePath = 
  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\
 
That's the USERDIR -- what about INSTALLDIR under HKEY_LOCAL_MACHINE\Software\Firaxis Games\Civ 4 ...? You said your key is different because it's Civ4 Gold, right? But what is the value for the key?

The RuffModControl module specifies the name of the INI file:

Code:
FileName = CvPath.get_INI_File("BUG Mod.ini")

I suppose it might be a good idea to change it to use the modName from CvModName so that it is in only one place, except then with each new version # in the mod name, the INI file has to be renamed. Depends on how you want to set it up.

Also, note that it will take the INI from your My Games folder before the mod folder.
 
Code:
d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword
is my key...

Please note though I've tried running it in my documents and the install dir.
 
Given that key value, I don't see how the "Beyond the Sword" directory would be doubled. Truly bizarre.

However, did you check that the INI file name in RuffModControl matches your file name?
 
This is the last dump from my last run, the directories LOOK correct, the logic has to be screwed in the routine that gets the ini file for some reason.


Code:
configFilePath = 

  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\

  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\

  d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Mods\Composite XL\

  d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\

activeModName = Composite XL

userDir = C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword

userAssetsDir = C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\CustomAssets

userModsDir = C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods

userActiveModDir = C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL

userActiveModAssetsDir = C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\Assets

installDir = d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword

installAssetsDir = d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Assets

installModsDir = d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Mods

installActiveModDir = d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Mods\Composite XL

installActiveModAssetsDir = d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Mods\Composite XL\Assets

assetsPath = 

  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\Assets

  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\CustomAssets

  d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Mods\Composite XL\Assets

  d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Assets

pythonPath = 

  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\Assets\Python

  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\Assets\Python\BUG

  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\Assets\Python\BUG\Options

  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\Assets\Python\BUG\Tabs

  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\Assets\Python\DrEJlib

  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\Assets\Python\entrypoints

  C:\Documents and Settings\Seth\My Documents\My Games\Beyond the Sword\Mods\Composite XL\Assets\Python\screens

  d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Assets\Python

  d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Assets\Python\EntryPoints

  d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Assets\Python\PitBoss

  d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Assets\Python\pyWB

  d:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Gold\Beyond the Sword\Assets\Python\Screens

greatPeopleArtPath = 

RuffMod.ini location:
 
Given that key value, I don't see how the "Beyond the Sword" directory would be doubled. Truly bizarre.

However, did you check that the INI file name in RuffModControl matches your file name?


Yes Checked and set it to a few different test cases just to double and tripple check. :(
 
All those values look right. Did you back out the change I posted earlier, if you ever added it? re: os.path.dirname(dir). The original is actually correct.

And do you have your INI file as a sibling of "Assets" as opposed to inside it? IOW, it should be directly inside "Composite XL" folder.

That's all I can think of.
 
Yea lets move out of a hard coded ini file

Code:
CvPath.get_INI_File(CvModName.modname) + '.ini'

Is that correct?
 
One temporary debug line I added to figure out what was wrong before was to alter get_INI_file():

Code:
def get_INI_File(szINIFileName):
    ...
    raise IOError, "%s not found in %s" % (szINIFileName, assetsPath)
    return ""

This way, if it can't find the INI file, it will write the filename and directories it was searching into pythonErr.log.
 
No to back out the changes... Let me go do that...
The ini file is in the "root of the mod" i.e. /mods/composite xl/
 
Code:
CvPath.get_INI_File(CvModName.modname) + '.ini'

Is that correct?

Almost. put the " + '.ini'" inside the function call:

Code:
CvPath.get_INI_File(CvModName.modname + '.ini')

and make sure to "import CvModName".
 
One temporary debug line I added to figure out what was wrong before was to alter get_INI_file():

Code:
def get_INI_File(szINIFileName):
    ...
    raise IOError, "%s not found in %s" % (szINIFileName, assetsPath)
    return ""
This way, if it can't find the INI file, it will write the filename and directories it was searching into pythonErr.log.

Did that get us anywhere? :)
 
Did that get us anywhere? :)

Well, it's working on my end, so it pointed out to me why my removal of "os.path.dirname" wasn't such a good idea. :)
 
Back
Top Bottom