ZabMilenko
Warlord
Hello all. This post is going to be my continual saga of finding nifty things to mod in Civ4. I intend on updating it every few days or so until my mod program is complete. Hope someone finds a gem in the rubble here.
(NOTE: There are lots of mod posts here so I didnt touch on the basic stuff. If you are serious about modding then you'll do what alot of us do: open every file one at a time and see whats in it.)
ARRRGGHHH! Where in the heck is CyGlobalContext() defined?!?!
In Assets\CvGameCore.dll. Sorry.
What is the Victory Test?
The game will constantly check to see if any of the civs have won. This event is called the "Victory Test". In Civ3 you could win in the first turn with a bit of an exploit. It looks like Civ4 doesnt do its first Victory Test until you have played 10 complete turns. What if you want to change this?
Open up Assets\Python\CvGameUtils.py and text search for "isVictoryTest" (around line 17 for the default file). You will see the following line:
if ( gc.getGame().getElapsedGameTurns() > 10 ):
Change 10 to whatever you want it to be. I couldnt tell you what the best value is, but someday, SOMEBODY will want to know this.
Where do I find the "## Turns Left!" text at?
The file you want is Assets\XML\Text\CIV4GameTextInfos.xml. Search in this file for the string "TXT_KEY_MISC_TURNS_LEFT". The default block looks like this:
<TEXT>
<Tag>TXT_KEY_MISC_TURNS_LEFT</Tag>
<English>%d1 [NUM1:Turn:Turns] Left!</English>
<French>Il reste %d1 [NUM1:tour:tours] !</French>
<German>Noch %d1 [NUM1:Runde:Runden]!</German>
<Italian>%d1 [NUM1:turno rimasto:turni rimasti]!</Italian>
<Spanish>[NUM1:Queda:Quedan] %d1 [NUM1:turno:turnos]</Spanish>
</TEXT>
Before you go nuts, be a little careful. First: dont change the %d1 part. The word "Turn" and "Turns" are singular and plural forms and are automatically selected based on your current turns (NUM1 appears to be a function). Here is a valid string: You are down to %d1 [NUM1:Turn:Turns]
Can I edit the "## Turns Left!" string to appear earlier or later?
I can't find it yet. There is only one reference to TXT_KEY_MISC_TURNS_LEFT in the python that I could find, and it's in Assets\Python\CvVictoryScreen.py. This is for the Victory Conditions page (press F8). I searched the DLL for the function reference from CyGlobalContext() and found it, but still no MISC_TURNS_LEFT reference.
If anyone finds it, PLEASE let me know!
The city name seems to be limited to 15 characters...
Well, if you increase the limit you could break something. It seems that Civ4 allows city names up to 30 characters, but for some reason the popup limits you to 15 characters. If you want adjust the popup window to allow more characters to be entered you got a couple of things to do:
1) Open up Assets\Python\CvEventManager.py and search for "__eventEditCityNameBegin" (around line 755). A few lines later you will see a line that says "popup.setEditBoxMaxCharCount( 15 )". If you cant figure out the next part, then why are you reading this!?!
2) Let me know your results
Ooooh! The leaderheads are so cool! How could I control the facial expressions? (Advanced)
If you must know, then pop open Assets\Python\CvDiplomacy.py and search for "performHeadAction" (default line 323). There is a huge if/elif block here that changes the leaderhead position based on attitudes. You can adjust these if you wish.
More to come..
(NOTE: There are lots of mod posts here so I didnt touch on the basic stuff. If you are serious about modding then you'll do what alot of us do: open every file one at a time and see whats in it.)
ARRRGGHHH! Where in the heck is CyGlobalContext() defined?!?!
In Assets\CvGameCore.dll. Sorry.
What is the Victory Test?
The game will constantly check to see if any of the civs have won. This event is called the "Victory Test". In Civ3 you could win in the first turn with a bit of an exploit. It looks like Civ4 doesnt do its first Victory Test until you have played 10 complete turns. What if you want to change this?
Open up Assets\Python\CvGameUtils.py and text search for "isVictoryTest" (around line 17 for the default file). You will see the following line:
if ( gc.getGame().getElapsedGameTurns() > 10 ):
Change 10 to whatever you want it to be. I couldnt tell you what the best value is, but someday, SOMEBODY will want to know this.

Where do I find the "## Turns Left!" text at?
The file you want is Assets\XML\Text\CIV4GameTextInfos.xml. Search in this file for the string "TXT_KEY_MISC_TURNS_LEFT". The default block looks like this:
<TEXT>
<Tag>TXT_KEY_MISC_TURNS_LEFT</Tag>
<English>%d1 [NUM1:Turn:Turns] Left!</English>
<French>Il reste %d1 [NUM1:tour:tours] !</French>
<German>Noch %d1 [NUM1:Runde:Runden]!</German>
<Italian>%d1 [NUM1:turno rimasto:turni rimasti]!</Italian>
<Spanish>[NUM1:Queda:Quedan] %d1 [NUM1:turno:turnos]</Spanish>
</TEXT>
Before you go nuts, be a little careful. First: dont change the %d1 part. The word "Turn" and "Turns" are singular and plural forms and are automatically selected based on your current turns (NUM1 appears to be a function). Here is a valid string: You are down to %d1 [NUM1:Turn:Turns]
Can I edit the "## Turns Left!" string to appear earlier or later?
I can't find it yet. There is only one reference to TXT_KEY_MISC_TURNS_LEFT in the python that I could find, and it's in Assets\Python\CvVictoryScreen.py. This is for the Victory Conditions page (press F8). I searched the DLL for the function reference from CyGlobalContext() and found it, but still no MISC_TURNS_LEFT reference.
If anyone finds it, PLEASE let me know!
The city name seems to be limited to 15 characters...
Well, if you increase the limit you could break something. It seems that Civ4 allows city names up to 30 characters, but for some reason the popup limits you to 15 characters. If you want adjust the popup window to allow more characters to be entered you got a couple of things to do:
1) Open up Assets\Python\CvEventManager.py and search for "__eventEditCityNameBegin" (around line 755). A few lines later you will see a line that says "popup.setEditBoxMaxCharCount( 15 )". If you cant figure out the next part, then why are you reading this!?!
2) Let me know your results

Ooooh! The leaderheads are so cool! How could I control the facial expressions? (Advanced)
If you must know, then pop open Assets\Python\CvDiplomacy.py and search for "performHeadAction" (default line 323). There is a huge if/elif block here that changes the leaderhead position based on attitudes. You can adjust these if you wish.
More to come..