Arkaeyn
King
I'm currently working on a mod to update the way that city naming in Civilization works. My goals include
1) having the same cities foundable by different civilizations.This is easily accomplished in XML if the cities have the same name. Civ won't add a duplicate name of the same city. So the Greeks will build Thebes if the Egyptians aren't in the game.
2) changing city names upon conquest. For example, if the Greeks capture Roman Constantinople, they change the name to Byzantium. This is easily accomplished using Python (the code is in the Greekworld.py) So far so good.
This is where the problems come in: combining the XML and the Python.
Example: I want the Romans and the French to be able to found the same city - Masillia/Marseille, and if one founds it first, the other cannot. However, since it's a different name, I can't use the simple XML duplication. I could use Python, but the city name list is XML.
My theoretical solution, not knowing much Python, is to create a variable for city names, which equals one thing for Romans, and another for French. But I'm not certain if this will work, given that the names themselves are in XML, but the name changing code is in Python.
So basically, my question to the skilled modders out there: Is it possible to move city naming into Python? or to use variables in XML? or to make XML and Python work together in this case to accomplish what I want?
1) having the same cities foundable by different civilizations.This is easily accomplished in XML if the cities have the same name. Civ won't add a duplicate name of the same city. So the Greeks will build Thebes if the Egyptians aren't in the game.
2) changing city names upon conquest. For example, if the Greeks capture Roman Constantinople, they change the name to Byzantium. This is easily accomplished using Python (the code is in the Greekworld.py) So far so good.
This is where the problems come in: combining the XML and the Python.
Example: I want the Romans and the French to be able to found the same city - Masillia/Marseille, and if one founds it first, the other cannot. However, since it's a different name, I can't use the simple XML duplication. I could use Python, but the city name list is XML.
My theoretical solution, not knowing much Python, is to create a variable for city names, which equals one thing for Romans, and another for French. But I'm not certain if this will work, given that the names themselves are in XML, but the name changing code is in Python.
So basically, my question to the skilled modders out there: Is it possible to move city naming into Python? or to use variables in XML? or to make XML and Python work together in this case to accomplish what I want?