Modmodding Q&A Thread

Did you overwrite the Consts.py files with yours?
 
Did you overwrite the Consts.py files with yours?

No, not at first. The starting units issue I solved by just copy pasting the units block from the release (1.13.0?) version. Then, to solve this issue with Temple of Kukulkan, I figured this Python reordering seems to do nothing than make my life harder, so I overwrote the file with the one from the release version, only then the game wouldn't work at all because now whenever I try to start a game I get a "You were defeated" message. Because I had overwritten the file I couldn't get the older version back from the trash, I couldn't figure out how to just download a single file from the Git repository rather than everything as a zip and I don't trust the version I have on my machine of it to really be up to date because Git confuses and enrages me. Then I went off to shoot some zombies before going to bed. I then wanted to reply to this post on my tablet, but apparently that virus that throws lots of ads at me in this forum made a resurgence, so instead I just cried myself to sleep. After waking up and once again confirming that Avast is useless at its job I de- and reinstalled Chrome (again...) and that seems to have done the job, and here I am. I would also tell you what I had for breakfast but I didn't have one yet, which reminds me, I am hungry! Off I go!
 
Okay, it's definitely better to do a proper merge of the Git version of the file with yours, using WinMerge for instance.
 
Okay, it's definitely better to do a proper merge of the Git version of the file with yours, using WinMerge for instance.

But... I don't have a file? :confused: What I did have was the Consts.py file from the 1.13.0 version, until I decided to try basing the latest version of my modmod on the most up to date Git version of the main mod. That's when somehow this wrong unique units and Temple of Kukulkan in Jerusalem issue popped up.

To give you a better idea, this is a list of all the versions of Dawn of Knoedel so far:

0 (not actually called that, was before I made my mind up on a version number system) - based on 1.13.0 release version of DoC, no added units (though I did change the unit class of Hoplite to Spearman), no wrong UUs and Crusade meets Sunset Invasion issue
0.1 - based on 1.13.0 release version of DoC, three new units added, no wrong UUs and Crusade meets Sunset Invasion issue
0.2 - based on 1.13.0 release version of DoC plus savegame patch (three Python files affected, none of these was Consts.py), no new units added apart from the three carried over from 0.1, no wrong UUs and Crusade meets Sunset Invasion issue
0.3 - based on Git version some days ago, suddenly wrong UUs and Crusade meets Sunset Invasion issue

Keep in mind that I never edited any Python files whatsoever except for the savegame patch until you told me to do something in Consts.py, which I have now deleted and replaced with the Git version (I hope? I mean the folder named RFC Dawn of Civilization on my system with this little green tick mark which allegedly is up to date if I try to- wait a minute- *checks the thread with Git instructions, realizes he should have clicked on Pull instead of Sync, does just that*) of it.

Honestly what's up with these little green tick marks next to the mod folder and all its contents anyway? I thought they meant to signify that everything is up to date with the official Git version, but then this green tick mark would have gone away the second you made a commit. Gah.


Never mind that. I am 99% sure that I now have on my local machine the most up to date version of DoC there is. I never edited any Python files until you told me to do so with Consts.py, except for applying the savegame patch of a week ago which affected three other Python files, but I would assume that they are exactly the same in the patch as in Git, right?

