Give all units a promotion as a trait?

fb2017

Chieftain
Joined
Oct 8, 2017
Messages
53
I want to give all units the Amphibious promotion as a trait, is that possible?
 
It might be easier to give all units the effects of the amphibious promotion, without actually giving them the promotion. Especially because amphibious is exclusive to melee units.
 
It might be easier to give all units the effects of the amphibious promotion, without actually giving them the promotion. Especially because amphibious is exclusive to melee units.
Do you know how that's possible, though?
 
Here's an example of borrowing the Alpine Training effect and applying it as a unit-ability to units trained within the city that constructs a given building. There's no reason you cannot just give the ability to all a given leader's or civilization's units instead of tying it to units trained within a city that has a specific building.

<ModifierId>ALTITUDE_TRAINING_IGNORE_HILLS</ModifierId> was the important bit from the promotion that I had to borrow and apply under table <UnitAbilityModifiers>
Code:
	<Types>
		<Row Type="MODIFIER_GRANT_ABILITY_SINGLE_CITY_UNITS_LRS" Kind="KIND_MODIFIER"/>
		<Row Type="BUILDING_NATIONAL_ALPINE_ACADEMY_LRS" Kind="KIND_BUILDING"/>
		<Row Type="ABILITY_ALPINE_ACADEMY" Kind="KIND_ABILITY"/>
	</Types>
	<DynamicModifiers>
		<Row ModifierType="MODIFIER_GRANT_ABILITY_SINGLE_CITY_UNITS_LRS" CollectionType="COLLECTION_CITY_TRAINED_UNITS" EffectType="EFFECT_GRANT_ABILITY" />
	</DynamicModifiers>
	<TypeTags>
		<Row Type="ABILITY_ALPINE_ACADEMY" Tag="CLASS_MELEE"/>
		<Row Type="ABILITY_ALPINE_ACADEMY" Tag="CLASS_RANGED"/>
		<Row Type="ABILITY_ALPINE_ACADEMY" Tag="CLASS_ANTI_CAVALRY"/>
	</TypeTags>
	<UnitAbilities>
		<Row UnitAbilityType="ABILITY_ALPINE_ACADEMY" Name="LOC_ABILITY_ALTITUDE_TRAINING_NAME" Description="LOC_ABILITY_ALTITUDE_TRAINING_DESCRIPTION" Inactive="true"/>
	</UnitAbilities>
	<UnitAbilityModifiers>
		<Row>
			<UnitAbilityType>ABILITY_ALPINE_ACADEMY</UnitAbilityType>
			<ModifierId>ALTITUDE_TRAINING_IGNORE_HILLS</ModifierId>
		</Row>
	</UnitAbilityModifiers>
	<Buildings>
		<Row BuildingType="BUILDING_NATIONAL_ALPINE_ACADEMY_LRS" Name="LOC_BUILDING_NATIONAL_ALPINE_ACADEMY_LRS_NAME"
			Description="LOC_BUILDING_NATIONAL_ALPINE_ACADEMY_LRS_DESCRIPTION" PrereqCivic="CIVIC_FEUDALISM"
			PrereqDistrict="DISTRICT_ENCAMPMENT" MaxPlayerInstances="1" AdvisorType="ADVISOR_CONQUEST"
			Housing="1" Entertainment="1" Cost="225" OuterDefenseHitPoints="10" />
	</Buildings>
	<Modifiers>
		<Row ModifierId="NATIONAL_ALPINE_ACADEMY_LRS_GRANT_ALPINE_LRS" ModifierType="MODIFIER_GRANT_ABILITY_SINGLE_CITY_UNITS_LRS" Permanent="true" />
	</Modifiers>
	<ModifierArguments>
		<Row ModifierId="NATIONAL_ALPINE_ACADEMY_LRS_GRANT_ALPINE_LRS" Name="AbilityType" Value="ABILITY_ALPINE_ACADEMY" />
	</ModifierArguments>
	<BuildingModifiers>
		<Row BuildingType="BUILDING_NATIONAL_ALPINE_ACADEMY_LRS" ModifierId="NATIONAL_ALPINE_ACADEMY_LRS_GRANT_ALPINE_LRS" />
	</BuildingModifiers>
