Modmodding Q&A Thread

Is there a guide for the City Name Manager? I made some changes in CMC to do with the new tiles in Anatolia and the cities on said tiles are never renamed.
 
Is there a guide for the City Name Manager? I made some changes in CMC to do with the new tiles in Anatolia and the cities on said tiles are never renamed.

Are these new names? Because to add a new city name, there are three steps:
  • Add it in the city name found map. This is the identifier.
e.g. in Byzantine settler map: ...,"-1","Konstantinoupolis","-1","-1","-1",...​
  • Assign renames to an identifier. This is in the dIdentifiers variable.
e.g.
"Konstantinoupolis" : "Konstantinoupolis",
"Byzantion" : "Konstantinoupolis",
"Kostantiniyye" : "Konstantinoupolis",
"Constantinopolis" : "Konstantinoupolis",
"Tsar'grad" : "Konstantinoupolis",​
  • Specify the renames for each city language using an identifier.
e.g.
# Language: Byzantine
"Konstantinoupolis" : "Konstantinoupolis",
...
# Language: Roman
"Konstantinoupolis" : "Constantinopolis",
...
# Language: Russian
"Konstantinoupolis" : "Tsar'grad",
...
# Language: Turkish
"Konstantinoupolis" : "Kostantiniyye",​
 
Althoug I have the requirements to build a wonder, building option isn't just deactivated, it isn't available at all.
What might be wrong?
 
Which wonder?
 
Do you have the right religions including state religion?
 
Do you have the right religions including state religion?
Hinduism as state religion, both hinduism and buddhism are present in the city.
 
I am working on a mystery new civ!

I'd like to give them a UP that allows them to build certain units without having access to the required strategic resource. The brute-force solution is to create, for every affected unit, a unique unit that looks identical but does not require the resource. Does anyone know of a more elegant solution?

Also, what are people's preferred strategies to edit the SettlerMaps and WarMaps?
 
I am working on a mystery new civ!

I'd like to give them a UP that allows them to build certain units without having access to the required strategic resource. The brute-force solution is to create, for every affected unit, a unique unit that looks identical but does not require the resource. Does anyone know of a more elegant solution?

Also, what are people's preferred strategies to edit the SettlerMaps and WarMaps?
CvPlot::canTrain > if (GC.getUnitInfo(eUnit).isPrereqBonuses())
 
Also, what are people's preferred strategies to edit the SettlerMaps and WarMaps?

I use the WB editor. What you see is what you get. You only have to copy-paste the map into the correct file.

Or do you mean the strategy to decide which tiles should be historical or not?
 
Where in the code should I look if I wish to disable nuclear meltdowns during a certain period of time for a specific civ?
 
doNuclearMeltdown in CvRandomEventsInterface.py.
 
Another question: Where does one edit the areas that are shown in the tooltip for UHV purposes? E.g. tiles showing as "Mesopotamia" when playing as Greece, etc.

EDIT: Also, I am adding a new wonder, but the game crashes when I try to select it in a city (or when construction should start after finishing the previous item). The button and civilopedia entry work fine, and I am fairly confident I incremented the numbers of buildings in the right places—anyone has an intuition of what might be going wrong?
 
Last edited:
Another question: Where does one edit the areas that are shown in the tooltip for UHV purposes? E.g. tiles showing as "Mesopotamia" when playing as Greece, etc.

EDIT: Also, I am adding a new wonder, but the game crashes when I try to select it in a city (or when construction should start after finishing the previous item). The button and civilopedia entry work fine, and I am fairly confident I incremented the numbers of buildings in the right places—anyone has an intuition of what might be going wrong?

If I recall correctly, it has to be defined in the DLL constants too. (Am I right? Please correct me if I'm wrong.)
 
Ugh, Multi-Quote seems broken. Stupid new forum layout.

To the person asking about UHV era tooltips: Read the last page, I asked the same question and received two answers.
 
Another question: Where does one edit the areas that are shown in the tooltip for UHV purposes? E.g. tiles showing as "Mesopotamia" when playing as Greece, etc.

EDIT: Also, I am adding a new wonder, but the game crashes when I try to select it in a city (or when construction should start after finishing the previous item). The button and civilopedia entry work fine, and I am fairly confident I incremented the numbers of buildings in the right places—anyone has an intuition of what might be going wrong?

UHV tooltip: Python/Entrypoints/CvScreenInterface.py @ getUHVTileInfo(). The text key is in XML/Texts/Regions.xml

Does the button path of the wonder art start with a comma? It shouldn't. (Unless you are using a button atlas, but I assume you don't.)
 
UHV tooltip: Python/Entrypoints/CvScreenInterface.py @ getUHVTileInfo(). The text key is in XML/Texts/Regions.xml

Does the button path of the wonder art start with a comma? It shouldn't. (Unless you are using a button atlas, but I assume you don't.)
Thanks, these two items solved my questions.

To the person asking about UHV era tooltips: Read the last page, I asked the same question and received two answers.
I should probably not ask questions here when I'm tired and actually put some effort into looking for answers...

CvPlot::canTrain > if (GC.getUnitInfo(eUnit).isPrereqBonuses())
Thanks, that seems to be what I am looking for. However, the code is rather confusing—I understand the general structure of the code (if any condition for unit training is not met, return false), but there are many if-statements in there that seem related to bonuses. Have you done something like what I'm trying to do? I'm trying to solve it on my own, but if somebody has experience with disabling resource requirements for specific units/civs, I'd be very grateful. I guess my main concern is that I often don't know what's possible and what's not when editing C++ code. For instance, how do I reference specific units?
 
Actually the isPrereqBonuses part is not what you are looking for, and I'm not even sure what that does. Basically anything that follows
Code:
if (GC.getUnitInfo(eUnit).getPrereqAndBonus() != NO_BONUS)
is about resource requirements. It's a bit more complicated to check because there are various combinations of possible "and" and "or" conditions. But you can wrap the whole thing in a "if (getOwner != MYSTERYCIV)" and it should be fine.
 
Actually the isPrereqBonuses part is not what you are looking for, and I'm not even sure what that does. Basically anything that follows
Code:
if (GC.getUnitInfo(eUnit).getPrereqAndBonus() != NO_BONUS)
is about resource requirements. It's a bit more complicated to check because there are various combinations of possible "and" and "or" conditions. But you can wrap the whole thing in a "if (getOwner != MYSTERYCIV)" and it should be fine.
Thanks, it worked! Though I'd like to restrict the UP to melee units only. Any idea how? I tried
Code:
if (getOwner() != MYSTERYCIV || GC.getUnitInfo(eUnit).getUnitClassType() != 1)
where 1 is supposed to represent the melee class, but no luck. (Note: I'm really tired right now so it might be a stupid logic mistake I do not have the cognitive capacities to detect.)

EDIT: I am indeed tired enough that I mistakenly wrote the name of the mystery civ in the code, I wonder if anyone saw it ;) (Not that it's going to be secret much longer)
 
Last edited:
Top Bottom