Quick Modding Questions Thread

Last edited:
You have the right constant: it defines how much production one population point is "worth" when using it to draft a unit. The expended population needs to cover the production cost of the unit, i.e. [unit cost] / CONSCRIPT_POPULATION_PER_COST.

(It should probably be named COST_PER_POPULATION...)
 
If I wanted to make two separate civics options not allowed to be used together [for example, free speech and theocracy], what would I have to do to block one being used w the other?
Edit the dll.
AND2 has such dll changes. If you know what you are doing you can mine it out.

I'm not sure but I think it should also be possible via python.

But if you're looking for some easy XML change than the bad news is that such does not exist.
 
XML does not support implementing this rule, but you can do it in Python. The DLL calls the cannotDoCivic function when checking if you can select a civic. You can implement it in Assets/Python/EntryPoints/CvGameInterface.py. If the function returns true, the civic is not allowed. So you can check whether its counterpart is already in use and disallow the other.

It's possible that you have to also enable something like USE_CANNOT_DO_CIVIC_CALLBACK in the XML defines. I only have a BUG code base on hand where this is required, but it's possible that the base game does not require this setting.
 
I am wanting to double the movement cost of desert; yet in the XML there terraininfos for desert, there is only imovement which seems to be set to 0 or 1. Then, when I check featureinfos, there is only oasis for desert, which is set at 2. How can I apply this to desert, as well?
 
You can just set iMovement to 2 for the terrain as well.
 
I don't know, I am not familiar with the details of map scripts.
 
Ok; great, thanks for the help with those. One additional thing I'd like is for the random maps to place Iron more often than it currently does. What can I change to increase it on the map, say 25%?
I think it can be done in xml by increasing some weight for the bonus, but I can't remember the details.
 
I think it can be done in xml by increasing some weight for the bonus, but I can't remember the details.
The only thing I see, so far, is in Civ4ImprovementInfos; where there are bonus aluminum, coal, copper, gems, gold, iron, silver, uranium --- and the iDiscoverRand is set to 1000 for each. Is this what you're referring to? If so, do you have any suggestions on changing the discoverRand figure of 1000 for iron?
 
The only thing I see, so far, is in Civ4ImprovementInfos; where there are bonus aluminum, coal, copper, gems, gold, iron, silver, uranium --- and the iDiscoverRand is set to 1000 for each. Is this what you're referring to? If so, do you have any suggestions on changing the discoverRand figure of 1000 for iron?
No, that's the chance of an improvement discovering the resources if the tile is worked by a city.
What you need is iConstAppearance
Use the modified for information like this:
 
iDiscoverRand controls the chance for an improvement to randomly discover a resource on their tile, e.g. when you sometimes randomly discover gold on a tile with a mine on it.
 
Back
Top Bottom