Here's an example of borrowing two pre-existing unit abilities that are given to Helicopter units in the standard game, and giving these effects to all of Trajan's land units by giving them through the <TraitModifiers> table:
Spoiler :
Code:
	<Types>
		<Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Kind="KIND_ABILITY"/>
		<Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Kind="KIND_ABILITY"/>
	</Types>
	<TypeTags>
		<Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_LANDCIVILIAN"/>
		<Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_RECON"/>
		<Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_MELEE"/>
		<Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_RANGED"/>
		<Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_SIEGE"/>
		<Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_HEAVY_CAVALRY"/>
		<Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_LIGHT_CAVALRY"/>
		<Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_RANGED_CAVALRY"/>
		<Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_ANTI_CAVALRY"/>
		<Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_HEAVY_CHARIOT"/>
		<Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_LIGHT_CHARIOT"/>
		<Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_BATTERING_RAM"/>
		<Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_SIEGE_TOWER"/>
		<Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_OBSERVATION"/>
		<Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_ANTI_AIR"/>
		<Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_GARDE"/>
		<Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_LANDCIVILIAN"/>
		<Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_RECON"/>
		<Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_MELEE"/>
		<Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_RANGED"/>
		<Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_SIEGE"/>
		<Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_HEAVY_CAVALRY"/>
		<Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_LIGHT_CAVALRY"/>
		<Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_RANGED_CAVALRY"/>
		<Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_ANTI_CAVALRY"/>
		<Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_HEAVY_CHARIOT"/>
		<Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_LIGHT_CHARIOT"/>
		<Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_BATTERING_RAM"/>
		<Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_SIEGE_TOWER"/>
		<Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_OBSERVATION"/>
		<Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_ANTI_AIR"/>
		<Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_GARDE"/>
	</TypeTags>
	<UnitAbilities>
		<Row UnitAbilityType="ABILITY_LRS_IGNORE_TERRAIN_COST" Name="LOC_ABILITY_LRS_IGNORE_TERRAIN_COST_NAME" Description="LOC_ABILITY_LRS_IGNORE_TERRAIN_COST_DESCRIPTION" Inactive="true"/>
		<Row UnitAbilityType="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Name="LOC_ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST_NAME" Description="LOC_ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST_DESCRIPTION" Inactive="true"/>
	</UnitAbilities>
	<!--  -->
	<UnitAbilityModifiers>
		<Row>
			<UnitAbilityType>ABILITY_LRS_IGNORE_TERRAIN_COST</UnitAbilityType>
			<ModifierId>MOD_IGNORE_TERRAIN_COST</ModifierId>
		</Row>
		<Row>
			<UnitAbilityType>ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST</UnitAbilityType>
			<ModifierId>MOD_IGNORE_CROSSING_RIVERS_COST</ModifierId>
		</Row>
	</UnitAbilityModifiers>
	<Modifiers>
		<Row>
			<ModifierId>LRS_IGNORE_TERRAIN_COST</ModifierId>
			<ModifierType>MODIFIER_PLAYER_UNITS_GRANT_ABILITY</ModifierType>
			<Permanent>true</Permanent>
		</Row>
		<Row>
			<ModifierId>LRS_IGNORE_RIVERCROSSING_COST</ModifierId>
			<ModifierType>MODIFIER_PLAYER_UNITS_GRANT_ABILITY</ModifierType>
			<Permanent>true</Permanent>
		</Row>
	</Modifiers>
	<ModifierArguments>
		<Row>
			<ModifierId>LRS_IGNORE_TERRAIN_COST</ModifierId>
			<Name>AbilityType</Name>
			<Value>ABILITY_LRS_IGNORE_TERRAIN_COST</Value>
		</Row>
		<Row>
			<ModifierId>LRS_IGNORE_RIVERCROSSING_COST</ModifierId>
			<Name>AbilityType</Name>
			<Value>ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST</Value>
		</Row>
	</ModifierArguments>
	<TraitModifiers>
		<Row TraitType="TRAJANS_COLUMN_TRAIT" ModifierId="LRS_IGNORE_TERRAIN_COST"/>
		<Row TraitType="TRAJANS_COLUMN_TRAIT" ModifierId="LRS_IGNORE_RIVERCROSSING_COST"/>
	</TraitModifiers>
 