I now deleted "my" Consts.py file (from 1.13.0, with or without the three added units I don't even know anymore at this point, honestly that poor file has been through so much this week I figured I might as well put it out of its misery and start over) and replaced it with the one from the "official" RFC Dawn of Civilization folder, that is the one I updated like five minutes ago once I figured out how to. Lo and behold, rolling a Persia start I had Skirmishers, Impis, and a Jewish God who let Abraham sacrifice his son and build him a nice temple for that. Now I already know how to fix the issue with the units, but because I didn't add or remove any buildings I have no idea what would cause the second problem that wouldn't lead to the same in the official version, assuming it's the Python reordering by that Bear Sergeant. :confused:

Just plain replacing Consts.py with the release (1.13.0) version led to a "You were defeated" message whenever I tried starting a game because reasons. :crazyeye: Guess I'll try replacing parts of the Git version with parts of the release version piecemeal instead of wholesale.

Btw here is a comparison between the two:

https://www.diffchecker.com/u0v8te6a

Left (Original) is Consts.py from release (1.13.0), right is Consts.py taken from Git.

Also, here is a list of all the files I changed in case it helps:

Spoiler :
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel v0.1\Assets\Art\Units" (newly created folder together with all the files it contains)
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel v0.2\Assets\Python\Religions.py" (Savegamepatch)
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel v0.2\Assets\Python\Stability.py" (Savegamepatch)
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel v0.2\Assets\Python\StoredData.py" (Savegamepatch)
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel v0.1\Assets\XML\Art\CIV4ArtDefines_Unit.xml"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel\Assets\XML\Buildings\CIV4BuildingInfos.xml"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel\Assets\XML\Civilizations\CIV4CivilizationInfos.xml"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel\Assets\XML\GameInfo\CIV4CivicInfos.xml"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel v0.1\Assets\XML\GameInfo\CIV4CommerceInfo.xml"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel v0.1\Assets\XML\GameInfo\CIV4CorporationInfo.xml"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel v0.1\Assets\XML\GameInfo\CIV4ProcessInfo.xml" (file copied from Warlords)
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel\Assets\XML\GameInfo\CIV4ProjectInfo.xml"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel\Assets\XML\GameInfo\CIV4SpecialistInfos.xml"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel v0.1\Assets\XML\GlobalDefines.xml"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel\Assets\XML\Technologies\CIV4TechInfos.xml"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel v0.1\Assets\XML\Terrain\CIV4BonusInfos.xml"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel v0.1\Assets\XML\Terrain\CIV4FeatureInfos.xml"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel\Assets\XML\Terrain\CIV4ImprovementInfos.xml"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel\Assets\XML\Terrain\CIV4TerrainInfos.xml"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel v0.1\Assets\XML\Text\CIV4GameText_Knoedel.xml" (newly created file)
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel\Assets\XML\Units\CIV4BuildInfos.xml"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel v0.1\Assets\XML\Units\CIV4PromotionInfos.xml"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel v0.1\Assets\XML\Units\CIV4UnitClassInfos.xml"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel\Assets\XML\Units\CIV4UnitInfos.xml"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel\PrivateMaps\RFC 600 AD.CivBeyondSwordWBSave"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel\PrivateMaps\RFC 1700 AD.CivBeyondSwordWBSave"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel\PrivateMaps\RFC 3000 BC.CivBeyondSwordWBSave"
"C:\Games\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of Knoedel\RFC Dawn of Knoedel.ini"


Sorry for the redundant path everywhere, I just copied the path of every file I was about to change and threw it in a .txt file for future reference.
 
What do you intended to base your modmod on?

The savegame patch is for 1.13.0. You only need it if your modmod is based on that. If you download the most recent state of the Git repo, you should not install it.

With 1.13.1 some XML entries were reordered. If you are using any version after that, you can just use the Consts.py file that comes with it and then edit it to reflect your own XML changes.
 
Merry Christmas and Happy new year Leoreth.

Can you explain me shortly how does the new dynamic name works? What do I needed to make names for new civs?
 
The major change is that a name can now be composed of three parts, I've called them "title", "name" and "adjective" in the code.

The title is what becomes the description of your civ in the end. For example "Union of Soviet Socialist Republics". Titles can include the placeholders %s1 and %s2 for names and adjectives respectively. For example, the title "%s2 Empire" becomes "French Empire" for France, likewise "Republic of %s1" becomes "Republic of France".

As you can see, the default name and adjective for a civ are just the short description and adjective used in other contexts (like diplomacy or tile tooltips), but you can define different ones as well. For example, the name and adjective for England become "Britain" and "British" under some circumstances.

To change any of those, look up the "title", "name" and "adjective" methods in DynamicCivs.py and follow down from there. The structure of each is similar to the previous checkName method, so it should be easy if you are already used to that.
 
So good news and bad news:

I decided to more or less start from scratch, that is I made a duplicate of the current Git version and renamed that to Dawn of Knoedel. I then launched it and rolled a Persia start (Persia starts are imo the best option for testing this, I immediately see if Immortals and Archers are there as they should be and can check on the F9 screen if the Temple of Solomon or Kukulkan exists and it doesn't take too long to load) to verify that everything should be as it was, and it was. I then added every file I made changes to one by one (that is I overwrote the version in the folder with my own), after every addition restarting the game and rolling another Persia start to see if the issue reappeared.

The good news is that I found out that "CIV4BuildingInfos.xml" seems to be the culprit for the Temple of Kukulkan issue. The bad news is that I don't know what exactly in that file is causing it. Guess I'll compare the Git version with mine and see what the differences are...


With 1.13.1 some XML entries were reordered. If you are using any version after that, you can just use the Consts.py file that comes with it and then edit it to reflect your own XML changes.

Or I could stop being an idiot and maybe actually pay attention to your advice. :lol:
 
Wait a minute...

With 1.13.1 some XML entries were reordered. If you are using any version after that, you can just use the Consts.py file that comes with it and then edit it to reflect your own XML changes.

I assume this is just about the order of each XML entry (like in the reordering of Great Palace to right after Palace, where before Walls was the first building after Palace), and not the actual properties (as in removing health from Smokehouse and giving it food instead), right? Because I never reordered anything, so for this purpose the order of every XML entry would be exactly the same as in 1.13.0, with the exception of the three units for which I accounted. How come then I can't just use the Consts.py file from 1.13.0 if that actually does reflect the order of everything far better than the one from Git? And I tried, every time I try starting a game I get the "You have been defeated!!!!" message. I even changed iArtillery to iTechArtillery, accounted for my units and changed iStonehenge to iPyramid or vice versa.

*several attempts of tweaking later*

Strange, for some reason "my" (1.13.0) Consts.py had several linebreaks in the unit block where I assume only a space was supposed to be. After fixing that suddenly everything seems to be working fine. No "You have been defeated!!!!!" popup, no Impis and Skirmishers instead of Immortals and Archers for Persia, no Temple of Kukulkan in the Levant, huh. Weirldly enough those weird line breaks were in the 1.13.0 release version of DoC already and not something I introduced, so how come this only led to problems just now? :confused:

I am still highly suspicious that this won't be the end of it. There's gotta be more to it than that.
 
You still could clarify which version you're trying to base your modmod on.

Also, when modding, enable Python exceptions (see Bug Reports OP), this way you get meaningful information about Python errors instead of only the you have been defeated message.
 
You still could clarify which version you're trying to base your modmod on.

Also, when modding, enable Python exceptions (see Bug Reports OP), this way you get meaningful information about Python errors instead of only the you have been defeated message.

Git, from this morning, with all the (XML) files I changed still from 1.13.0 because I can't be bothered to make the exact same changes again because someone didn't like the way things were ordered.
 
Okay. Just use WinMerge to merge your XML changes/additions into the current DoC XML. If you make XML additions, edit the Python constants accordingly.

If you try to use a shortcut around any of these, you're on your own.
 
Alright, fine, I'll do that since apparently now I can't build Notre Dame as France. Whatever caused that reordering anyway? Or rather whatever was the tangible benefit?
 
UBs grouped by building type, wonders ordered by technological appearance.
 
I have deleted my old fork and created a new one. Hopefully, this will resolve all problems with the log. I hope this doesn't cause any troubles because it's in the middle of a pull request.
 
It shouldn't. Just a heads up for the future, I know it's convenient to continue using the same branch for subsequent pull requests, but you can never be sure if I haven't changed the commit history while merging (e.g. squashing multiple commits into one), or made other minor changes. This can result in all commits showing up again in the request, and I have to squash them again. The best thing is to forget your branch ever existed after its been merged. You can get to the same state by branching off the main repository again.

And there I recommend using rebase. If your update process ever prompts you to make a merge commit there is a better way.
 
Potentially dumb question, but are there more civilizations in DoC than there are slots for active civilizations? Currently in my modmod scenario, I have the following civs active:

  • China
  • Persia (Iran)
  • Korea
  • Japan
  • Maya (Colombia)
  • Vikings (Sweden)
  • Spain
  • France
  • England
  • Holy Rome (Austria)
  • Russia
  • Poland
  • Italy
  • Portugal
  • Inca (Peru)
  • Aztecs (Mexico)
  • Turkey
  • Netherlands
  • Thailand
  • Germany
  • America
  • Argentina
  • Brazil
  • Canada

I tried to activate Greece, and it caused the late Trading Company and colony methods to raise an index out of range exception. I am also considering adding Ethiopia and Morocco to the scenario, but from the looks of it I have reached the civ cap?
 
So I am currently in the process of using Winmerge to, well, merge my files, and was wondering what's up with all the .bak files it keeps leaving behind? Can I delete them without risk?
 
Potentially dumb question, but are there more civilizations in DoC than there are slots for active civilizations? [...]

I tried to activate Greece, and it caused the late Trading Company and colony methods to raise an index out of range exception. I am also considering adding Ethiopia and Morocco to the scenario, but from the looks of it I have reached the civ cap?
Nope, all scenarios have the same number of slots (so as 3000 BC, enough for all civs, discounting respawns). Slots are also immediately tied to civilizations.

What exactly did you do to enable another civilization? What did the error message say?

So I am currently in the process of using Winmerge to, well, merge my files, and was wondering what's up with all the .bak files it keeps leaving behind? Can I delete them without risk?
Yes, they are backups from before the merge. I think you can turn off their automatic creation, it's on by default for some reason.
 
Back
Top Bottom