Mercenary Army

formerdc81

Chieftain
Joined
Nov 19, 2018
Messages
53
If I want Foreign Legions to be purchaseable only by Mercenary Army in BNW, no matter the country, do I just copy the XML code for Landsknecht except for name and costs? Or do I have to make Foreign Legions their own unit class and unit like Landsknecht was changed in BNW to make it work?
 
The Foreign Legion has already been moved to its own unit-class:
Code:
		<Row>
			<Type>UNITCLASS_FOREIGNLEGION</Type>
			<Description>TXT_KEY_UNIT_FRENCH_FOREIGNLEGION</Description>
			<DefaultUnit>UNIT_FRENCH_FOREIGNLEGION</DefaultUnit>
		</Row>
The unit itself is re-defined for BNW as
Code:
		<Row>
			<Class>UNITCLASS_GREAT_WAR_INFANTRY</Class>
			<Type>UNIT_FRENCH_FOREIGNLEGION</Type>
			<PrereqTech>TECH_REPLACEABLE_PARTS</PrereqTech>
			<Combat>42</Combat>
			<Cost>320</Cost>
			<FaithCost>640</FaithCost>
			<RequiresFaithPurchaseEnabled>true</RequiresFaithPurchaseEnabled>
			<Moves>2</Moves>
			<CombatClass>UNITCOMBAT_GUN</CombatClass>
			<Domain>DOMAIN_LAND</Domain>
			<DefaultUnitAI>UNITAI_DEFENSE</DefaultUnitAI>
			<Description>TXT_KEY_UNIT_FRENCH_FOREIGNLEGION</Description>
			<Civilopedia>TXT_KEY_CIV5_INDUSTRIAL_FOREIGNLEGION_TEXT</Civilopedia>
			<Strategy>TXT_KEY_UNIT_FRENCH_FOREIGNLEGION_STRATEGY</Strategy>
			<Help>TXT_KEY_UNIT_HELP_FOREIGN_LEGION</Help>
			<MilitarySupport>true</MilitarySupport>
			<MilitaryProduction>true</MilitaryProduction>
			<Pillage>true</Pillage>
			<IgnoreBuildingDefense>true</IgnoreBuildingDefense>
			<ObsoleteTech>TECH_PLASTIC</ObsoleteTech>
			<GoodyHutUpgradeUnitClass>UNITCLASS_INFANTRY</GoodyHutUpgradeUnitClass>
			<AdvancedStartCost>35</AdvancedStartCost>
			<XPValueAttack>3</XPValueAttack>
			<XPValueDefense>3</XPValueDefense>
			<Conscription>6</Conscription>
			<UnitArtInfo>ART_DEF_UNIT_U_FRENCH_FOREIGNLEGION</UnitArtInfo>
			<UnitFlagIconOffset>55</UnitFlagIconOffset>
			<IconAtlas>UNIT_ATLAS_2</IconAtlas>
			<PortraitIndex>38</PortraitIndex>
		</Row>
which is actually a bit bizarre in that it imples the unit is assigned to two different unit-classes.

There's a Mercenary Army expanded mod which alters the Foriegn Legion as follows:
Code:
		<Update>
			<Where Type="UNIT_FRENCH_FOREIGNLEGION"/>
			<Set>
				<Class>UNITCLASS_FOREIGNLEGION</Class>
				<Cost>350</Cost>
				<FaithCost>700</FaithCost>
				<PurchaseOnly>true</PurchaseOnly>
				<MoveAfterPurchase>true</MoveAfterPurchase>
				<PolicyType>POLICY_TRADE_UNIONS</PolicyType>
				<ObsoleteTech>TECH_MOBILE_TACTICS</ObsoleteTech>
				<GoodyHutUpgradeUnitClass>UNITCLASS_MECHANIZED_INFANTRY</GoodyHutUpgradeUnitClass>
			</Set>
		</Update>
Re-designating the class is probably not 100% required, but does "clean" the issues with one unit being pointed toward two different unit-classes. Adding the <PolicyType> designation is what allows Mercenary Army (ie, POLICY_TRADE_UNIONS) to enact purchasability of the unit, as is done with the Landsnecht.

Unless you also make additional adjustments to the game's database for the free units from the ideology, players who pick Volunteer Army would still get the 6 free Foreign Legion units.
 
Last edited:
That only begs the question though, what was missing from Foreign Legion in unmodded BNW that made it unpurchaseable? A simple compare between Foreign Legion with the next entry (Cavalry) reveals nothing out of order.

