Baker_Mod still crashes

Hi Guys :slight_smile:
Currently I try to write a little mod to add a new class to the game. Now I tried to test it in the game, but
I run directly in multiple Errors and the game won´t start but instead get stuck in a black screen right before the
Radiant-Logo appears.
Now I´m not familiar enough with Lua as programming language, to figure out on my own why this Errors happen.
The Errors are following:
1.
– Script Error (lua) Begin -------------------------------
stonehearth/lib/catalog/catalog_lib.lua:105: attempt to index local ‘json’ (a nil value)
stack traceback:
[C]: ?
stonehearth/lib/catalog/catalog_lib.lua:105: in function ‘_add_catalog_description’
stonehearth/lib/catalog/catalog_lib.lua:169: in function <stonehearth/lib/catalog/catalog_lib.lua:93>
(tail call): ?
stonehearth/lib/catalog/catalog_lib.lua:42: in function ‘load_catalog’
…nehearth/services/server/catalog/catalog_service.lua:15: in function ‘initialize’
stonehearth/stonehearth_server.lua:84: in function ‘create_service’
stonehearth/stonehearth_server.lua:138: in function <stonehearth/stonehearth_server.lua:133>
[C]: ?
[C]: in function ‘trigger’
radiant/modules/events.lua:55: in function <radiant/modules/events.lua:55>
– Lua Error End -------------------------------

– Script Error (lua) Begin -------------------------------
stonehearth/lib/catalog/catalog_lib.lua:105: attempt to index local ‘json’ (a nil value)
stack traceback:
[C]: ?
stonehearth/lib/catalog/catalog_lib.lua:105: in function ‘_add_catalog_description’
stonehearth/lib/catalog/catalog_lib.lua:169: in function <stonehearth/lib/catalog/catalog_lib.lua:93>
(tail call): ?
stonehearth/lib/catalog/catalog_lib.lua:42: in function ‘load_catalog’
ces/client/catalog_client/catalog_client_service.lua:11: in function ‘initialize’
stonehearth/stonehearth_client.lua:61: in function ‘create_service’
stonehearth/stonehearth_client.lua:87: in function <stonehearth/stonehearth_client.lua:82>
[C]: ?
[C]: in function ‘trigger’
radiant/modules/events.lua:55: in function <radiant/modules/events.lua:55>
– Lua Error End -------------------------------

– Script Error (lua) Begin -------------------------------
…tonehearth/call_handlers/population_call_handler.lua:7: attempt to index field ‘population’ (a nil value)
stack traceback:
[C]: ?
…tonehearth/call_handlers/population_call_handler.lua:7: in function <…tonehearth/call_handlers/population_call_handler.lua:6>
– Lua Error End -------------------------------
generating traceback…

– Script Error (lua) Begin -------------------------------
…hearth/call_handlers/bulletin_board_call_handler.lua:7: variable ‘player_id’ is not declared
stack traceback:
[C]: ?
[C]: in function ‘error’
radiant/lib/strict.lua:31: in function <radiant/lib/strict.lua:29>
…hearth/call_handlers/bulletin_board_call_handler.lua:7: in function <…hearth/call_handlers/bulletin_board_call_handler.lua:4>
– Lua Error End -------------------------------

So far I understand it, the game searchs for different variables, but is not able to find them. But which files are opened by the functions?
I also tested if it is a compatibility problem with another mod, but it isn´t.
I hope someone can give me maybe a hint what is wrong or where I have to search for mistakes in my script.

Thank you for your answers :slight_smile:

Ps.: Sry if this is the wrong thread for this topic and it belongs instead in the Bug-Report category. I thought, since it´s a mod-related problem, it belongs here.

It sounds like you might have an “iconic_form” path that is invalid in one of your entity json files. Under the “stonehearth:entity_forms” component, there is an “iconic_form” that should be something like “file(blah_iconic.json)”. If that file doesn’t exist in the folder the entity json is in, it could cause an error like this

translation into human: you are pointing at a place that does not exist.
traslation for the translation: you probably made a typo or a “whoops” mistake somewhere. think too many, too little, comma’s, " 's etc. or just plain forgetting to change something :stuck_out_tongue: i make these ALL_THE_TIME.

Linda was exactly right Witz her answer. I forgot to change a line in a iconic.json-file. Now everything works and I can test it.
So I see forward to share it with the community in the near future.

Thank you both alot for your answers :slight_smile:

So I reached the point where the main json-files are in place and the mod should be able to run in game. But due to some errors it still crashes in the moment, when I place the embarkation-banner in the world and the complete game closes. I spent the last days polishing and comparing my files with Dani´s Glasswork mod, that I used as blueprint, but I´m still not able to figure out what went wrong.
So, because I wasn´t sure how to upload a file here in discourse, I instead uploaded the mod now at steam as “Baker Mod”, hoping that someone may have the time and patience to read through it and give me a hint what could be wrong with it.

Thank you for your efforts with me^^

Curious; do you have any other mods installed and running?

Because I subscribed to your Baker mod on Steam, turned it on, and started up a game just fine. Even have the banner down.

Outpost established.

Baker… shovel? I won’t lie, that made me grin.

image

Moment of truth, and…


You’re missing an alias, it seems;

release-893 (x64)[M]
std::exception: ‘‘baker_mod’ has no alias named ‘baker:baker_shovel’ in the manifest.’

