Modmodding Q&A Thread

That's a superfluous redundancy if I have ever seen one.
Merely an extraneous irrelevancy to demonstrate my manifest learning in lettered literacy.
 
Trying to make a 300AD scenario everything works fine except autoplaying.
A settler and a milita spawns in the capital plot from the start and then you are forced to play with them.
However, when the spawn date comes all your units and cities are autokilled and you respawn normally.
You can kill the two starting units, and then autoplaying works normally.
I found the function that spawns these two units, but when I deactivate it you lose.

However, when I open the old 600AD scenario it works normally, even though the python is drastically changed!

Any idea how to fix it?
 
Have you defined the scenario start turn correctly in Python?
 
I can't seem to figure out the CityNameWizard. In my modmod there is a preplaced city in Crete (on the tile that is not Wine), Independent in 3000BC, Byzantine in 600AD, Ottoman in 1700AD, named Knossos in the first two and Heraklion in the last scenario. In CityNameWizard.py in the Arabian section here

Code:
    'Purushapura'        :    'Peshawar',
    'Indraprastha'        :    'Delhi',
    'Chandax'        :    'Rabd al-Handaq',
    'Candia'        :    'Rabd al-Handaq',
    'Iraklion'        :    'Rabd al-Handaq',
    'Heraklion'        :    'Rabd al-Handaq',
    'Kandiye'        :    'Rabd al-Handaq',
    'Barcelona'        :    'Barshiluna',
    'Barcelone'        :    'Barshiluna',
    'Barcino'        :    'Barshiluna',

I added

Code:
    'Purushapura'        :    'Peshawar',
    'Indraprastha'        :    'Delhi',
    'Chandax'        :    'Rabd al-Handaq',
    'Candia'        :    'Rabd al-Handaq',
    'Iraklion'        :    'Rabd al-Handaq',
    'Heraklion'        :    'Rabd al-Handaq',
    'Kandiye'        :    'Rabd al-Handaq',
    'Knossos'        :    'Rabd al-Handaq',
    'Barcelona'        :    'Barshiluna',
    'Barcelone'        :    'Barshiluna',
    'Barcino'        :    'Barshiluna',

in the hopes that on the Arabian flip of Knossos the city would be renamed to Rabd al-Handaq, but that didn't happen. In all my attempts the city just kept its old name Knossos. What am I missing?
 
Have you defined the scenario start turn correctly in Python?
I have replaced all 600AD in python with 300AD in Python.
But in what file do you refer to?
 
Maybe for the 600 AD scenario there shouldn't be a city of Heraklion? I was looking up info about the names for it out of my own interest and according to Wikipedia it was founded in 824 by the Arabs, before which the site may have been a port for Knossos, but there is no archaeological evidence for that.
There was also a Roman colony: Colonia Julia Nobilis Cnossus, founded in 27 BCE. But I was unable to find out what happened to that after the collapse of the Roman Empire.
Mainly though, it shouldn't be called Heraklion/Irakleio, or any variant of that name, in any scenario, as that was the name given to it by the British around 1900.
 
I can't seem to figure out the CityNameWizard. In my modmod there is a preplaced city in Crete (on the tile that is not Wine), Independent in 3000BC, Byzantine in 600AD, Ottoman in 1700AD, named Knossos in the first two and Heraklion in the last scenario. In CityNameWizard.py in the Arabian section here

Code:
    'Purushapura'        :    'Peshawar',
    'Indraprastha'        :    'Delhi',
    'Chandax'        :    'Rabd al-Handaq',
    'Candia'        :    'Rabd al-Handaq',
    'Iraklion'        :    'Rabd al-Handaq',
    'Heraklion'        :    'Rabd al-Handaq',
    'Kandiye'        :    'Rabd al-Handaq',
    'Barcelona'        :    'Barshiluna',
    'Barcelone'        :    'Barshiluna',
    'Barcino'        :    'Barshiluna',

I added

Code:
    'Purushapura'        :    'Peshawar',
    'Indraprastha'        :    'Delhi',
    'Chandax'        :    'Rabd al-Handaq',
    'Candia'        :    'Rabd al-Handaq',
    'Iraklion'        :    'Rabd al-Handaq',
    'Heraklion'        :    'Rabd al-Handaq',
    'Kandiye'        :    'Rabd al-Handaq',
    'Knossos'        :    'Rabd al-Handaq',
    'Barcelona'        :    'Barshiluna',
    'Barcelone'        :    'Barshiluna',
    'Barcino'        :    'Barshiluna',

in the hopes that on the Arabian flip of Knossos the city would be renamed to Rabd al-Handaq, but that didn't happen. In all my attempts the city just kept its old name Knossos. What am I missing?
You have to use CityNameManager.py.

I have replaced all 600AD in python with 300AD in Python.
But in what file do you refer to?
In RFCUtils.py there is a getScenarioStartYear() method, you have to adjust that to 300 AD.
 
