So as you may recall, last week’s goal was to modify any aspect of Civilization V and have it actually show up in the game. You might also remember that I’d picked CiV as the first game I’d try my hand at because I thought I’d be easy.
It was. Firaxis, the developers of CiV, have released a fairly powerful modding tool program for CiV on Steam which made it painless to inject my code into the game. This made it easy to alter the XML that makes up the game’s structure. It’s not Python like I thought, but the tags are for the most part pretty self-explanatory.
For the most part, just looking at the code from the base game was enough to work out how the different lines interacted and so I quickly figured out exactly what I needed to change to make Dongs Washington the glorious reality I had dreamed of, all that week ago.
To actually edit the code properly, I found a Modder’s Guide written by one Kael on the CivFanatics forum. Almost everything I found searching for CiV modding help pointed to it and it was indeed extremely helpful! In no time at all I had this:
Even a non-coder might be able to figure that screenshot out, but here’s the brief explanation. Every time the game uses its internal tags (e.g. TXT_KEY_LEADER_WASHINGTON) to refer to the name of the Civ’s leader, it looks it up in the Language_en_US section of the GameData. What I’ve done is told the game to update the text associated with the tag to read differently, in this case instead of displaying “Washington” when the tag is called, it’ll display the updated text “Dongs Washington”.
The America Improvement Overhaul mod is complete and ready to be added to a game! Alright, this isn’t a complete overhaul – there’s a lot of references to “Washington” and “America” in the game – but I figured as a proof of concept I didn’t really need to trawl through and catch every single line! And so…
….and it didn’t work, I just got regular old America. On closer reading of Kael’s guide I realized I’d forgotten a fairly important step: telling the game what to actually do with the file. I had the code correct* but the game wasn’t using it, because I hadn’t told it how! Luckily, that’s a simple fix and shortly:
That was simple enough, so it’s time to raise the bar for next time:
GOALS FOR WEEK 2
- Add a completely new civilization to the game
- It will have a Unique Trait, Building and Unit
- It will also have a custom leader and emblem
Hopefully this ends up as a well-thought out addition that isn’t out of place with the existing civs, but I promise nothing, especially as I’m working with MS Paint for the art side. Dongs Washington may ride again….
*mostly, anyway. The eagle-eyed will notice there’s a completely irrelevant line I forgot to delete from the copy-pasting of the original America code.