Codes that define naval unit that earned bonus on coast tile

Joined
Jan 10, 2019
Messages
1,852
What are codes needed to define that a unit earns a bonus on coastal tile?
In this case I want my TBOAT (Torpedo Boat) a +1 Movement if it starts its turn on a Coast tile.

Code:
<Row UnitType="UNIT_TBOAT" Name="LOC_UNIT_TBOAT_NAME" Description="LOC_UNIT_TBOAT_DESCRIPTION"
       Cost="320" Maintenance="5" BaseMoves="5" BaseSightRange="2" Combat="57" RangedCombat="67" Range="2" Domain="DOMAIN_SEA" ZoneOfControl="true"
       FormationClass="FORMATION_CLASS_NAVAL" PromotionClass="PROMOTION_CLASS_NAVAL_RAIDER" AdvisorType="ADVISOR_CONQUEST"
       PurchaseYield="YIELD_GOLD" PseudoYieldType="PSEUDOYIELD_UNIT_NAVAL_COMBAT" PrereqTech="TECH_STEAM_POWER" MandatoryObsoleteTech="TECH_LASERS"/>

This is what i've done for Torpedo Boat now. what's next
 
  1. You need to create a CLASS of unit that can be used in TypeTags to attach UNIT_TBOAT to this new Class.
  2. You need to create a Unitability
  3. You need to associate the new UnitAbililty to the new CLASS of unit
  4. You need to create a ModifierId that has the correct type of ModiiferType that increases unit movement and state a RequirementSet that says the unit has to start its turn on TERRAIN_COAST
    • The RequirementSetId is stated as part of the Modifier under probably OwnerRequirmentSetId rather than SubjectRequirmentSetId
    • The RequirementSet has to be given a Requirement that belongs to the Set of Requirements
    • The Requirement has to state the Terrain-Type matching sort of RequirementType and then table RequirmentArguments states the TerrainType needed to fulfill the Requirement
  5. You need to attach this ModifierId to the new Unitability under table UnitAbilityModifiers
 
Terrains.xml defines the game's valid Terrains. But all this file does is define the terrains, it does not have any modifiers in the file.

I don't find any modifiers yet that are already attached to UNIT_IRONCLAD
 
Terrains.xml defines the game's valid Terrains. But all this file does is define the terrains, it does not have any modifiers in the file.

I don't find any modifiers yet that are already attached to UNIT_IRONCLAD

So does that mean the Ironclad is no longer earned one extra move if begin turns on coastal tile as seen in this Wikia entry? https://civilization.fandom.com/wiki/Ironclad_(Civ6) I've also checked UNITS.XM too!

  1. You need to create a CLASS of unit that can be used in TypeTags to attach UNIT_TBOAT to this new Class.
  2. You need to create a Unitability
  3. You need to associate the new UnitAbililty to the new CLASS of unit
  4. You need to create a ModifierId that has the correct type of ModiiferType that increases unit movement and state a RequirementSet that says the unit has to start its turn on TERRAIN_COAST
    • The RequirementSetId is stated as part of the Modifier under probably OwnerRequirmentSetId rather than SubjectRequirmentSetId
    • The RequirementSet has to be given a Requirement that belongs to the Set of Requirements
    • The Requirement has to state the Terrain-Type matching sort of RequirementType and then table RequirmentArguments states the TerrainType needed to fulfill the Requirement
  5. You need to attach this ModifierId to the new Unitability under table UnitAbilityModifiers
And to use this new class attribute (the Torpedo Boat still belongs to CLASS_NAVAL_RAIDER) for specific unit only, which table should i add this new ability class?
 
