Modding concerns and current scope

I have a few questions and concerns to our current modding possibilities. :sweat_smile:

  1. Will we be able to have control over the terrain generation eventually?
  2. Like being able to define quantity and distribution of plants, which plants and wildlife would we like to have, and minerals, water, etc - to make our own biome or modify an existing one?
    (Not necessarily over the height map)
  3. Would we have some way to define water color too without having to override the whole water code (we can change terrain colors currently, why not water - despite its current nature of no shadows and bugs)?
  4. How am I supposed to add my building patterns to the new editor? I’m talking about the icons to select floor / roofs / etc, which have the image path hardcoded in the js, so no matter if I try to mixinto a less file, it won’t work (I don’t know if to mixinto an html or css file would work anyway(?))… :disappointed_relieved:

If you have any other concern or improvement to the modding API you can suggest it here rather than in the suggestions category…

6 Likes

Good questions!

Adding @albert for the terrain and water questions, and @Tom for the building editor.

4 Likes

It’s somewhat doable, Jelly had it until its recent version (I couldn’t be bothered to do the jump to the water change when nobody was using the API anyway). The landscaper needs a few adjustments to be really able to do it, but it’s not a big deal to do it (and to do it properly on top of it). You can take a look at Jelly’s landscaper.lua to see what would be required to make it more flexible, or at least, the way I did it.

3 Likes

Regarding your questions about terrain / world generation:

Yes, we’ll probably clean this up and expose it when we do our first new biome.

Except for trees and berry bushes, you can do this today by modifying the scenario files.

All the current water rendering is just placeholder. Once we have a mature water renderer, we can expose the parameters.

8 Likes

Another question/concern… :sweat_smile:

Can I reuse the candledark pumpkins for my mod? :anguished:
They are such cute lanterns… :jack_o_lantern: I’d give credits.

5 Likes

Ok, now I have a new concern. :disappointed_relieved:
Given this tutorial,


the only way to add custom animations for existing entities would be adding the files into the stonehearth directory/smod, due to these lines in the skeleton files:

"animation_root" : "file(../animations/male)",
"effects_root" : "file(../effects)",

How could we add our own effect+animation so we can add a new animation for the humans or goblins from our own mod? Say I make a new weapon and I need a fitting animation for fighting with it. It needs to be on the rig subfolders in the stonehearth mod, which makes it totally incompatible with other mods. :cold_sweat:

5 Likes

Also, if we add critters, they won’t spawn for the trapper tasks, due to another hardcoded variable :disappointed_relieved:

In trapping_grounds_component.lua there’s this function called _choose_spawned_critter_type(), which has this:

local critter_types={'stonehearth:rabbit','stonehearth:racoon','stonehearth:red_fox','stonehearth:squirrel',}
3 Likes

Yeah, I recently noticed this as well. Was gonna use it for the tutorial I’ve been writing, but alas it will have to wait until it can be added without having to override a file.

It would be nice to able to get new kinds of pets through the trapper.

1 Like

I want my Wolpertinger

Components can be monkey patched. The following code is untested, but should give you a rough idea.

This has some caveats, however. In particular, if two mods do it, only one will succeed. The magic is in building a function that can be extended by many mods at the same time. In this case, because of random magic, it’s not that easy.

Edit: As to how I would do it in this case…

Append to the initialize function a table that is either already set (by another mod) or gets set by us. After the table certainly exists, we inject our critter into it.

The spawning function then simply selects one critter of that list - which can now be done by multiple mods (using this approach). Feel free to use it, but put a link to this post next to it please.

3 Likes