Messed up tech tree

Lawrencelot

Chieftain
Joined
Oct 15, 2016
Messages
13
I'm trying modding for the first time by adding an improvement. Many things were copied from the farm improvement, so the only thing that depends on the tech tree is this file:

Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 4/14/2017 12:18:34 PM -->
<GameData>
  <!-- TODO: Insert table creation example here. -->
    <Builds>
        <Row>
            <Type>BUILD_FARMINGVILLAGE</Type>
            <PrereqTech>TECH_POTTERY</PrereqTech>
            <ImprovementType>IMPROVEMENT_FARMINGVILLAGE</ImprovementType>
            <EntityEvent>ENTITY_EVENT_BUILD</EntityEvent>
            <OrderPriority>98</OrderPriority>
            <Kill>true</Kill>
            <IconIndex>56</IconIndex>
            <IconAtlas>UNIT_ACTION_ATLAS</IconAtlas>
        </Row>
    </Builds>
    <BuildFeatures>
        <Row>
            <BuildType>BUILD_FARMINGVILLAGE</BuildType>
            <FeatureType>FEATURE_FOREST</FeatureType>
            <PrereqTech>TECH_MINING</PrereqTech>
            <Time>400</Time>
            <Production>20</Production>
            <Remove>true</Remove>
        </Row>
        <Row>
            <BuildType>BUILD_FARMINGVILLAGE</BuildType>
            <FeatureType>FEATURE_JUNGLE</FeatureType>
            <PrereqTech>TECH_BRONZE_WORKING</PrereqTech>
            <Time>700</Time>
            <Remove>true</Remove>
        </Row>
        <Row>
            <BuildType>BUILD_FARMINGVILLAGE</BuildType>
            <FeatureType>FEATURE_MARSH</FeatureType>
            <PrereqTech>TECH_MASONRY</PrereqTech>
            <Time>600</Time>
            <Remove>true</Remove>
        </Row>   
    </BuildFeatures>
 
</GameData>

Yet when I try the mod, the tech tree is completely messed up. I got the following error three times:

[18678.467] Runtime Error: Assets\DLC\Expansion2\UI\InGame\TechTree\TechButtonInclude.lua:637: bad argument #1 to 'ConvertTextKey' (string expected, got nil)

I'm only using XML. Any ideas?
 
Found a solution: needed to add a description to that particular file.

Now I only need to figure out how to let workers show the option to build it.
 
Found a solution: needed to add a description to that particular file.

Now I only need to figure out how to let workers show the option to build it.
Code:
<Unit_Builds>
        <Row>
            <UnitType>UNIT_MONGOLIAN_KHAN</UnitType>
            <BuildType>BUILD_CITADEL</BuildType>
        </Row>
</Unit_Builds>
To make sure a unit can build your improvement (citadel as an example)

----

Also, don't forget to properly implement IMPROVEMENT_YOURIMPROVEMENT in terms of where you can construct it, as it will not show up for the specified unit if it cannot construct it on a tile!
Code:
<Improvement_ValidTerrains>
<Row>
            <ImprovementType>IMPROVEMENT_CITADEL</ImprovementType>
            <TerrainType>TERRAIN_GRASS</TerrainType>
        </Row>
        <Row>
            <ImprovementType>IMPROVEMENT_CITADEL</ImprovementType>
            <TerrainType>TERRAIN_PLAINS</TerrainType>
        </Row>
        <Row>
            <ImprovementType>IMPROVEMENT_CITADEL</ImprovementType>
            <TerrainType>TERRAIN_DESERT</TerrainType>
        </Row>
        <Row>
            <ImprovementType>IMPROVEMENT_CITADEL</ImprovementType>
            <TerrainType>TERRAIN_TUNDRA</TerrainType>
        </Row>
        <Row>
            <ImprovementType>IMPROVEMENT_CITADEL</ImprovementType>
            <TerrainType>TERRAIN_SNOW</TerrainType>
        </Row>
    </Improvement_ValidTerrains>

There are also these two tables for further finetuning:
<Improvement_ResourceTypes> (allow the improvement to be built on a specific resource)
<Improvement_ResourceType_Yields> (give more yields based on where the improvement is located)
 
Thanks Troller0001, I forgot to check Unit_builds. The other Improvement columns I just copied from the Farm so they worked fine.
 
Top Bottom