Code:
           <Class>UNITCLASS_GREAT_WAR_INFANTRY</Class>
           <Type>UNIT_FRENCH_FOREIGNLEGION</Type>
           <PrereqTech>TECH_REPLACEABLE_PARTS</PrereqTech>
           <Combat>42</Combat>
           <Cost>320</Cost>
           <FaithCost>640</FaithCost>
           <RequiresFaithPurchaseEnabled>true</RequiresFaithPurchaseEnabled>
           <Moves>2</Moves>
           <CombatClass>UNITCOMBAT_GUN</CombatClass>
           <Domain>DOMAIN_LAND</Domain>
           <DefaultUnitAI>UNITAI_DEFENSE</DefaultUnitAI>
           <Description>TXT_KEY_UNIT_FRENCH_FOREIGNLEGION</Description>
           <Civilopedia>TXT_KEY_CIV5_INDUSTRIAL_FOREIGNLEGION_TEXT</Civilopedia>
           <Strategy>TXT_KEY_UNIT_FRENCH_FOREIGNLEGION_STRATEGY</Strategy>
           <Help>TXT_KEY_UNIT_HELP_FOREIGN_LEGION</Help>
           <MilitarySupport>true</MilitarySupport>
           <MilitaryProduction>true</MilitaryProduction>
           <Pillage>true</Pillage>
           <IgnoreBuildingDefense>true</IgnoreBuildingDefense>
           <ObsoleteTech>TECH_PLASTIC</ObsoleteTech>
           <GoodyHutUpgradeUnitClass>UNITCLASS_INFANTRY</GoodyHutUpgradeUnitClass>
           <AdvancedStartCost>35</AdvancedStartCost>
           <XPValueAttack>3</XPValueAttack>
           <XPValueDefense>3</XPValueDefense>
           <Conscription>6</Conscription>
           <UnitArtInfo>ART_DEF_UNIT_U_FRENCH_FOREIGNLEGION</UnitArtInfo>
           <UnitFlagIconOffset>55</UnitFlagIconOffset>
           <IconAtlas>UNIT_ATLAS_2</IconAtlas>
           <PortraitIndex>38</PortraitIndex>
Code:
           <Class>UNITCLASS_CAVALRY</Class>
           <Type>UNIT_CAVALRY</Type>
           <PrereqTech>TECH_MILITARY_SCIENCE</PrereqTech>
           <Combat>34</Combat>
           <Cost>225</Cost>
           <FaithCost>450</FaithCost>
           <RequiresFaithPurchaseEnabled>true</RequiresFaithPurchaseEnabled>
           <Moves>4</Moves>
           <CombatClass>UNITCOMBAT_MOUNTED</CombatClass>
           <Domain>DOMAIN_LAND</Domain>
           <DefaultUnitAI>UNITAI_FAST_ATTACK</DefaultUnitAI>
           <Description>TXT_KEY_UNIT_CAVALRY</Description>
           <Civilopedia>TXT_KEY_CIVILOPEDIA_UNITS_RENAISSANCE_CAVALRY_TEXT</Civilopedia>
           <Strategy>TXT_KEY_UNIT_CAVALRY_STRATEGY</Strategy>
           <Help>TXT_KEY_UNIT_HELP_CAVALRY</Help>
           <MilitarySupport>true</MilitarySupport>
           <MilitaryProduction>true</MilitaryProduction>
           <Pillage>true</Pillage>
           <ObsoleteTech>TECH_COMBUSTION</ObsoleteTech>
           <IgnoreBuildingDefense>true</IgnoreBuildingDefense>
           <GoodyHutUpgradeUnitClass>UNITCLASS_WWI_TANK</GoodyHutUpgradeUnitClass>
           <AdvancedStartCost>30</AdvancedStartCost>
           <XPValueAttack>3</XPValueAttack>
           <XPValueDefense>3</XPValueDefense>
           <UnitArtInfo>ART_DEF_UNIT_CAVALRY</UnitArtInfo>
           <UnitFlagIconOffset>48</UnitFlagIconOffset>
           <IconAtlas>UNIT_ATLAS_2</IconAtlas>
           <PortraitIndex>5</PortraitIndex>
           <MoveRate>QUADRUPED</MoveRate>
 
Because by Firaxis leaving the unit as defined within the UNITCLASS_GREAT_WAR_INFANTRY what they accomplished was to make it unavailable for purchase or construction to any civilization because no civilization had it anymore as a unique either in the UNITCLASS_GREAT_WAR_INFANTRY or any other UnitClass.

By designating that the UNIT_FRENCH_FOREIGNLEGION was the default unit within class UNITCLASS_FOREIGNLEGION they implemented the ability to get the units from the <Policy_FreeUnitClasses> table
Code:
		<Row>
			<PolicyType>POLICY_VOLUNTEER_ARMY</PolicyType>
			<UnitClassType>UNITCLASS_FOREIGNLEGION</UnitClassType>
			<Count>6</Count>
		</Row>
Because the Policy_FreeUnitClasses is done by Class of unit as registered in the UnitClasses table. Since no Civilization also has any unique in the unmodded game for the UNITCLASS_FOREIGNLEGION the default unit defined for that class is used: UNIT_FRENCH_FOREIGNLEGION (even though this unit is also registered as belonging to the Great War Infantry UnitClass).

It's a real corner-case and bizarre-looking setup but it accomplishes the goals Firaxis was after.

This oddball setup was not required in BNW for the Landsnecht unit because it is restricted to the player having the correct policy. It cannot be purchased with Faith because it does not have the <RequiresFaithPurchaseEnabled> set to true.

All you'll really need to do is the Update to the UNIT_FRENCH_FOREIGNLEGION unit similar to what the Mercenary Army Expanded mod does.
 
Last edited:
Back
Top Bottom