how to disable embarkation for a certain unit?

tac_NCVD

Chieftain
Joined
Feb 29, 2020
Messages
18
For example, how to make China's ChuKoNu not getting the embarkation promotion even when it's owner have researched optics? Thx.
 
Can't remember if promotions are tied to unit type, unit class or combat class, but if this can't be done in XML (and LeeS will be along later no doubt with the info), it can be done with Lua - see here and the CanHavePromotion GameEvent (pretty sure the bulk granting of embarkation promotions to existing units follows the standard code)
 
Code:
	<UnitPromotions_UnitCombats>
		<Row>
			<PromotionType>PROMOTION_EMBARKATION</PromotionType>
			<UnitCombatType>UNITCOMBAT_RECON</UnitCombatType>
		</Row>
		<Row>
			<PromotionType>PROMOTION_EMBARKATION</PromotionType>
			<UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
		</Row>
……….
Promotions that are attached to only some combat units but not others are generally done so by UnitCombatType rather than UnitType, so since all the "embarkation" promotions are specified in the <UnitPromotions_UnitCombats> table, they are all applied based on the Combat Type.

The other method used is the Unit_FreePromotions table but that table is only really used for giving inherent "always on" promotions to specific UnitTypes. Unique Units are often given extra promotions that the remainder of their CombatType don't generally get, or in some cases certain generic units within a CombatType are given a promotion that the remainder of the units within that group don't get.

<UnitPromotions_UnitCombats> does not directly give any promotion, it merely states which promotions are valid for which UnitCombatTypes. If a promotion is listed within this table as a general rule the promotion cannot be applied or else doesn't get implemented properly by the game for any other UnitCombatType. This table for example is used to limit which units qualify for the promotion given by the Great Lighthouse.

Leader Traits that give free promotions to all their combat units essentially ignore the restrictions of the <UnitPromotions_UnitCombats> table, but the promotions given in table Trait_FreePromotionUnitCombats are still handed out based on the UnitCombatType.
 
Last edited:
so... what can i actually do to disable embarkation for a certain unit? I am new to modding civ 5, and I can't find any example in the forum :(
 
Back
Top Bottom