Help with my first mod

I’m hoping someone would look though this and figure out what I’m missing/messed up/etc.

This is my first object/mod I have ever done for a game. I copied the comfy beds to make my new ones, and everything looks right to me, but having issues in the game. Using the debugging stamper, the iconic on the cursor still shows as the original comfy bed, shows the one I made after stamped, but it rotates 90 degrees counter clockwise. The fine version won’t stamp an iconic version, and when the full entity is placed it is completely off from the outline of where it should be placed on the grid.

Thanks in advance!

just a guess, is it the destination / region / model origin values?

A safe guess.
What exactly did you change/add in your mod? Did you edit the models?

I think he just recolored the standard wooden bed to look like stone, a simple mod

Yeah, I edited the models a little bit, changed the recipe to use stone instead of wood, and changed it to add the recipe to the mason instead of the carpenter. As for the destination / region / model, I left them the same as as the original.

stone_bed_recipe.json
line 7
"portrait" : "/dales_items/entities/furniture/stone_bed/stone_bed.php",

shouldn’t that be .png?

lol, yeah. Habits…

so did that fix it or do you still have that rotation issue?

Yeah, I’m trying to figure out the offsets now. Everything about the iconic seems screwy. The iconic ghost shows the original voxel, not the one I changed, and does the rotation thing.

stone_bed_iconic.json
stone_bed_ghost.json
look at line 3 “type”: “entity”, on both your iconic and ghost, you got the two mixed up. swap line 3 around to the other file

“type”: “entity”, should be in iconic
and not in ghost

let me know if that fixes it

Unfortunately nope.

BTW, Thank you for taking the time helping me out.

no problem, I’m sort of figuring this out with you lol :smile:

so are you sure that stone_bed_iconic.json

requires line 16?
"region_origin" : { "x": 0.5, "y": 0, "z": 0.5 }

I don’t think it does?

other than that I would just recheck stone_bed.json for errors I think that should be it

I just assume it does. All of the json files I copied over from comfy_bed and and comfy_bed_fine from the stonehearth.smod. I didn’t make any changes to the array structure in any of the files, I just changed string names, and the gold value int’s.

I think I’m going to try to retry from scratch and see how that works.

idk I’m comparing to the stonehearth.smod and it seems to have some differences, I’m not sure, you are correct your numbers are the same - I’m sorry I was using an outdated file to reference :disappointed_relieved:

it must be one of these files
stone_bed_recipe.json
recipes.json

though I’m not exactly sure why…

line 12 in comfy_bed_recipe.json
"uri": "stonehearth:furniture:not_much_of_a_bed",

this is completely different
line 12 stone_bed_recipe.json
"material" : "stone resource",

That’s why I came on here asking for help, because it makes no sense to me at all. I have a good programming background, and I’m very good at replicating syntax. I’ve poured over everything looking for some stupid mistake and have failed to find it.

That’s the components of the recipe. The comfy bed requires the basic bed to craft it. I changed it to require stone instead.

yeah the only thing I can think of is maybe they updated the ways you have to link the mod to the game somehow and its throwing this off, or its a bug related to the current version of the game you are using and no amount of staring at this code will fix it

Could be. I thought that by coping something I know works, I wouldn’t run into the piggy_bank one possibly being outdated.

It’s a guess but if you’ve changed the qubicle files and for example rotated one before exporting it, it could mess up the coord’s your using. I’ll have a look at the mod this evening after i’m home from work.

:grin: ya I thought of that, I probably shoulda mentioned it , if thats it imma laugh

Ok I had a look at it for the coordinates of the different sections. I noticed that you changed the position of the bed in the cubicle file and that’s why the coordinates are a mess. But that needs not to be a problem because you can adjust some things in code.

Beneath a picture of the bed with your original coords

The red and blue color boxes don’t cover your bed at all. That’s a problem. The tools I use are the debugger tools from stonehearth witch you can download from there github (there is somewhere a forum tread about it i think). The Entity editor brings up this menu. (Pencil in the purple box), with that tool you can adjust those boxes. Like I did in the next picture.


To get the coords for the script you can click the little scrolls and copy the code.

But unfortunately that saves the collision problem but not the sleeping, problem. I tried adjusting the
“mount_offset”: { “x”: 20, “y”: 1, “z”: 1.25 }, coords, but that did not resolved the problem until i noticed something with the axis.

With your bed the axis green, red, blue cross, are on the left side of your bed, that is also why the rotation does not work very well I think. On the normal bed (picture below) there are in the midst of the bed. Your heartlings uses this axis as origin for there sleeping coords I asume.

My advise, reopen the model in qubicle place it on the right position axis in the middle of the bed.
Then try to use the original coords for the mean bed, but even better verify the coords with the entity editor from the the debug tools and adjust the coords accordingly.

The coords that made this model regions adjusted for the pictures where:
in the ghost file

code block

´´´
“mob”: {
“model_origin”: {
“x”: 0.5,
“y”: 0,
“z”: 0.1
},
“region_origin”: {
“x”: 0,
“y”: 0,
“z”: 0
}
}
´´´

in the normal file
´´´
“destination”: {
“region”: [
{
“min”: {
“x”: -4,
“y”: 0,
“z”: 1
},
“max”: {
“x”: -1,
“y”: 1,
“z”: 4
}
}
]
},
“region_collision_shape”: {
“region”: [
{
“min”: {
“x”: -4,
“y”: 0,
“z”: 0
},
“max”: {
“x”: -1,
“y”: 1,
“z”: 5
}
},
{
“min”: {
“x”: -4,
“y”: 1,
“z”: 4
},
“max”: {
“x”: -1,
“y”: 2,
“z”: 5
}
},
{
“min”: {
“x”: -4,
“y”: 1,
“z”: 0
},
“max”: {
“x”: -1,
“y”: 2,
“z”: 1
}
}
]
}
´´´

I’ll hope that helps.

1 Like