Inserting .jsons

Is there a way to insert a .json into stonehearth.smod from your mod if no file exists currently?

I’m stuck as the code only recognises files froma specific path within the .smod, so I can’t append my own .json in there. I manually added the files and got it working, but that’s not a good method :confused:

Just in case I tried mixinto’ing and overriding but they don’t seem to work (as the target doesn’t exist)

Unfortunately, there’s no way at the moment :smile:

I’m as stuck as you. We can’t add our own animations for the hearthlings or the goblins.

And also other things like icons for patterns in the building editor, the path to them is hardcoded and references the stonehearth directory so no way it’ll pick the ones in our mod.

Supposedly the solution is to add some json from where directories or files would be read, so we could mixinto our directory there and it would be loaded by the game along with the corresponding stonehearth directory.

1 Like

Oh well I guess I’ll have to be patient :frowning:

At least this is only the first major snag I’ve hit :smiley:

the question is what do you want to add? its possible to add objects, receips etc.

1 Like

Some files to the data/rigs/human section. How can you add them?

the rigs? ok thats not possible ^^ because the rigs must be hardcoded inside a luac ^^

1 Like

No I mean physically add a file. That’s not possible yet, no?

to my knowledge, if something is hard coded you arent able to edit the files.

2 Likes

False. Rigs and animations, are all JSON files. It’s true that they’re played when the effect is called from within lua, but it should be relatively easy to add a custom idle animation (for example) if we didn’t have this problem with the directories.

As I’ve mentioned on my first post in this topic: no, it isn’t possible.

You can, if you override that file.

The problem is that, even if you copy all the human animations and rigs to your mod, add your own new animations, and make a mixinto/override of the skeleton file so it points to your mod rigs directory, this would make your mod incompatible with other mods that want to do the same.

Good thing is that at least I can prevent the goblins and undead from appearing in my Candyland mod, just by changing the campaigns index and scenario index files. That saves me from having to override lots of qb files and rigs… :sweat:

Edit: on the other hand, you could always override directly an animation file, if you want to change an existing animation that is being used.

2 Likes

i encountered these problems before and an override ist no good idea with one exeption

If you wan`t to override something make it a stand alone so all the people out there can clearly see what you did.
The rest of your mod is added in another folder so they work together.

Explanation:
the building_manager
you cant mixin your patterns and brushes and so on but you can override. A lot of people will do the same which isnt working together.
so out-source the building-manager override part and using it will become optional
and everyone can take your parts and integrate them into there building manager override quite easily.

Another question to the topic
mixintos are adding lines into the first position of a table
Is it possible to mixinto last position ?
(example: adding “fine” parts to an existing recipe only works if “fine” is set behind “item” because of referencing to it. If you mixin both lines you always get two normal items or one normal and one fine…which is …not what i wan`t )