In RFCUtils.py there is a getScenarioStartYear() method, you have to adjust that to 300 AD.

def getScenarioStartYear(self):
lStartYears = [-3000, 300, 1700, 1910] #citis: add new scenarios
return lStartYears[self.getScenario()]

Yes I have done it, but problem remains...

Also, game turn corresponds to 305AD, not exactly 300AD.

EDIT: Bypassed with the help of a second catapult event, but it is an inelegant solution.
 
Last edited:
So your civilisation spawns after 300 AD in the 300 AD scenario, does it spawn before 300 AD in the 3000 BC scenario?
 
Maybe for the 600 AD scenario there shouldn't be a city of Heraklion? I was looking up info about the names for it out of my own interest and according to Wikipedia it was founded in 824 by the Arabs, before which the site may have been a port for Knossos, but there is no archaeological evidence for that.
There was also a Roman colony: Colonia Julia Nobilis Cnossus, founded in 27 BCE. But I was unable to find out what happened to that after the collapse of the Roman Empire.
Mainly though, it shouldn't be called Heraklion/Irakleio, or any variant of that name, in any scenario, as that was the name given to it by the British around 1900.
Its name is Knossos in all scenarios but 1700AD, and Heraklion was only supposed to be a placeholder until I figured out how this whole dynamic naming system works.
 
You have to use CityNameManager.py.
I did that, to no effect. I added

Code:
    'Knossos'        :    'Rabd al-Handaq',

at the end of the entry for the Arabian language, right before }. No change. I reverted all my changes in the Wizard, no effect. I remade the change in the Wizard, moved my line above the one for Iraklion in the Manager, no effect. I restarted the game and tried a new four turns of Arabia in 600AD after every change naturally. Knossos stubbornly refuses to change its name to Rabd al-Handaq upon joining Arabia no matter what I try.
 
Ignore the wizard, it is only an auxiliary script that is not used in the game at all.

The CNM system doesn't know any renames for Knossos right now. So what you need to have Knossos as the Greek name for the city and Rabd al-Handaq as the Arabic name is:

Decide on a "true" name for the city, it doesn't matter which. Let's say it's Knossos. Then, add Knossos -> Knossos and Rabd al-Handaq -> Knossos to dIdentifiers. This is where you tell the CNM what the true name for cities with this name is. Then, go to the respective rename entry for your languages, i.e. for Greek add Knossos -> Knossos, and for Arabic add Knossos -> Rabd al Handaq.

So the rename entries for the language dictate what the language calls a city given its "true" name, and dIdentifiers allows you to go back to the true name for each of these names.

Your example is a bit more complicated I think because you have a Knossos set of names and an Iraklion set of names, and at some point the name of the city is going to change (like for say Edo -> Toukyou). In that case, you have two "true" names (e.g. Knossos and Iraklion), each defining its own distinct behaviour. If I recall correctly, the set of renames around Iraklion is already in CNM, please look for that first.
 
Last edited:
hi
Let's say I wanted to change the Tibetans into the Khazars.
Just change their name, not their mechanics.
What should I do?
 
If you really only want to change the names, you can edit them in Assets/XML/Text/DynamicNames/DynamicNames_Tibet.xml. Which names are used (besides the default ones) is defined in Assets/Python/DynamicCivs.py.
 
Alright. This is what I found:
Spoiler :
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Tibet -->
<Civ4GameText xmlns="http://www.firaxis.com">
    <TEXT>
        <Tag>TXT_KEY_CIV_TIBET_DESC</Tag>
        <English>The Tibetans</English>
    </TEXT>
    <TEXT>
        <Tag>TXT_KEY_CIV_TIBET_PEOPLES</Tag>
        <English>Tibetan Peoples</English>
    </TEXT>
    <TEXT>
        <Tag>TXT_KEY_CIV_TIBET_DEFAULT</Tag>
        <English>Kingdom of %s1</English>
        <French>
            <Text>Royaume du %s1</Text>
            <Gender>Male</Gender>
            <Plural>0</Plural>
        </French>
        <German>
            <Text>K&#246;nigreich %s1:K&#246;nigreich %s1:K&#246;nigreich %s1</Text>
            <Gender>Neuter:Neuter:Neuter</Gender>
            <Plural>0:0:0</Plural>
        </German>
        <Italian>
            <Text>Regno del %s1</Text>
            <Gender>Male</Gender>
            <Plural>0</Plural>
        </Italian>
        <Spanish>
            <Text>Reino de %s1</Text>
            <Gender>Male</Gender>
            <Plural>0</Plural>
        </Spanish>
    </TEXT>
    <TEXT>
        <Tag>TXT_KEY_CIV_TIBET_FASCIST</Tag>
        <English>%s2 Empire</English>
        <French>
            <Text>Empire %s2</Text>
            <Gender>Male</Gender>
            <Plural>0</Plural>
        </French>
        <German>
            <Text>%s2 Reich:%s2 Reich:%s2 Reich</Text>
            <Gender>Neuter:Neuter:Neuter</Gender>
            <Plural>0:0:0</Plural>
        </German>
        <Italian>
            <Text>Impero %s2</Text>
            <Gender>Male</Gender>
            <Plural>0</Plural>
        </Italian>
        <Spanish>
            <Text>Imperio %s2</Text>
            <Gender>Male</Gender>
            <Plural>0</Plural>
        </Spanish>
    </TEXT>
    <TEXT>
        <Tag>TXT_KEY_CIV_TIBET_ADJECTIVE</Tag>
        <English>Tibetan</English>
    </TEXT>
    <TEXT>
        <Tag>TXT_KEY_CIV_TIBET_SHORT_DESC</Tag>
        <English>Tibet</English>
    </TEXT>