Here's an example of borrowing the Alpine Training effect and applying it as a unit-ability to units trained within the city that constructs a given building. There's no reason you cannot just give the ability to all a given leader's or civilization's units instead of tying it to units trained within a city that has a specific building.

<ModifierId>ALTITUDE_TRAINING_IGNORE_HILLS</ModifierId> was the important bit from the promotion that I had to borrow and apply under table <UnitAbilityModifiers>
Code:
    <Types>
        <Row Type="MODIFIER_GRANT_ABILITY_SINGLE_CITY_UNITS_LRS" Kind="KIND_MODIFIER"/>
        <Row Type="BUILDING_NATIONAL_ALPINE_ACADEMY_LRS" Kind="KIND_BUILDING"/>
        <Row Type="ABILITY_ALPINE_ACADEMY" Kind="KIND_ABILITY"/>
    </Types>
    <DynamicModifiers>
        <Row ModifierType="MODIFIER_GRANT_ABILITY_SINGLE_CITY_UNITS_LRS" CollectionType="COLLECTION_CITY_TRAINED_UNITS" EffectType="EFFECT_GRANT_ABILITY" />
    </DynamicModifiers>
    <TypeTags>
        <Row Type="ABILITY_ALPINE_ACADEMY" Tag="CLASS_MELEE"/>
        <Row Type="ABILITY_ALPINE_ACADEMY" Tag="CLASS_RANGED"/>
        <Row Type="ABILITY_ALPINE_ACADEMY" Tag="CLASS_ANTI_CAVALRY"/>
    </TypeTags>
    <UnitAbilities>
        <Row UnitAbilityType="ABILITY_ALPINE_ACADEMY" Name="LOC_ABILITY_ALTITUDE_TRAINING_NAME" Description="LOC_ABILITY_ALTITUDE_TRAINING_DESCRIPTION" Inactive="true"/>
    </UnitAbilities>
    <UnitAbilityModifiers>
        <Row>
            <UnitAbilityType>ABILITY_ALPINE_ACADEMY</UnitAbilityType>
            <ModifierId>ALTITUDE_TRAINING_IGNORE_HILLS</ModifierId>
        </Row>
    </UnitAbilityModifiers>
    <Buildings>
        <Row BuildingType="BUILDING_NATIONAL_ALPINE_ACADEMY_LRS" Name="LOC_BUILDING_NATIONAL_ALPINE_ACADEMY_LRS_NAME"
            Description="LOC_BUILDING_NATIONAL_ALPINE_ACADEMY_LRS_DESCRIPTION" PrereqCivic="CIVIC_FEUDALISM"
            PrereqDistrict="DISTRICT_ENCAMPMENT" MaxPlayerInstances="1" AdvisorType="ADVISOR_CONQUEST"
            Housing="1" Entertainment="1" Cost="225" OuterDefenseHitPoints="10" />
    </Buildings>
    <Modifiers>
        <Row ModifierId="NATIONAL_ALPINE_ACADEMY_LRS_GRANT_ALPINE_LRS" ModifierType="MODIFIER_GRANT_ABILITY_SINGLE_CITY_UNITS_LRS" Permanent="true" />
    </Modifiers>
    <ModifierArguments>
        <Row ModifierId="NATIONAL_ALPINE_ACADEMY_LRS_GRANT_ALPINE_LRS" Name="AbilityType" Value="ABILITY_ALPINE_ACADEMY" />
    </ModifierArguments>
    <BuildingModifiers>
        <Row BuildingType="BUILDING_NATIONAL_ALPINE_ACADEMY_LRS" ModifierId="NATIONAL_ALPINE_ACADEMY_LRS_GRANT_ALPINE_LRS" />
    </BuildingModifiers>
