Faction/Race Specific Buildings&Items - How To?

Hi all

Like the title says, how do I make a building or weapon available for only one Faction?

Example: Say I created a building in the Forge that gives me two horses per turn, but I only want that building available for my custom faction. Where do I specify that? 

Will it be some sort of Prereq in the Improvement xml? If so, what is it? Or is it something you add in the Race xml?

I've tried a few different things but the building is always available to all Kingdom factions. At least I can prevent Empire from building it. I think...

 

Thanks

 

3,533 views 4 replies
Reply #1 Top

There is a difference between a faction and a race. A faction belongs to one race, but a race can have multiple factions (this is what happens when you create custom factions - the race gains another faction).

 


 

Making something unique for a Race is easy, just put this in your item/improvement:

    <Prereq>
      <Type>Race</Type>
      <Attribute>Race_Type_LivingStone</Attribute>
    </Prereq>

where the Attribute is the InternalName of your Race (see CoreRaceTypes.xml, or in your faction's XML simply look up <RaceInternalName>Race_Type_LivingStone</RaceInternalName>).

 


 

Making something unique for a Faction requires that you "bind" the special something to a faction ability (like Altar faction has "Wanderlust").

    <AbilityBonus InternalName="WanderlustAbility">
        <AbilityBonusType>Player</AbilityBonusType> <!-- Remove this line if you don't want the faction ability to be available for playermade custom factions in the editor)-->
        <AbilityBonusOption InternalName="Wanderlust">
            <DisplayName>Wanderlust</DisplayName>
            <Description>Unlocks Quest Maps, Athican Leather Armor, the Fending Blade and the Athican Longsword.</Description>
            <Icon>Ability_Wanderlust_Icon.png</Icon>
            <GameModifier>
                <Provides>Unlocks Quest Maps, Athican Leather Armor, the Fending Blade and the Athican Longsword.</Provides>
            </GameModifier>
            <Cost>1</Cost>
            <HideWhenUpgraded>0</HideWhenUpgraded>
            <Type>Army</Type>
            <AIData AIPersonality="AI_General">
                <AIPriority>5</AIPriority>
            </AIData>
        </AbilityBonusOption>
    </AbilityBonus>

then, in the item/improvement, you add

       <Prereq>
            <Type>AbilityBonusOption</Type>
            <Attribute>Wanderlust</Attribute>
            <Target>Player</Target>
        </Prereq>

also, you must obviously add the faction ability to your Faction's XML:

<SelAbilityBonusOption>Wanderlust</SelAbilityBonusOption>

 

 

It is also possible to prevent a specific faction from gaining an item/improvement using this in the item/improvement:

        <Prereq>
            <Type>RestrictedAbilityBonusOption</Type>
            <Attribute>Wanderlust</Attribute>
            <Target>Player</Target>
        </Prereq>

 

Reply #2 Top

Thanks HF, will give it a bash later.

If I "bind" it to an existing faction ability, I guess the faction already using that ability will also get it?

Will have to see if my non-existent modding skills allows me to create a custom ability...

Reply #3 Top

Yes.