Trying my hand at modding, have a few questions

Hello everyone:

I am trying to add a faction specific building into the game, however I am running into a bit of trouble:

Here is the code for the building (I am just copying the Scrying pool ATM)

    <ImprovementType InternalName="Mana Forge">
        <DisplayName>Mana Forge</DisplayName>
        <Description>Mana Forges increase the yields of any city they are built in.</Description>
        <RequiresCity>1</RequiresCity>
        <BarredTerrain>River</BarredTerrain>
        <BarredTerrain>SwampTerrain</BarredTerrain>
        <PreferredTerrain>City</PreferredTerrain>
        <PreferredTerrain>Category:Land</PreferredTerrain>
        <PreferredTerrain>Forest</PreferredTerrain>
        <Prereq>
            <Type>Race</Type>
            <Attribute>Race_Type_Ancients</Attribute>
            <Target>Player</Target>
        </Prereq>
        <LaborToBuild>120</LaborToBuild>
        <GameModifier>
            <ModType>Resource</ModType>
            <Attribute>TileYieldEssence</Attribute>
            <Value>1</Value>
            <PerTurn>1</PerTurn>
            <Provides>+1 Essence</Provides>
        </GameModifier>
        <AIData AIPersonality="AI_General">
            <AIPriority>20</AIPriority>
            <AITag>Study</AITag>
        </AIData>
        <ArtDef>Art_ScryingPool</ArtDef>
    </ImprovementType>

 

When I start a new game with my custom faction, it shows the Mana Forge as something I can build on the Sovereign screen, however when I start a new game and start a new city, the Mana forge does not show up in the build queue. Am I missing something?

10,724 views 7 replies
Reply #1 Top

Try tying it to an ability instead of race. Can't find an instance of a building based on race, so it's possible the engine just won't take that when it's time to generate building choices.

So take your <Prereq></Prereq> tag above and its content, and over-write with this:

Code: xml
  1.         &lt;Prereq&gt;
  2.             &lt;Type&gt;AbilityBonusOption&lt;/Type&gt;
  3.             &lt;Attribute&gt;ABILITY-NAME-GOES-HERE&lt;/Attribute&gt;
  4.             &lt;Target&gt;Player&lt;/Target&gt;
  5.         &lt;/Prereq&gt;

Reply #2 Top

Well, I tried that, however it disappeared from the sovereign screen when I started a new game and still didn't show up in the build queue. I tried tying it to the race blood ability.

 

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

Reply #3 Top

Quoting coollonewolf1978, reply 2

Well, I tried that, however it disappeared from the sovereign screen when I started a new game and still didn't show up in the build queue. I tried tying it to the race blood ability.

Has to be a player ability, not just any ability. I'd say for now, just create a player ability (copy FleshBoundTome or something) and call it "Ancient Architecture" or whatever. Give it to your faction in their RaceConfig file, and then the building should work.

Reply #4 Top

Alright I tried making a player ability Ancient Legacy:

    <AbilityBonus InternalName="Ancient_LegacyAbility">
        <AbilityBonusType>Player</AbilityBonusType>
        <AbilityBonusOption InternalName="Ancient Legacy">
            <DisplayName>Ancient Legacy</DisplayName>
            <Description>Grants access to a unique set Buildings and abilities.</Description>
            <Icon>Ability_Archers_Icon.png</Icon>
            <GameModifier>
                <Provides>Grants access to a unique set Buildings and abilities.</Provides>
            </GameModifier>
            <Cost>0</Cost>
            <Type>Army</Type>
            <AIData AIPersonality="AI_General">
                <AIPriority>5</AIPriority>
            </AIData>
        </AbilityBonusOption>
    </AbilityBonus>

 

Added it to the race xml file:

        <SelAbilityBonusOption>Ancient Legacy</SelAbilityBonusOption>

 

And modified the building:

    <ImprovementType InternalName="Mana Forge">
        <DisplayName>Mana Forge</DisplayName>
        <Description>Mana Forges increase the yields of any city they are built in.</Description>
        <RequiresCity>1</RequiresCity>
        <BarredTerrain>River</BarredTerrain>
        <BarredTerrain>SwampTerrain</BarredTerrain>
        <PreferredTerrain>City</PreferredTerrain>
        <PreferredTerrain>Category:Land</PreferredTerrain>
        <PreferredTerrain>Forest</PreferredTerrain>
        <Prereq>
            <Type>AbilityBonusOption</Type>
            <Attribute>Ancient Legacy</Attribute>
            <Target>Player</Target>
        </Prereq>
        <LaborToBuild>120</LaborToBuild>
        <GameModifier>
            <ModType>Resource</ModType>
            <Attribute>TileYieldEssence</Attribute>
            <Value>1</Value>
            <PerTurn>1</PerTurn>
            <Provides>+1 Essence</Provides>
        </GameModifier>
        <AIData AIPersonality="AI_General">
            <AIPriority>20</AIPriority>
            <AITag>Study</AITag>
        </AIData>
        <ArtDef>Art_ScryingPool</ArtDef>
    </ImprovementType>

 

I tried starting a new game and the Mana Forge showed up again in the Sovereign screen however when I started a new game it still was not showing up in the build queue.

Reply #5 Top

want to send me your files in a .rar or .zip? i could play around and find the issue.

Reply #6 Top

Well I got it to work finally. The problem? It apparently was this:

<ImprovementType InternalName="Mana Forge">

The game apparently did not like the space in the Internalname. By removing it, it works fine now.

<ImprovementType InternalName="ManaForge">

 

Reply #7 Top

Quoting coollonewolf1978, reply 6

Well I got it to work finally. The problem? It apparently was this:

<ImprovementType InternalName="Mana Forge">

The game apparently did not like the space in the Internalname. By removing it, it works fine now.

<ImprovementType InternalName="ManaForge">

Yeah, I noticed that, but wasn't sure if it would actually bother the engine. Guess so!

Try out the tile editor to make your mana forge look unique?