Starting with a scout unit instead of a warrior?

Actos

Chieftain
Joined
Jan 24, 2015
Messages
1
Hey guys,

I created a civilization and I want to start a game with a scout unit instead a warrior unit (Like the Shoshones), but I can't figure out how I can do this. Can anyone help me?

Thanks!
 
hello Actos,

it is defined in the xml file CIV5Eras.xml

for your purpose the code would be like this :

Code:
<Eras>
		<Update>
			<Set StartingDefenseUnits="0" />
			<Where Type="ERA_ANCIENT" />
		</Update>
		<Update>
			<Set StartingExploreUnits="1" />
			<Where Type="ERA_ANCIENT" />
		</Update>
		
	</Eras>
 
hello Actos,

it is defined in the xml file CIV5Eras.xml

for your purpose the code would be like this :

Code:
<Eras>
		<Update>
			<Set StartingDefenseUnits="0" />
			<Where Type="ERA_ANCIENT" />
		</Update>
		<Update>
			<Set StartingExploreUnits="1" />
			<Where Type="ERA_ANCIENT" />
		</Update>
		
	</Eras>
It would apply to all civs in the example code shown, not just a specific one. I did a quick look yesterday for the Shoshone deal but couldn't see where the re-direct from a starting warrior to a starting scout-class unit was being made for them.
 
The game calculates which of the units available for a civ is the "best" defense unit (which means the highest production cost, doubled in case the default AI type is UNITAI_DEFENSE). See CvPlayer.cpp, CvPlayer::addFreeUnitAI function.

For the Shoshone, their version of the Scout is "better" than a Warrior, because it has a higher production cost (45 vs 40). Units that have UNITAI_DEFENSE as their default AI type have their value doubled, but neither of these units has it (for the Warrior it's UNITAI_ATTACK, and for the Shoshone Pathfinder it's UNITAI_EXPLORE). Both units have UNITAI_DEFENSE defined in Unit_AITypes, so they are eligible to be chosen.

If you want to control which civs get which units, the only solution I can think of is setting the StartingDefenseUnits in Eras to 0 for ERA_ANCIENT, and adding starting units for all civs in Civilization_FreeUnits.
 
My bad you're right LeeS, I didn't notice that it should apply to one Civ.

Never answer a post before the 1. coffee of the day :)
 
Top Bottom