Edit: I solved it, it was a silly mistake in the code.
I am new to modding and I'm stuck in this. It should be easy, I just want my unique unit (which replaces the settler) to be able to enter any territory, just like missionaries do. I tried to copy the code in the game files and after several tries I have this:
I am new to modding and I'm stuck in this. It should be easy, I just want my unique unit (which replaces the settler) to be able to enter any territory, just like missionaries do. I tried to copy the code in the game files and after several tries I have this:
Code:
<GameData>
<Types>
<Row Type="UNIT_GZ_MIGRANT" Kind="KIND_UNIT"/>
<Row Type="ABILITY_GZ_MIGRANT_ENTER_FOREIGN_LANDS" Kind="KIND_ABILITY"/>
</Types>
<TypeTags>
<Row Type="UNIT_GZ_MIGRANT" Tag="CLASS_LANDCIVILIAN"/>
<Row Type="UNIT_GZ_MIGRANT" Tag="CLASS_GZ_MIGRANT"/>
<Row Type="ABILITY_GZ_MIGRANT_ENTER_FOREIGN_LANDS" Tag="CLASS_GZ_MIGRANT"/>
</TypeTags>
<Tags>
<Row Tag="CLASS_GZ_MIGRANT" Vocabulary="ABILITY_CLASS"/>
</Tags>
<UnitAiInfos>
<Row UnitType="UNIT_GZ_MIGRANT" AiType="UNITAI_SETTLE"/>
<Row UnitType="UNIT_GZ_MIGRANT" AiType="UNITTYPE_CIVILIAN"/>
</UnitAiInfos>
<UnitCaptures>
<Row CapturedUnitType="UNIT_GZ_MIGRANT" BecomesUnitType="UNIT_BUILDER"/>
</UnitCaptures>
<UnitAbilities>
<Row UnitAbilityType="ABILITY_GZ_MIGRANT_ENTER_FOREIGN_LANDS" Name="LOC_ABILITY_ARCHAEOLOGIST_ENTER_FOREIGN_LANDS_NAME" Description="LOC_ABILITY_ARCHAEOLOGIST_ENTER_FOREIGN_LANDS_DESCRIPTION" Inactive="true"/>
</UnitAbilities>
<UnitAbilityModifiers>
<Row>
<UnitAbilityType>ABILITY_GZ_MIGRANT_ENTER_FOREIGN_LANDS</UnitAbilityType>
<ModifierId>GZ_ENTER_FOREIGN_LANDS</ModifierId>
</Row>
</UnitAbilityModifiers>
<Modifiers>
<Row>
<ModifierId>GZ_ENTER_FOREIGN_LANDS</ModifierId>
<ModifierType>MODIFIER_PLAYER_UNIT_ADJUST_ENTER_FOREIGN_LANDS</ModifierType>
</Row>
</Modifiers>
<ModifierArguments>
<Row>
<ModifierId>GZ_ENTER_FOREIGN_LANDS</ModifierId>
<Name>Enter</Name>
<Value>true</Value>
</Row>
</ModifierArguments>
<ModifierStrings>
<Row ModifierId="GZ_ENTER_FOREIGN_LANDS" Context="Preview" Text="LOC_ABILITY_ENTER_FOREIGN_LANDS_MODIFIER_DESCRIPTION"/>
</ModifierStrings>
<Units>
<Row UnitType="UNIT_GZ_MIGRANT" BaseMoves="4" Cost="80" AdvisorType="ADVISOR_GENERIC" BaseSightRange="3" ZoneOfControl="false" Domain="DOMAIN_LAND" FormationClass="FORMATION_CLASS_CIVILIAN" FoundCity="true" PopulationCost="1" PrereqPopulation="2" Name="LOC_UNIT_GZ_MIGRANT_NAME" Description="LOC_UNIT_GZ_MIGRANT_DESCRIPTION" CanCapture="False" CostProgressionModel="COST_PROGRESSION_PREVIOUS_COPIES" CostProgressionParam1="30" PurchaseYield="YIELD_GOLD" TraitType="TRAIT_CIVILIZATION_GZ_MIGRANT" PseudoYieldType="PSEUDOYIELD_UNIT_SETTLER"/>
</Units>
<UnitReplaces>
<Row CivUniqueUnitType="UNIT_GZ_MIGRANT" ReplacesUnitType="UNIT_SETTLER"/>
</UnitReplaces>
</GameData>
Last edited: