What do tile improvements need?

Reliquary

Chieftain
Joined
Jun 2, 2017
Messages
29
I've been extensively reading through a lot of these threads and slooowly understanding more of the technical stuff that comes up, but I've mostly been seeing people focusing on units and buildings.
I did see @Amatheria 's resourceful mod, which I've been using as a reference to try and make my own improvement tile, but that only goes so far since compiled mods hide most of the files.

I also didn't want to interrupt his own thread on that just to ask this lol. But anyhow, I'm having a hard time getting new improvements to show up in the game and I have zero concept of what I'm missing. Thought maybe someone out there could clarify ^^

Right now I only have an XML file that outlines all the improvement info (yields, tech reqs, bonuses, etc), modeled after the one in the pantry and Amatheria's mod; and another XML that has all the text information for it.


Pretty sure this is irrelevant for now, since all I'm trying to achieve at the moment is to make the improvement show up and be buildable in the game, but in case it's necessary: I also have a .ast file with all it's .fgx/anm/geo files, materials and textures. I think that's properly setup since they all work just fine in the asset editor and in theory should be able to go right into the game as soon as I learn how to tell the mod to use it. I have a .artdef and a .xlp as well but those I'm not sure are set up right, but again idk if that's relevant at this stage.

Any help on this would be appreciated. Thanks a lot my dudes ^^
 
