question that, for once, i suspect is reletative answerable:
how would i go about giving workers a crafting “button” on the crafting UI?
(and make workers be able to craft stuff)
(so i can add recipes to them as per usual with new recipes)
Crafter jobs inherit from crafting_job.lua, so you would need to substitute the existing worker.lua from the jobs folder to make use of it.
Probably a mixinto to the worker_description.json changing the “controller” to point to your custom Lua file, that will mixin from crafting_job.lua (remember to precede the value for the ‘require’ by ‘stonehearth.’, otherwise it won’t find it), plus adding any missing json to the worker_description.json that other crafter jobs have, like the recipe index, etc.
so in rough wording “add all the stuff other crafters have, in their propper locations” and the button then appears auto-magically on the UI?
Err, maybe you also need to add a mixinto for start_menu.json, it has a list of the crafters under one of the keys.
as soon as i have some time ill experiment a bit, ill let you know how far i get
i cant actually find a start_menu.json? i did find one .js (javascript?)
It’s in stonehearth/data/ui/start_menu.json
.
…puts another stamp on the max saves the day card i may have to make a statue to you or something ingame max or at least a flavor refference
release-868 (x64)[M]
radiant/lib/util.lua:698: bad argument #1 to 'pairs' (table expected, got nil)
stack traceback:
[C]: ?
[C]: in function 'pairs'
radiant/lib/util.lua:698: in function 'deep_copy'
...nehearth/services/server/job/job_info_controller.lua:261: in function '_build_craftable_recipe_list'
...nehearth/services/server/job/job_info_controller.lua:106: in function 'activate'
radiant/modules/commons.lua:309: in function 'create_controller'
...earth/services/server/job/player_jobs_controller.lua:55: in function '_ensure_job_id'
...earth/services/server/job/player_jobs_controller.lua:84: in function 'get_job'
stonehearth/services/server/job/job_service.lua:75: in function 'get_job_info'
stonehearth/components/job/job_component.lua:157: in function 'get_job_info'
stonehearth/components/job/job_component.lua:779: in function '_update_job_work_order'
stonehearth/components/job/job_component.lua:338: in function 'promote_to'
...th/services/server/population/population_faction.lua:557: in function 'generate_starting_citizen'
...th/services/server/population/population_faction.lua:642: in function 'generate_roster'
...vices/server/game_creation/game_creation_service.lua:353: in function '_generate_initial_roster'
...vices/server/game_creation/game_creation_service.lua:253: in function <...vices/server/game_creation/game_creation_service.lua:244>
is what im getting currently.
-i added a task ground for crafting into my worker
i pointed my worker at a modified controller that should add the stuff neede for crafting worker.lua (731 Bytes)
and i hot loaded
“stonehearth/data/ui/start_menu.json” : “nordlingmod/data/ui/start_menu.json”
in via the ui manifest trick thing… any idea why im getting the error?
(its on my github ofc) https://github.com/Thahat/nordlingmod
wait so its not me fucking something up XD? /yaay!/
It’s the same error message, but the stack is different, so it’s a different error. In this case your job needs a recipe_list
pointing to a recipes JSON file.
Oops, it turns out that you: D
well thats odd, it has one.
"crafter": {
"work_effect": "smith",
"recipe_list": "/nordlingmod/jobs/worker/recipes/recipes.json"
}
because i had anticipated it would need one ( the file is empty except for {} though because i havent given it any recipes yet. though that should not be an issue as far as i know…
It is an issue. It needs to have an empty craftable_recipes
.
Derp, that IS my bad, I should have known! (because I had thst like three times before now I think about it - facepalm-
{
"craftable_recipes": {}
}
added this into the recipes file. now the entire game crashes on startup.
stonehearth.log (3.6 KB)
so its seems there are more problems.
more anoyingly: even AFTER removing all the stuff i added, it keeps crashing
i dont even know what happens now XD
want to try to find the problematic file (also see what you’re doing xD)
well the latest versions (with all the stuff still in)
is here
so you can just download that and try it as a mod. even MORE anoyingly, if i in the user settings turn my mod off it STILL ctrashes on startup
now just de installing and re installing stonehearht…