Python Error

Regarding the EOF file error then I notice you used a mix "\" and "/" in all 3 file paths.
 
I use the one from BtS Standard file.:blush: What i have in that rar file is all i use.

That cannot be correct. The error is

CvAppInterface.py, line 63: CvModEvents instance has no attribute fireEvent.​

but here is line 63 of that file from BTS's Assets/Python folder:

Code:
# Load dynamic font icons into the icon map

It's a comment and is ignored entirely by Python. This cannot be the cause of the problem. In fact, the phrase "fireEvent" doesn't appear in any BTS Python files.

Now here is line 63 if CvAppInterface.py from BUG:

Code:
CvEventInterface.getEventManager().[B]fireEvent[/B]("PreGameStart")

In your CvEventInterface.py module, getEventManager() returns a CvModEvents instance. Note: It actually has two return statements; the second one is never reached and should be deleted. You also create three event managers in that module. You only need to create one--probably CvCustomEventManager, but I haven't verified this part.

Clearly you are using BUG's CvAppInterface.py either from CustomAssets or your mod's Assets folder. Perhaps you copied the BUG files to BTS's core Assets folder?
 
Regarding the EOF file error then I notice you used a mix "\" and "/" in all 3 file paths.

Python will treat them the same on Windows, provided you create the \ by escaping it or using a raw string:

Code:
path = "C:\\Program Files\\Civ4\\Beyond the Sword\\Assets"

is the same as

Code:
path = [B]r[/B]"C:\Program Files\Civ4\Beyond the Sword\Assets"

is the same as (when passing to os.path functions or open()

Code:
path = "C:/Program Files/Civ4/Beyond the Sword/Assets"
 
Regarding the CvAppInterface.py error then it could be caused by using a custom DLL. I seem to recall seeing a thread about a modpack/-component here on CFC that had introduced and made hardcoded calls to fireEvent, but I don't remember the name of it atm or any other specifics.

So ... are you by any chance using this (or any other) custom DLL?


EDIT: Ah, so THAT is BUG - heh
 
@EmperorFool:
I see, I just seem to recall certain system calls being anal about the use of "\" and "/" - but maybe that was just in the 'good ol' days' ;)
 
Regarding the CvAppInterface.py error then it could be caused by using a custom DLL. I seem to recall seeing a thread about a modpack/-component here on CFC that had introduced and made hardcoded calls to fireEvent, but I don't remember the name of it atm or any other specifics.

So ... are you by any chance using this (or any other) custom DLL?


EDIT: Ah, so THAT is BUG - heh

Nope i do not use any dll.
 
Ya I've mixed both / and \ with Python, but I tend to use \ on Windows to be safe. Most other languages will barf on / on Windows and insist you use \.

@strategyonly - Can you please post the CvAppInterface.py file that is in your BTS Assets/Python/EntryPoints folder, even though it's the one that came with BTS? And double-check that your CustomAssets folder is truly empty.
 
...mmmh :hmm: what did you change, before the error occured?

And is the BUG-mod installed?
-> This question, because i've seen strange interactions between some mods, and in the main game after some time.
For example, my normal BtS tries to load the erebus- and the fury-road-mapscript, and in my version of civ-super i get an error about an missing building, which doesn't appear in any xml or python-file in the mod.
So maybe it's not really an error with your mod.
Can you upload the current (and buggy) version?
 
Nope i do not use any dll.
Heh heh, no I meant that the fireEvent is from the BUG mod ;)

And I think you'll find that EF is right about the CvAppInterface.py currently being used is the one from that mod.

Be sure to check any sub dirs from under main, custom and mod Python paths as well, since cIV will happily check all sub dirs for the .py file being called - and use the one with the most recent datestamp regardless of any seeming logic in location.
 
Ya I've mixed both / and \ with Python, but I tend to use \ on Windows to be safe. Most other languages will barf on / on Windows and insist you use \.

@strategyonly - Can you please post the CvAppInterface.py file that is in your BTS Assets/Python/EntryPoints folder, even though it's the one that came with BTS? And double-check that your CustomAssets folder is truly empty.

This is my BtS python folder.
 
Yes, your BTS Python folder is corrupted. You probably copied the BUG files into it. Line 174 of the stock file is

Code:
return true

That can't possible cause the error in the screenshot.

The same line from BUG's file can, if iBuilding is -1. This happens if iReligion is -1. I don't think BUG modified this part of the file, though, so it's probably a bug in the core game. BUG did add the EventSigns stuff, but that shouldn't have need to change this part.

Code:
szHelp = localText.getText("TXT_KEY_EVENT_HOLY_MOUNTAIN_HELP", ( gc.getBuildingInfo(iBuilding).getTextKey(), gc.getBuildingInfo(iBuilding).getTextKey(), iMinPoints))

You need to reinstall BTS to get the unmodified files back. I also recommend that you ZIP up the Python folder as a backup after reinstalling. You never know when a mod you install (such as the Unofficial Patch) might change them. The UP makes a backup, but I'd rather trust myself than someone else when I can.
 
I'd wager that you got a version of those .py files hiding in a sub dir of the sys paths with newer datestamps. If so then reinstalling might not even help - unless you delete absolutely all dirs used by cIV from Vanilla up to BTS.

Much easier to check a few dirs imo - heh. :)
 
Top Bottom