I just added a tile improvement to my civ, quite simple actually (easier than district... although I haven't figured out the artdef yet lol)
Do you see any errors in the Database.log or Modding.log ?
If you don't mind, share the ModBuddy folder so people can look through the code.
 
Uhh, still figuring out how to do stuff like sharing file on the forum, but in the mean time, here's my entire code lol. It's got what I thought was the bare minimum to get an improvement to pop up in the game.

Code:
<?xml version="1.0" encoding="utf-8"?>
<GameInfo>
    <Types>
        <Row Type="IMPROVEMENT_WINDTOWER" Kind="KIND_IMPROVEMENT"/>
    </Types>
    <Improvements>
        <Row ImprovementType="IMPROVEMENT_WINDTOWER" Name="LOC_IMPROVEMENT_WINDTOWER_NAME" Description="LOC_IMPROVEMENT_WINDTOWER_DESCRIPTION" Icon="ICON_IMPROVEMENT_OFFSHORE_OIL_RIG" PlunderType="PLUNDER_GOLD" PlunderAmount="100" Buildable="true" PrereqTech="TECH_POTTERY" Housing="1" TilesRequired="2"/>
    </Improvements>
    <Improvement_ValidFeatures>
    </Improvement_ValidFeatures>
    <Improvement_ValidTerrains>
    </Improvement_ValidTerrains>
    <Improvement_ValidTerrains>
        <Row ImprovementType="IMPROVEMENT_WINDTOWER" TerrainType="TERRAIN_DESERT"/>
        <Row ImprovementType="IMPROVEMENT_WINDTOWER" TerrainType="TERRAIN_TUNDRA"/>
        <Row ImprovementType="IMPROVEMENT_WINDTOWER" TerrainType="TERRAIN_PLAINS"/>
        <Row ImprovementType="IMPROVEMENT_WINDTOWER" TerrainType="TERRAIN_GRASS"/>
        <Row ImprovementType="IMPROVEMENT_WINDTOWER" TerrainType="TERRAIN_SNOW"/>
        <Row ImprovementType="IMPROVEMENT_WINDTOWER" TerrainType="TERRAIN_DESERT_HILLS"/>
        <Row ImprovementType="IMPROVEMENT_WINDTOWER" TerrainType="TERRAIN_TUNDRA_HILLS"/>
        <Row ImprovementType="IMPROVEMENT_WINDTOWER" TerrainType="TERRAIN_PLAINS_HILLS"/>
        <Row ImprovementType="IMPROVEMENT_WINDTOWER" TerrainType="TERRAIN_GRASS_HILLS"/>
        <Row ImprovementType="IMPROVEMENT_WINDTOWER" TerrainType="TERRAIN_SNOW_HILLS"/>
    </Improvement_ValidTerrains>
    <Improvement_ValidResources>
    </Improvement_ValidResources>
    <Improvement_ValidBuildUnits>
        <Row ImprovementType="IMPROVEMENT_WINDTOWER" UnitType="UNIT_BUILDER"/>
    </Improvement_ValidBuildUnits>
    <Improvement_YieldChanges>
        <Row ImprovementType="IMPROVEMENT_WINDTOWER" YieldType="YIELD_SCIENCE" YieldChange="2"/>
    </Improvement_YieldChanges>
    <Improvement_BonusYieldChanges>
       
    </Improvement_BonusYieldChanges>
</GameInfo>
 
so i copy-pasted the code that you shared, and the improvement is working.
it is buildable and shows up in the techtree for me
obviously it has no model, so the tile still looks empty after building it, but the +2science is there

so that means if this is all the code you have, the problem has to be your .modinfo
if you could share that as well ill try to help you further
 
Hmm, just tested it again myself. No dice. Here's the .modinfo code, hopefully it'll clear it up. Thanks for the help ^^

Edit: Ok, in retrospect, it seems I missed out on setting up some properties in the mod file. I'll read up on that while I wait for a response here lol.

Code:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="3d13e639-cfb6-462a-a52c-d4c11347ffe9" version="1">
  <Properties>
    <Name>WindTowerTest</Name>
    <Description>This is a brief description of the mod.</Description>
    <Teaser>This is a brief description of the mod.</Teaser>
    <Authors>Authors</Authors>
  </Properties>
  <Files>
    <File>imp_WindTower.xml</File>
  </Files>
</Mod>
 
Last edited:
you modinfo currently does nothing.
listing your code as a file is not enough, you have to tell the game what your mod wants to do with those files
in your case, you want to update the games database
Code:
<Properties>
    <Name>WindTowerTest</Name>
    <Description>This is a brief description of the mod.</Description>
    <Teaser>This is a brief description of the mod.</Teaser>
    <Authors>Authors</Authors>
  </Properties>
  <Components>
        <UpdateDatabase id="doesntmatter">
            <Items>
                <File>imp_WindTower.xml</File>
            </Items>
        </UpdateDatabase>
  </Components>
  <Files>
    <File>imp_WindTower.xml</File>
  </Files>
you need a <Components> section and in that <UpdateDatabse> with <Items> and your <File>

i think there is a guide somewhere here on the forum on how modinfo is structured and what parts you need for what
 
Oh oh, I just sort of figured modbuddy would take care of all that. I'll go look into it. Thanks a lot!
 
Excellent, it's working now! Next step is to tie all the art assets into it lol.
 
Modbuddy will take care of all that for you. But you need to tell Modbuddy what to do with a given file. It does not know what is in the file, and cannot auto-guess what it should do.

So, for a file like you have, you want an InGame Action, like as shown here
Spoiler :


Right-Click the mod-name after you open it in Modbuddy and select "properties" from the pop-up menu, and from there select the "In-Game Actions" tab.

Then you click on "Add Action", which adds a "blank" action that will default to an "UpdateDatabase" type of action.

Then within the action you add your files that need to be activated by that action.

You should also give each action a unique "ID" description but do not use spaces anywhere within it and do not start the "ID" name of the action with a number.

Be sure to save your changes to the ModBuddy "project" and then you can perform a "Build" and Modbuddy will add the needed actions and file names for those actions to the modinfo file that is created along with the rest of the mod.
 
So I've learned! This bit of reference is super handy, though. Thank you!

At present I've got the improvement to show up along with appropriate text and custom icons for it, so my next step is to get the 3D asset in... that's gonna be a trip lol
 
Alright, I've gotten a ton of progress in since my initial trip way up at the start. As of now, I'm almost done, I just need to get the 3D asset to show up in-game, at which point I'm thinking of putting together a guide on how to set this up since I've been documenting my process.

I think I have everything set up correctly, or at least that's the impression I get from comparing all my files to the reference mods and pantry items. I'm probably missing something real subtle with it.

I'm attaching my current project file. So if anyone wants to take a crack at it, be my guest!

Please and thank!

EDIT: Updated the file with some new stuff. Mostly just me attempting to fill in the blanks. Still no dice.
 

Attachments

  • BMB_Windtower_wip.zip
    1,012.8 KB · Views: 44
Last edited:
Top Bottom