Weaver UI can't open with mod

Sorry for posting yet another modding-related topic.
I have added a custom item, which is crafted by the weaver. There are two problems:

1) When I try playing the game, there is an assertion error when I promote the weaver
2) When I try to open the weaver UI it doesn’t open, but the screen does darken.

Jofferson appeared to have no problem with my mod. I have no clue what caused the problem.
Any help would be much appreciated.

Here is all the code:

manifest.json

{
“info” : {
“name” : “Flags”
},
“aliases” : {
“uk_flag” : “file(uk_flag)”
},
“mixintos” : {
“stonehearth/professions/weaver/recipes/recipes.json” : “file(mixin.json)”
}
}

mixin.json

{
“craftable_recipes” : [
{
“category” : “Flags”,
“recipes” : [
“file(uk_flag_recipe.json)”
]
}
]
}

uk_flag_recipe.json

{
“type”:“recipe”,
“work_units” : 5,
“recipe_name” : “UK Flag”,
“description” : “[TODO]”,
“flavor” : “[TODO]”,
“portrait” : “file(uk_flag/uk_flag.png)”,
“ingredients”: [
{
“material” : “berry resource”,
“count” : 1
},
{
“material” : “turnip resource”,
“count” : 1
},
{
“material” : “wood resource”,
“count” : 1
},
{
“material” : “cloth resource”,
“count” : 2
}
],
“produces”: [
{
“item”:“mymod:uk_flag”
}
]
}

And here is a Dropbox link to the uk_flag subfolder if it is necessary:
https://www.dropbox.com/sh/gn63ew307jaf7qj/AACtRdhlVeb1wvX4ipcHVOy1a?lst

I’ll take a look at the mod when I have a chance. But I’ve noticed from experience that sometimes if there is an error something to do with the recipes the crafter ui won’t open.

Edit: Kinda hard to troubleshoot when you only post part of the mod. . .

Thank you for bothering to reply : )
The files that I haven’t posted are all in the dropbox folder. I currently just have the three .json files I posted and the subfolder containing the item models etc.

No problem.

The issue most likely lies with the weaver recipe file or the uk_flag_recipe file which you haven’t posted. I don’t see any errors with the ones you posted.

If you post the rest of the mod I can try testing it myself.

1 Like

Here are the three json files which I didn’t post (the recipe file is in the original post):

uk_flag.json:

{
“mixins” : “file(uk_flag_ghost.json)”,
“components”: {
“stonehearth:entity_forms” : {
“iconic_form” : “file(uk_flag_iconic.json)”,
“ghost_form” : “file(uk_flag_ghost.json)”,
“placeable_on_walls” : true
},
“destination”: {
“region”: [
{
“min” : { “x” : 0, “y” : 0, “z” : 0 },
“max” : { “x” : 1, “y” : 1, “z” : 1 }
}
]
},
“region_collision_shape” : {
“region”: [
{
“min” : { “x” : 0, “y” : 0, “z” : 0 },
“max” : { “x” : 1, “y” : 5, “z” : 1 }
}
]
}
}
}

uk_flag_ghost.json:

{
“components”: {
“unit_info”: {
“name”: “UK Flag”,
“description”: “[TODO]”,
“icon” : “file(uk_flag.png)”
},
“mymod:material” : {
“tags” : “wood cloth decoration”
},
“model_variants”: {
“default”: {
“models”: [
“file(uk_flag.qb)”
]
}
},
“mob” : {
“model_origin” : { “x”: -0.05, “y”: 0, “z”: 0.05 },
“region_origin” : { “x”: 0.5, “y”: 0, “z”: 0.5 }
}
}
}

uk_flag_iconic.json:

{
“mixins”: “stonehearth:mixins:item_properties”,
“type”: “entity”,
“components”: {
“model_variants”: {
“default”: {
“models”: [
“file(uk_flag_iconic.qb)”
]
}
},
“mob” : {
“model_origin” : { “x”: -0.05, “y”: 0, “z”: 0.05 }
}
}
}

On a very first look the “mixin.json” does not look like it fits the structure of the “recipes.json”.

Taking a look into it…

@sir_ghost still looking into it, but give it a try and change your mixin.json to look like that:

{
   "craftable_recipes" : {
      "Flags" : {
         "UK Flag" : {
            "uri" : "file(uk_flag_recipe.json)"
           }
      }
   }
}

You have to pay attention. With Alpha 4 the structure of items and related files have been adjusted. Maybe you are mixing here some legacy-formats with the actual ones.

… in addition you will have to change the path to the “portrait” in your file “uk_flag_recipe.json”, otherwise there will be only a black box shown in the workbench instead of a preview.

… probably also adjust your alias for uk_flag in the manifest.json into “file(uk_flag.json)”.

… and finally you need to save your qb-file with different settings, i.e. “compression” has to be off, otherwise your Stonehearth will crash once you have crafted the flag (see here: http://minddesk.com/blog/modding-stonehearth-first-steps/).

4 Likes

@voxel_pirate Thank you very much! That fixed all of the problems. I had indeed been using an outdated tutorial, which led to one of the brackets being square not curly.

1 Like