1) Should be easily doable in the SDK.A number of questions I have about Civ 4 modding.
1. Is it possible to put a maximum limit on how much experience units can gain from combat? (Such that for example a unit can gain up to 50 points, but no more)
2. Is it possible to make resources in Civ4 quantitative? (like how it is in Civ5). Such that a resource would have 3 or 10 or 100 of it in one tile, and they'd be used per unit or something, as opposed to having 1 resource provide for your entire nation no matter how big you are. (I understand this likely requires SDK modding, and that's fine, just wondering if its possible.)
3. Is it possible to change golden ages so that a GA gives a % boost to gold and hammer production as opposed to adding 1 to existing tiles?
4. Is it possible to add additional "yield types"? so, other than food, gold, and hammers, getting a new type of yield into the game.
Thanks for any feedback.
if (GET_PLAYER(getOwnerINLINE()).isGoldenAge())
if (eIndex == (YieldTypes)1 || eIndex == (YieldTypes)2) //hammers and commerce
iModifier += 10 // for a 10% increase
Spoiler :Hi
I'm playing RevDCM and I want to make a small change to the ai to address something I see as a weakness in the ai's play. The situation is where the Ethiopians say, have just captured a couple of cities off the French and have made them a vassal. In this situation a human player may well just liberate the captured cities back to the French rather than try and deal with the inevitable revolution problems. This then frees your army to go off and attack someone else. However the computer always stubbornly tries to hold onto them, often resulting in a revolution and a renewed war against someone he has already beaten.
So I want the ai to do a common sense check once it's made someone a vassal, that basically asks 'have I captured any cities'? If so, am I better off liberating those cities to my vassal? So the check could be for example if any of the cities have >75% nationality of the vassal, and are much further away than the average of ai's main cities. If the answer is yes to both, then the Ethiopians would just liberate the cities straight away, rather than get into an endless cycle of revolutions and war.
I think this would improve the ai's standard of play. Would such a check be easy to insert? Can anyone give me any pointers as to what code I would need to insert and where? I presume it would slot somewhere in CvPlayerAI?
For context, after reading some of excellent guides on this website, I can just about create a new dll, but I'm struggling with writing code and working out how to fix the above problem.
Thanks in advance for any advice.
Basically, here in this function you can write the code to make the decision for the AI. It could go something like this:
- A "for loop" that loops through each player in the team
- If the player is not human (!isHuman()) then...
- A "for loop" that loops through each of that player's cities
- If the city meets the conditions you specified: "if any of the cities have >75% nationality of the vassal, and are much further away than the average of ai's main cities"
- Then "liberate" that city (call the liberate function in CvCity)
but I'm a little confused with how I "call the liberate" function for any city passes those tests.![]()
Was 100 too. I've now simply copied everything from the Knight entry and added all UU bonuses again; oddly enough, it worked afterwards. I'd rather know what caused this but at least now the problem's gone.What about iCombatLimit?