[Tutorial] Adding mining resources

OK. So the list of blocks you can name is now in the stonehearth mod at /data/terrain/terrain_blocks.json.

When you mixin to that file, you just need to add:

   "selectable_kinds" : {
      "MY_RESOURCE_ore" : "MY_ALIAS"
   }

You then have to create that alias in your manifest. It will point to a file that contains the information about that block type.

For an example, check inside the stonehearth mod at entitites/terrain/ui/coal_block.json. You’ll have to modify it a bit though so that it correctly points at the ore_block.json it mixins from. It will look like:

{
   "mixins" : "/stonehearth/entities/terrain/ui/ore_block",
   "components" : {
      "unit_info" : {
         "name": "MY_RESOURCE Vein", 
         "description": "Provides MY_RESOURCE when mined."
      }
   }
}

And that should be that. You’ll have a clickable tooltip for your ore vein. Obviously everything in ALL_CAPS_AND_UNDERSCORES is something you will need to name yourself.

3 Likes

now means in alpha 11 ?
because i tried it out (10.5.10) and it`s not working out and no error emerges

Yes. As in develop-2521 in alpha 11.

You won’t get any error messages because nothing is wrong with the json files. Json files are just data. Superfluous data is simply ignored without causing an error.

2 Likes

Well, with the introduction of Biomes, adding in your own veins just got harder! The “color” tag in terrain_blocks.json is now deprecated and the color of your veins is now stated in each individual biome file.

Currently, the game only uses stonehearth/data/biome/temperate.json, but eventually we’ll have at least 3 biomes (arctic and desert) and probably many more. In each biome json file, you need to find the “palettes” tag and then the “spring” tag within that. You’ll see that every kind of terrain block is named and has its own color. Later, we can expect to see more seasons than spring, so be prepared for that too!

Anyway, you’ll need to add an additional entry to the list of spring colors that defines your “kind” of block. The name for the color must be the same as you defined in /data/terrain/terrain_blocks.json in “selectable kinds”. Do all this with a mixinto file type (not forgetting to add the manifest entry).

BTW, @phector2004, with all the changes since you made your tutorial, is it possible for you to update it? If not, would you mind if I made a tutorial topic on the subject myself?

2 Likes

I’m really tight on time, so go for it, kid!

1 Like

that would be great for me, then i would actually probably revive an “old” project of mine…

1 Like

OK. New tutorial topic is here. Let me know what you think :slight_smile:

2 Likes

Might have a look at it this weekend. Looks very organized :smile:

Can someone make a class tutorial please that would be amazing

1 Like

hey look at this

http://discourse.stonehearth.net/t/to-many-mods-what-you-think/17634?u=xmmcxrockx

You might want to make a separate thread to ask for a class tutorial. I don’t know anything about adding new classes, but you can look at some other modders’ stuff to see how they managed it.

Best of luck!

2 Likes

Yeah I’ve started that I thought there would be an easy way like the resource tut