Hi Guys
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
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 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.
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.
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>
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…
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?
Hey you both
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
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
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.