planetfall
Nov 28, 2006, 10:20 AM
I expected the number of initial starting units to be in the xml files, but I can't find them for some reason. Some civs have warriors and some have scouts at the start. I was thinking of changing the starting number of units for some civs. Is this an XML or PY thing, or is it CPP?
Thanks
Eusebius
Dec 06, 2006, 11:35 PM
I expected the number of initial starting units to be in the xml files, but I can't find them for some reason. Some civs have warriors and some have scouts at the start. I was thinking of changing the starting number of units for some civs. Is this an XML or PY thing, or is it CPP?
Thanks
http://forums.civfanatics.com/showthread.php?t=135930 seems to speak about numbers.
Some experimentation leads me to the theory that you start with the most advanced military unit that you have the technology for. For example, I changed
<PrereqTech>TECH_ROCKETRY</PrereqTech>
to
<PrereqTech>NONE</PrereqTech>
for UNIT_SAM_INFANTRY and my civilization started life with one of those. Forgot to check if the AIs did too.
I think Civ4HandicapInfo.xml may have something to do with how many units AI start with, but that is only a guess.
I'd love to hear what you discover.
Cheers,
Eusebius
tdphippsii
Dec 07, 2006, 02:08 AM
it is in the xml files goto civilization.xml scroll down when u see the settler unit then add another unit there i did that i used it for a worker unit and got it
Edgecrusher
Dec 07, 2006, 04:49 AM
I think the question is what determines getting a Scout vs a Warrior. Ive noticed that the only "free unit" that civs have is the Settler. Yet they all start with a Settler + 1 warrior or 1 scout.
asioasioasio
Dec 07, 2006, 05:03 AM
Yep and the scout / warrior (i already don't have this units in my mod - they are replaced by muchine gunner :)) depends on the best available unit so if you add to the nation two techs hunting and archery the nation will start with archer - i don't where setup this - for example if i want to make only settler in beginning i don't know where to delete it
Sto
Dec 07, 2006, 07:36 AM
You should look at CvPlayer::initFreeUnits() and CvPlayer::addFreeUnitAI into CvPlayer.cpp . The quality and number of free units depend of Era and Handicaps settings .
For ancient game , it's set 1 explore unit in the era infos : -> the function will search for the best explore unit you can train with CvPlayerAI::AI_unitValue into CvPlayerAi.cpp . So if you have hunting you get a scout , and you get a warrior if this the only unit you can train even if it's not an explore unit .