Code:
<GameInfo>
	<Types>
		<Row Type="ABILITY_COSSACK" Kind="KIND_ABILITY"/>
	</Types>
	<Tags>
		<Row Tag="CLASS_COSSACK" Vocabulary="ABILITY_CLASS"/>
	</Tags>
	<TypeTags>
		<Row Type="ABILITY_COSSACK" Tag="CLASS_COSSACK"/>
		<Row Type="UNIT_RUSSIAN_COSSACK" Tag="CLASS_COSSACK"/>
	</TypeTags>
	<UnitAbilities>
		<Row UnitAbilityType="ABILITY_COSSACK" Name="LOC_ABILITY_COSSACK_NAME" Description="LOC_ABILITY_COSSACK_DESCRIPTION"/>
	</UnitAbilities>
	<UnitAbilityModifiers>
		<Row>
			<UnitAbilityType>ABILITY_COSSACK</UnitAbilityType>
			<ModifierId>COSSACK_LOCAL_COMBAT</ModifierId>
		</Row>
		<Row>
			<UnitAbilityType>ABILITY_COSSACK</UnitAbilityType>
			<ModifierId>COSSACK_MOVE_AND_ATTACK</ModifierId>
		</Row>
	</UnitAbilityModifiers>
	<Modifiers>
		<Row>
			<ModifierId>COSSACK_LOCAL_COMBAT</ModifierId>
			<ModifierType>MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH</ModifierType>
			<SubjectRequirementSetId>COSSACK_PLOT_IS_OWNER_OR_ADJACENT_REQUIREMENTS</SubjectRequirementSetId>
		</Row>
		<Row>
			<ModifierId>COSSACK_MOVE_AND_ATTACK</ModifierId>
			<ModifierType>MODIFIER_PLAYER_UNIT_ADJUST_ATTACK_AND_MOVE</ModifierType>
		</Row>
	</Modifiers>
	<ModifierArguments>
		<Row>
			<ModifierId>COSSACK_LOCAL_COMBAT</ModifierId>
			<Name>Amount</Name>
			<Value>5</Value>
		</Row>
		<Row>
			<ModifierId>COSSACK_MOVE_AND_ATTACK</ModifierId>
			<Name>CanMove</Name>
			<Value>true</Value>
		</Row>
	</ModifierArguments>
	<RequirementSets>
		<Row>
			<RequirementSetId>COSSACK_PLOT_IS_OWNER_OR_ADJACENT_REQUIREMENTS</RequirementSetId>
			<RequirementSetType>REQUIREMENTSET_TEST_ANY</RequirementSetType>
		</Row>
	</RequirementSets>
	<RequirementSetRequirements>
		<Row>
			<RequirementSetId>COSSACK_PLOT_IS_OWNER_OR_ADJACENT_REQUIREMENTS</RequirementSetId>
			<RequirementId>UNIT_ADJACENT_TO_OWNER_TERRITORY_REQUIREMENT</RequirementId>
		</Row>
		<Row>
			<RequirementSetId>COSSACK_PLOT_IS_OWNER_OR_ADJACENT_REQUIREMENTS</RequirementSetId>
			<RequirementId>UNIT_IN_OWNER_TERRITORY_REQUIREMENT</RequirementId>
		</Row>
	</RequirementSetRequirements>
	<Requirements>
		<Row>
			<RequirementId>UNIT_ADJACENT_TO_OWNER_TERRITORY_REQUIREMENT</RequirementId>
			<RequirementType>REQUIREMENT_UNIT_ADJACENT_TO_OWNER_TERRITORY</RequirementType>
		</Row>
		<Row>
			<RequirementId>UNIT_IN_OWNER_TERRITORY_REQUIREMENT</RequirementId>
			<RequirementType>REQUIREMENT_UNIT_IN_OWNER_TERRITORY</RequirementType>
		</Row>
	</Requirements>
	<ModifierStrings>
		<Row ModifierId="COSSACK_LOCAL_COMBAT" Context="Preview" Text="LOC_ABILITY_COSSACK_LOCAL_COMBAT_MODIFIER_DESCRIPTION"/>
	</ModifierStrings>
</GameInfo>
You will probably need to add info in table RequirementArguments. But this is a template of how a unique effect ( ie, a UnitAbility) is restricted to a single UnitType rather than to a group of units.

You find this sort of information by studying the game's XML files or by using an SQLite database viewer program to look into the database after all the expacs and any mods have loaded into the game.
 
Top Bottom