stack traceback: [C]: ? [C]: in function ‘create_entity’ radiant/modules/entities.lua:40: in function ‘create_entity’ stonehearth/components/job/job_component.lua:820: in function ‘_equip_equipment’ stonehearth/components/job/job_component.lua:309: in function ‘promote_to’ …arth/ai/actions/change_job_using_talisman_action.lua:24: in function ‘_trigger_cb’ radiant/modules/effects/effect_tracks.lua:113: in function <radiant/modules/effects/effect_tracks.lua:108> [C]: in function ‘fire’ radiant/controllers/time_tracker_controller.lua:91: in function <radiant/controllers/time_tracker_controller.lua:91> [C]: in function ‘xpcall’ radiant/modules/commons.lua:67: in function ‘xpcall’ radiant/controllers/time_tracker_controller.lua:91: in function ‘set_now’ radiant/modules/gamestate.lua:11: in function ‘set_now’ radiant/server.lua:65: in function <radiant/server.lua:63>

-edit-

Glancing at your manifest;

vs the baker itself;

Little naming inconsistency issue :wink:

-edit2-

…it’s not alone;

… +7 more. I’m gonna dig through the files a bit, see what I can do to help fix these up!

Okay… lot more cleanup work than expected.
Many instances where the recipe said “entities” and the alias did not x_x

So, fixes I’ve applied so far:

  • baker_mod:baker:baker_shovel → baker_mod:baker:shovel
  • added _recipe to 10 recipes that were missing it
  • removed " entities: " everywhere I found it (lost track, there were quite a few)
  • fixed baker_mill recipe to produce the correct item (was originally producing the cook’s mill)
  • fixed baker_oven recipe to produce the correct item (was originally producing the cook’s oven)
  • fixed the advanced_dough calling for “stonehearth:food:flour:flour”
  • fixed potato_bread recipe calling for “stonehearth:entities:food:sweet_potato” to “food:sweet_potato:sweet_potato_basket”
  • fixed baker_workbench recipe to produce the correct item (was originally producing the cook’s workbench)

…one error remains that I’m not familiar with:

release-893 (x64)[M]
Uncaught TypeError: Cannot read property ‘workshop_equivalents’ of undefined
TypeError: Cannot read property ‘workshop_equivalents’ of undefined
at http://radiant/stonehearth/ui/game/show_workshop/show_team_workshop.js:373:60
at n. (http://radiant/radiant/js/radiant/object.js:357:19)
at Function.each (http://radiant/radiant/js/external/jquery-2.1.4.min.js:2:2936)
at Object.radiant.each (http://radiant/radiant/js/radiant/object.js:355:15)
at http://radiant/stonehearth/ui/game/show_workshop/show_team_workshop.js:354:18
at n. (http://radiant/radiant/js/radiant/object.js:357:19)
at Function.each (http://radiant/radiant/js/external/jquery-2.1.4.min.js:2:2936)
at Object.radiant.each (http://radiant/radiant/js/radiant/object.js:355:15)
at n._buildRecipeArray (http://radiant/stonehearth/ui/game/show_workshop/show_team_workshop.js:351:15)
at w (http://radiant/stonehearth/ui/root/js/libs/ember-1.8.1.min.js:5:23160)
at m (http://radiant/stonehearth/ui/root/js/libs/ember-1.8.1.min.js:4:21029)
at b (http://radiant/stonehearth/ui/root/js/libs/ember-1.8.1.min.js:5:13753)

I’m going to try a fresh game with all the fixes I made, see if that gets rid of it.

There is distinctly still an issue.
…which bugs me, because I know I caused this issue with one of my own mods at one point, but I utterly don’t remember how / how to fix it…

1445232700.rar (1.1 MB)

Workshop equivalents is something you mix into an existing workshop to tell it yours can be used as an alternative to it, it’s hoe I do my custom workbenches for my nordlings, is there something in his manifest mixing into Ann existing workbench?

Think I found it. More naming inconsistency;

Recipe:

Manifest:

Shame I didn’t see that my first pass through the recipes. Welp! Time to go through them again!

Four recipes fixed to use the right workshop;

  • Pastry dough
  • Advanced dough
  • Sweet dough
  • Wooden Baker Sign (missed that one at first)

…but still getting the error, so it has to be something else.
And I’m not seeing it.

:’) this is starting to be one confusing jigsaw puzzle

Hey you both :slight_smile:
Thanks a lot for your replies and sry for the late answer, but I was lately travelling around a lot
and so there wasn´t too much spare time to check the forum.

First to the crash that I encountered: It is caused by an incompatiblity with the mod “Home Sweet Home”, which I never thought of before, because I didn´t expect it to touch files that would influence my mod.
But with every other mod I have subscribed to, it runs perfectly.

Next was that I ran in the same errors, that Kitty already pointed out. The last two weeks I used to make the changes that you also suggested in your post. It was much “learning by doing”, but also very satisfying ^^

For now it runs smoothly, without any errors (or at least I didn´t encounter any new errors while testing it) and now the next step is to polish it a bit more and to think about the advanced features like new stockpile categories.

It´s great how helpful you and the community as a whole are, so I have to say it again: Thank you :blush:

Ah, wonderful; so the UI bug on my end, is probably something I typoed while making my fixes (I am prone to doing that).

I was anticipating the “learning by doing”, since that’s been a good method for me as well, hence I posted the fixes I was making rather than just the corrected files :slight_smile:

I look forward to the finished mod! I love the concept; would be very happy to help contribute more ideas and models if you’d like them in the future.

Cant wait to use this mod!!