Craig_Sutter
Deity
Hi... I am still a neophyte at creating leader traits. In the code below (ignore the hirdmann references), I am trying to create a trait that gives units +1 movement when moving out of a city center district with walls (I have changed that to +10 for testing purposes). Ideally, I will later limit the unit types to melee, but for now, I will settle for any unit getting the prescribed movement.
The code does not generate any Database log errors (although it seems to be screwing up my leader icons which now is a question mark). I am hoping someone here can point out some obvious errors I have made due to my ignorance.
In addition, once I have the code working, I have a question about whether the code will still work after a castle has been built... are the walls destroyed? or do I need to put in requirements for both castle and starfort as well (I am thinking not). As well, I mentioned that I'd like to restrict it to melee units. Another question is in regard to: MODIFIER_PLAYER_UNIT_ADJUST_MOVEMENT... would MODIFIER_PLAYER_UNITS_ADJUST_MOVEMENT be the better choice?
Here is the code:
Thank-you for your anticipated assistance.
The code does not generate any Database log errors (although it seems to be screwing up my leader icons which now is a question mark). I am hoping someone here can point out some obvious errors I have made due to my ignorance.
In addition, once I have the code working, I have a question about whether the code will still work after a castle has been built... are the walls destroyed? or do I need to put in requirements for both castle and starfort as well (I am thinking not). As well, I mentioned that I'd like to restrict it to melee units. Another question is in regard to: MODIFIER_PLAYER_UNIT_ADJUST_MOVEMENT... would MODIFIER_PLAYER_UNITS_ADJUST_MOVEMENT be the better choice?
Here is the code:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- edited by Craig Sutter -->
<GameInfo>
<Types>
<Row Type="LEADER_ALFRED" Kind="KIND_LEADER"/>
<Row Type="TRAIT_LEADER_CALLING_THE_FYRD" Kind="KIND_TRAIT"/>
<Row Type="TRAIT_LEADER_UNIT_DANISH_HIRDMANN" Kind="KIND_TRAIT" />
</Types>
<Leaders>
<Row LeaderType="LEADER_ALFRED" Name="LOC_LEADER_ALFRED_NAME" InheritFrom="LEADER_DEFAULT" SceneLayers="4"/>
</Leaders>
<LeaderQuotes>
<Row LeaderType="LEADER_ALFRED" Quote="LOC_PEDIA_LEADERS_PAGE_LEADER_ALFRED_QUOTE" QuoteAudio="Play_NORW_HH_MISC_PEP_TALK_B_1"/>
</LeaderQuotes>
<LeaderTraits>
<Row LeaderType="LEADER_ALFRED" TraitType="TRAIT_LEADER_CALLING_THE_FYRD"/>
<Row LeaderType="LEADER_ALFRED" TraitType="TRAIT_LEADER_UNIT_DANISH_HIRDMANN"/>
</LeaderTraits>
<Traits>
<Row TraitType="TRAIT_LEADER_CALLING_THE_FYRD" Name="LOC_TRAIT_LEADER_CALLING_THE_FYRD_NAME" Description="LOC_TRAIT_LEADER_CALLING_THE_FYRD_DESCRIPTION"/>
<Row TraitType="TRAIT_LEADER_UNIT_DANISH_HIRDMANN" Name="LOC_UNIT_DANISH_HIRDMANN_NAME" Description="LOC_UNIT_DANISH_HIRDMANN_DESCRIPTION"/>
</Traits>
<TraitModifiers>
<Row TraitType="TRAIT_LEADER_CALLING_THE_FYRD" ModifierId="TRAIT_BURH_CITY_CENTER_MOVEMENT_BONUS"/>
</TraitModifiers>
<Agendas>
<Row AgendaType="AGENDA_DANELAW" Name="LOC_AGENDA_DANELAW_NAME" Description="LOC_AGENDA_DANELAW_DESCRIPTION"/>
</Agendas>
<HistoricalAgendas>
<Row LeaderType="LEADER_ALFRED" AgendaType="AGENDA_DANELAW"/>
</HistoricalAgendas>
<AiListTypes>
<Row ListType="AlfredCivics"/>
<Row ListType="AlfredTechs"/>
<Row ListType="AlfredWonders"/>
</AiListTypes>
<AiLists>
<Row ListType="AlfredWonders" LeaderType="TRAIT_LEADER_CALLING_THE_FYRD" System="Buildings"/>
<Row ListType="AlfredCivics" LeaderType="TRAIT_LEADER_CALLING_THE_FYRD" System="Civics"/>
<Row ListType="AlfredTechs" LeaderType="TRAIT_LEADER_CALLING_THE_FYRD" System="Technologies"/>
</AiLists>
<AiFavoredItems>
<Row ListType="AlfredWonders" Item="BUILDING_GREAT_LIGHTHOUSE"/>
<Row ListType="AlfredWonders" Item="BUILDING_TERRACOTTA_ARMY"/>
<Row ListType="AlfredCivics" Item="CIVIC_MILITARY_TRAINING"/>
<Row ListType="AlfredCivics" Item="CIVIC_MERCENARIES"/>
<Row ListType="AlfredTechs" Item="TECH_SHIPBUILDING"/>
<Row ListType="AlfredTechs" Item="TECH_IRON_WORKING"/>
</AiFavoredItems>
<Modifiers>
<Row>
<ModifierId>TRAIT_BURH_CITY_CENTER_MOVEMENT_BONUS</ModifierId>
<ModifierType>MODIFIER_PLAYER_UNIT_ADJUST_MOVEMENT</ModifierType>
<SubjectRequirementSetId>PLOT_MOVEMENT_HAS_WALLS_AND_CITY_CENTER_REQUIREMENTS</SubjectRequirementSetId>
</Row>
</Modifiers>
<ModifierArguments>
<Row>
<ModifierId>TRAIT_BURH_CITY_CENTER_MOVEMENT_BONUS</ModifierId>
<Name>Amount</Name>
<Value>10</Value>
</Row>
</ModifierArguments>
<RequirementSets>
<Row>
<RequirementSetId>PLOT_MOVEMENT_HAS_WALLS_AND_CITY_CENTER_REQUIREMENTS</RequirementSetId>
<RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
</Row>
</RequirementSets>
<RequirementSetRequirements>
<Row>
<RequirementSetId>PLOT_MOVEMENT_HAS_WALLS_AND_CITY_CENTER_REQUIREMENTS</RequirementSetId>
<RequirementId>PLOT_MOVEMENT_HAS_WALLS_REQUIREMENT</RequirementId>
</Row>
<Row>
<RequirementSetId>PLOT_MOVEMENT_HAS_WALLS_AND_CITY_CENTER_REQUIREMENTS</RequirementSetId>
<RequirementId>PLOT_MOVEMENT_HAS_CITY_CENTER_REQUIREMENT</RequirementId>
</Row>
</RequirementSetRequirements>
<Requirements>
<Row>
<RequirementId>PLOT_MOVEMENT_HAS_WALLS_REQUIREMENT</RequirementId>
<RequirementType>REQUIREMENT_CITY_HAS_BUILDING</RequirementType>
</Row>
<Row>
<RequirementId>PLOT_MOVEMENT_HAS_CITY_CENTER_REQUIREMENT</RequirementId>
<RequirementType>REQUIREMENT_PLOT_DISTRICT_TYPE_MATCHES</RequirementType>
</Row>
</Requirements>
<RequirementArguments>
<Row>
<RequirementId>PLOT_MOVEMENT_HAS_WALLS_REQUIREMENT</RequirementId>
<Name>BuildingType</Name>
<Value>BUILDING_WALLS</Value>
</Row>
<Row>
<RequirementId>PLOT_MOVEMENT_HAS_CITY_CENTER_REQUIREMENT</RequirementId>
<Name>DistrictType</Name>
<Value>DISTRICT_CITY_CENTER</Value>
</Row>
</RequirementArguments>
</GameInfo>
Thank-you for your anticipated assistance.