</Civ4GameText>
I suppose just changing every "Tibet" into "Khazaria" wouldn't work.
Spoiler :
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Khazaria -->
<Civ4GameText xmlns="http://www.firaxis.com">
    <TEXT>
        <Tag>TXT_KEY_CIV_TIBET_DESC</Tag>
        <English>The Khazarians</English>
    </TEXT>
    <TEXT>
        <Tag>TXT_KEY_CIV_TIBET_PEOPLES</Tag>
        <English>KhazarianPeoples</English>
    </TEXT>
    <TEXT>
        <Tag>TXT_KEY_CIV_TIBET_DEFAULT</Tag>
        <English>Kingdom of %s1</English>
        <French>
            <Text>Royaume du %s1</Text>
            <Gender>Male</Gender>
            <Plural>0</Plural>
        </French>
        <German>
            <Text>K&#246;nigreich %s1:K&#246;nigreich %s1:K&#246;nigreich %s1</Text>
            <Gender>Neuter:Neuter:Neuter</Gender>
            <Plural>0:0:0</Plural>
        </German>
        <Italian>
            <Text>Regno del %s1</Text>
            <Gender>Male</Gender>
            <Plural>0</Plural>
        </Italian>
        <Spanish>
            <Text>Reino de %s1</Text>
            <Gender>Male</Gender>
            <Plural>0</Plural>
        </Spanish>
    </TEXT>
    <TEXT>
        <Tag>TXT_KEY_CIV_TIBET_FASCIST</Tag>
        <English>%s2 Empire</English>
        <French>
            <Text>Empire %s2</Text>
            <Gender>Male</Gender>
            <Plural>0</Plural>
        </French>
        <German>
            <Text>%s2 Reich:%s2 Reich:%s2 Reich</Text>
            <Gender>Neuter:Neuter:Neuter</Gender>
            <Plural>0:0:0</Plural>
        </German>
        <Italian>
            <Text>Impero %s2</Text>
            <Gender>Male</Gender>
            <Plural>0</Plural>
        </Italian>
        <Spanish>
            <Text>Imperio %s2</Text>
            <Gender>Male</Gender>
            <Plural>0</Plural>
        </Spanish>
    </TEXT>
    <TEXT>
        <Tag>TXT_KEY_CIV_TIBET_ADJECTIVE</Tag>
        <English>Khazarian</English>
    </TEXT>
    <TEXT>
        <Tag>TXT_KEY_CIV_TIBET_SHORT_DESC</Tag>
        <English>Khazaria</English>
    </TEXT>
</Civ4GameText>
Is this alright?
 
Yeah, did you try it? Tibet should show up as "The Khazarians" in the scenario screen now, and if you start as them stuff like the tooltips would show their territory as Khazarian for example.
 
Did you define TXT_KEY_CIV_KHAZARIANS anywhere?
 
Oh right, there is a bit of trickery involved in the dynamic names system. You have renamed the short name of a civ, i.e. Tibet -> Khazaria. I use this short name as the default name for many dynamic name entries in the game without having to explicitly code them, i.e. the game knows that the civ is called Khazarians so it looks for TXT_KEY_CIV_KHAZARIANS.

In short, you just have to go ahead and add those TXT_KEYS with the proper desired text whenever they show up like this. In fact, it is probably cleaner to just change all references of TIBET to KHAZARIA. Most importantly, you can do so by editing XML/Civilizations/CIV4CivilizationInfos.xml. To make sure you don't miss anything, use a good text editor to search the entire mod folder for references to Tibet in the XML. For instance, you can use Notepad++ and its "seach in files" dialog.
 
Just a minor problem I ran into that has probably been asked a million times: How do you change the skins of the original civics/religions file? Every time I try to change the textures the file doesn't load and the default icons are there. I'm trying to reskin all the religion icons and so far only the standalone religion icons load (Zoroastrianism, Orthodoxy, Catholicism).
If it is needed here is a side-by-side comparison of my edits vs the original.
comp.png
 
Back
Top Bottom