[SDK] Transitionning from "full game MOD" to subdirectory one

P&nny

Warlord
Joined
Sep 1, 2007
Messages
195
Hello, so my Beyond the Play MOD is fully functional (https://forums.civfanatics.com/threads/beyond-the-play-community-mod.648750/); but as you may notice there, I've designed it as a "full game", i.e. replacing source file of the game for the reasons I've listed there.

I've been asked to try to make it MOD only (read : normal MOD, i.e in a sub-directory \MOD like all other MOD)

Surprisingly it's proving much harder than I though to do this...
Normally I know exactly how to do by moving the files that have changed, am not worried about methodology to be honest.

However it doesn't want to take it :
I get python errors at launch, doesn't "like" the C++/dll file (can't click the civelopedia in start menu etc.) (but it's there and loading because my new options do appear).

If I don't put the new .dll file; and I put files that I have selected one by one (up to 1400 new files, all arts, all XML, about half the (new) python). I can see go clean.
Put If I put JUST ONE FILE of some given .py files (say CvMainInterface, a file I've touched massively)

I get a deluge of error like this (obviously game crashes when I launch then) :





It's important to note :
The files giving the error are not the self-made python, it's every file in "EntryPoints" and most files in "Screens"
So my best guess (not sure) is an error on loading the modules or the entry points (I get the "File <String>, line 52, in load_module" error in between each messages).


Any help ? Am amazed I'm struggling with this. I've spent 1000H+ on the code of the MOD and I never though this would be any tricky (I mean "merging back" to normal MOD format).

Thanks a ton.
 
Last edited:
I can't help much without actually knowing what you're modifying, but if I'm understanding this correctly,
Put If I put JUST ONE FILE of some given .py files
it sounds like this could be the problem. Python files usually depend on other Python files (and a specific DLL), so just adding a single one would often not work. On your screenshot for example it appears to be missing a "pullparser" module, which as far as I know doesn't exist in Civ4. So make sure to add all modified Python files to the Assets/Python/ folder (or subdirectories).
 
Ok good catch.
It was actually my intention to try all files together at first and then I did at a second time one by one so I thought I'd covered this.

Made me try somethign else thoughn and read my description of errors properly, and I repatriated a couple of files back (important CvEventInterface which I though was Civ Vanilla file) in the MOD and that "python" part is working now... ---> Thanks a lot :thumbsup:


I'm now in a situation where the is now in a situation where there is no python error, Pedia (which is heavily changed) works fully and game option etc. seem all on par.
When I do launch a game it always crashes though.

I'm wondering if it could be the same issue I oepend a topic about : (https://forums.civfanatics.com/thre...d-full-dump-on-virtual-address-access.665032/) :
- in "full game" mode I crash say 50% of the time when launching the .exe itself --> it's not that annoying launch it twice
- in "mod" version it always launches the MOD but when I start an actual game it crashes each time.

Am going to need serious help explaining how to make the most of the full dump file because I expect this is too vague for anyone to make sense of just like that....



Thanks a lot
 
I have no clue how dump files work and don't use visual studio, but based on the screenshot this thing doesn't seem to say a lot.

Anyways, here's what I'd do:
First I'd check if it's caused by some python error (My Documents/My Games/Beyond the Sword/Logs/PythonErr.log), sometimes those can crash the game during loading.

If it's not one, I'd try to somehow get a stack trace and check failed assertions, which will trigger for xml problems too with a debug build, though again I have no idea how you do that in visual studio. And pray that the crash isn't happening somewhere in the exe...
 
I get a deluge of error like this (obviously game crashes when I launch then) :

You already resolved this issue but I want write about the reason for this problem.
For an better modding support Civ4 keeps track about file changes if the game is running and reloads (On Windows only(?!). With Linux+Wine it does not work) the changed files ingame.
For the most time this feature works well but it exists two exceptions:
1. Adding new Python files to the mod folder. This is problematic because the game observed the file at the original place but not in the mod folder.
This case is not very problematic because adding new files is a rare case.

2. Changing Files in the "Python/Screens"-folder. This files can not be changed if they are in usage in the game. If you do, you get this bunch of Popup windows and with every redraw cycle you got more and more popups....
Workaround: Save the game and quit to main menu before you change files in the "Python/Screens"-folder.
 
Last edited:
Top Bottom