Here's an example of borrowing two pre-existing unit abilities that are given to Helicopter units in the standard game, and giving these effects to all of Trajan's land units by giving them through the <TraitModifiers> table:
Spoiler :
Code:
    <Types>
        <Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Kind="KIND_ABILITY"/>
        <Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Kind="KIND_ABILITY"/>
    </Types>
    <TypeTags>
        <Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_LANDCIVILIAN"/>
        <Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_RECON"/>
        <Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_MELEE"/>
        <Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_RANGED"/>
        <Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_SIEGE"/>
        <Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_HEAVY_CAVALRY"/>
        <Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_LIGHT_CAVALRY"/>
        <Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_RANGED_CAVALRY"/>
        <Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_ANTI_CAVALRY"/>
        <Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_HEAVY_CHARIOT"/>
        <Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_LIGHT_CHARIOT"/>
        <Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_BATTERING_RAM"/>
        <Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_SIEGE_TOWER"/>
        <Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_OBSERVATION"/>
        <Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_ANTI_AIR"/>
        <Row Type="ABILITY_LRS_IGNORE_TERRAIN_COST" Tag="CLASS_GARDE"/>
        <Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_LANDCIVILIAN"/>
        <Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_RECON"/>
        <Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_MELEE"/>
        <Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_RANGED"/>
        <Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_SIEGE"/>
        <Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_HEAVY_CAVALRY"/>
        <Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_LIGHT_CAVALRY"/>
        <Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_RANGED_CAVALRY"/>
        <Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_ANTI_CAVALRY"/>
        <Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_HEAVY_CHARIOT"/>
        <Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_LIGHT_CHARIOT"/>
        <Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_BATTERING_RAM"/>
        <Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_SIEGE_TOWER"/>
        <Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_OBSERVATION"/>
        <Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_ANTI_AIR"/>
        <Row Type="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Tag="CLASS_GARDE"/>
    </TypeTags>
    <UnitAbilities>
        <Row UnitAbilityType="ABILITY_LRS_IGNORE_TERRAIN_COST" Name="LOC_ABILITY_LRS_IGNORE_TERRAIN_COST_NAME" Description="LOC_ABILITY_LRS_IGNORE_TERRAIN_COST_DESCRIPTION" Inactive="true"/>
        <Row UnitAbilityType="ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST" Name="LOC_ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST_NAME" Description="LOC_ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST_DESCRIPTION" Inactive="true"/>
    </UnitAbilities>
    <!--  -->
    <UnitAbilityModifiers>
        <Row>
            <UnitAbilityType>ABILITY_LRS_IGNORE_TERRAIN_COST</UnitAbilityType>
            <ModifierId>MOD_IGNORE_TERRAIN_COST</ModifierId>
        </Row>
        <Row>
            <UnitAbilityType>ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST</UnitAbilityType>
            <ModifierId>MOD_IGNORE_CROSSING_RIVERS_COST</ModifierId>
        </Row>
    </UnitAbilityModifiers>
    <Modifiers>
        <Row>
            <ModifierId>LRS_IGNORE_TERRAIN_COST</ModifierId>
            <ModifierType>MODIFIER_PLAYER_UNITS_GRANT_ABILITY</ModifierType>
            <Permanent>true</Permanent>
        </Row>
        <Row>
            <ModifierId>LRS_IGNORE_RIVERCROSSING_COST</ModifierId>
            <ModifierType>MODIFIER_PLAYER_UNITS_GRANT_ABILITY</ModifierType>
            <Permanent>true</Permanent>
        </Row>
    </Modifiers>
    <ModifierArguments>
        <Row>
            <ModifierId>LRS_IGNORE_TERRAIN_COST</ModifierId>
            <Name>AbilityType</Name>
            <Value>ABILITY_LRS_IGNORE_TERRAIN_COST</Value>
        </Row>
        <Row>
            <ModifierId>LRS_IGNORE_RIVERCROSSING_COST</ModifierId>
            <Name>AbilityType</Name>
            <Value>ABILITY_LRS_IGNORE_CROSSING_RIVERS_COST</Value>
        </Row>
    </ModifierArguments>
    <TraitModifiers>
        <Row TraitType="TRAJANS_COLUMN_TRAIT" ModifierId="LRS_IGNORE_TERRAIN_COST"/>
        <Row TraitType="TRAJANS_COLUMN_TRAIT" ModifierId="LRS_IGNORE_RIVERCROSSING_COST"/>
    </TraitModifiers>
Thx
 
Top Bottom