Creating Leader Trait... 50% adjustment to Barracks Cost

Craig_Sutter

Deity
Joined
Aug 13, 2002
Messages
2,773
Location
Calgary, Canada
I am trying to create a leader trait that adjusts barracks costs by 50%. I could not find a direct example... however, I used Valetta's trait that gives bonuses to suzerains to build walls as a template. I added in the trait, and removed any suzerain requirements... however, I got a crash to the main menu.

Is what I am doing possible? Or is there another workable method?

Code is here:

Code:
<TraitModifiers>       
        <Row TraitType="TRAIT_LEADER_TRELLEBORG_FORTRESSES" ModifierId="TRAIT_ADJUST_BARRACKS_BUILDING_COSTS"/>
    </TraitModifiers>
    <Modifiers
        <Row>
            <ModifierId>TRAIT_ADJUST_BARRACKS_BUILDING_COSTS</ModifierId>
            <ModifierType>MODIFIER_PLAYER_CITIES_ADJUST_BUILDING_PURCHASE_COST</ModifierType>
        </Row>
    </Modifiers>
    <ModifierArguments>   
        <Row>
            <ModifierId>TRAIT_ADJUST_BARRACKS_BUILDING_COSTS</ModifierId>
            <Name>BuildingType</Name>
            <Value>BUILDING_BARRACKS</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_ADJUST_BARRACKS_BUILDING_COSTS</ModifierId>
            <Name>Amount</Name>
            <Value>50</Value>
        </Row>       
    </ModifierArguments>
 
I checked... Everything enclosed in the GameInfo tags... almost.

In Civ 5, you could repeat table names so, for example, you could have <Buildings></Buildings> in part of a file, and do it again in another part... it did not matter. The code listed in #1 was pasted at the end of the file (within GameInfo), but the file already had another part of the
TRAIT_LEADER_TRELLEBORG_FORTRESSES trait set up and working, with Traitmodifiers, Modifiers and ModifierArguments tables already set up. In Civ V this did not matter, but apparently it does for Civ Vl. I didn't notice, but <GameInfo> </GameInfo> did not correctly close (as it became obvious in notepad++). So thanks for the advice... it led to a solution.

I simply cut and pasted from the above code into the already prepared tables and am receiving no database errors (although it may not be working as expected even so, for all I know). Testing time.
 
Back
Top Bottom