Hello, I started doing mods as long as it is not very similar to the mods … did on this article [Tutorial] Adding additional doors in the custom design builder
I know that there is an old version but I think they say more needs to step up and I was right
2 points is successful
but on the 3 point I was stuck so ask or help to carry it out.
Thank you in advance
A14 version r504.
Hey @Vladislav26rus, can you share the link to the article you followed please. Paging our amazing modding support @Drotten.
I’m sorry I did not see at once
Ooh! I can actually help with this one. (Can’t help with mods very often, but I have a door mod myself!). That tutorial (particularly step 3) is out of date. Give me a few minutes to write up some instructions.
OK. So this isn’t going to be quite as detailed as the topic you linked, but here we go.
Locate an existing door in the game files that you can work off of. This will make your life a lot easier by ensuring that the dimensions and everything is right. I am going to use the wooden_door
as an example here.
-
Open the existing
stonehearth.smod
. -
Rename
stonehearth.smod
tostonehearth.zip
-
Extract
stonehearth.zip
-
Open the new
stonehearth
folder and navigate to the door (or other object) you wish to work with. -
In the case of a door, open
\stonehearth\entities\construction\
. -
In this case open
wooden_door
. -
Copy the entire folder (which for a door should have 6 files) to your desktop, or someplace outside of the game folder.
-
Rename all the files and the folder to your new name. If you were (for example) making a castle door, then the folder and all files in it should have the word
wooden
replaced withcastle
. -
You will also need to edit some of the internal files.
-
Inside the main
json
file, you will again need to rename all instances ofwooden
withcastle
(or whatever your name is) -
Same goes for the ghost and iconic
json
files. -
Edit the models to your liking.
-
Open the two
qb
files in the voxel editor of your choice and design away. -
Note that the non-iconic file is the full-sized door, and should be fully detailed. The iconic file is what the door looks like in a stockpile and while carried, and thus should be smaller and less detailed.
-
Replace the png with a new image of your edited door.
-
Create the folder for you mod. I would highly recommend following Stonehearth’s folder structure, as it helps keep everything clean. You will need the following structure:
-
Create a
building_brushes.json
file in the\data\build\
folder.
Add the following to the file (renaming as needed, this assumes a wooden door, in a mod calledcastle_door_mod
with the door calledcastle_door
){ "doors": { "wood resource" : { "entities": [ "castle_door_mod:castle_door" ] } } }
-
Create the recipe (so this can be crafted)
Continued in next post…this is getting so long the editor is unhappy
Ok, post editor doesn’t seem to like code within nested lists…the tab has crashed twice. but that’s a bug with Discourse I will go report later…
Here we go (no nested lists):
(1) Create a recipes.json
file in the recipes
folder:
(2) It should look something like this:
{
"craftable_recipes" : {
"building_parts" : {
"ordinal" : 4,
"name" : "Building Parts",
"recipes" : {
"castle_door_recipe" : {
"recipe" : "file(castle_door_recipe.json)"
}
}
}
}
}
(3) Create the specific door’s recipe. It should look something like this:
{
"type" : "recipe",
"work_units" : 3,
"recipe_name" : "Name of Item Here",
"description" : "Description of Item here",
"flavor" : "Optional - funny text to appear in the crafting interface",
"portrait" : "/castle_door_mod/entities/construction/castle_door/castle_door.png",
"workshop" : "stonehearth:carpenter:workbench",
"ingredients": [
{
"material" : "wood resource",
"count" : 1
}
],
"produces": [
{
"item":"castle_door_mod:castle_door"
}
]
}
(4) Be sure to change the name, description, flavor, and ingredients as needed. work_units
is how long it takes to craft, so change that (higher = longer) if you see the need.
Finally, wrap up the entire mod with the manifest.json
file. That should look something like this:
{
"info" : {
"name" : "castle_door_mod",
"version" : 2
},
"aliases" : {
"castle_door" : "file(entities/construction/castle_door)"
},
"mixintos" : {
"stonehearth/jobs/carpenter/recipes/recipes.json" : "file(recipes/recipes.json)",
"stonehearth/data/build/building_brushes.json": "file(data/build/building_brushes.json)"
}
}
And that should be it. Be aware if you edit an existing door’s qb file that you need to use a program that supports multiple matrixes so the animation will still work. @Drotten should be able to confirm which programs work, and/or if I missed anything. Once you make all the edits to the files, let us know if you have any remaining issues!
Somewhat only I’m afraid, I haven’t gone around to testing different editors myself; I can only tell you of what I’ve heard and read around here. Qubicle constructor by Minddesk works, of course, but that’s pay to use, so if you’re not sure that you will be modelling a lot, nor have the money for it, it might be better for you to look at free alternatives. For those, there is Stonevox by @honestabelink, that one has pretty much what you need to make models just for Stonehearth. MagicaVoxel is also a popular, and free, editor but it can’t handle multiple matrices and therefore can’t really be used for models that play animations, such as doors.
For the tutorial itself, it’s pretty solid; there’s just a couple things I want to mention:
For point 7
: there’s a comma there that shouldn’t exist. It gives a mean error in that the game doesn’t say there is a problem, but the building editor will be completely unusable as a result.
For recipes.json: when referring to the recipe’s file by starting with "file(../recipes/ ... )"
is a bit unnecessary; the recipes file is inside the recipes folder to begin with. It’s enough (and cleaner imo) to keep it as "file(castle_door_recipe.json)"
.
Fixed, thanks! I was working with the code for my doorway mod which has 2 doors, so a stray comma or two was inevitable.
Good to know. Done.