Outfit is indeed very modern, ha ha. I think I’ll join the “sand” and “stone”, although they are temporarily useless, “sand” may be used to synthesize the “glass”.
Edit : @law please ignore this, while it’s a good tutorial for adding other classes that don’t exist, it is not needed for your miner . It came down to another mod that was causing the errors, sorry for any confusion
I was unable to promote a worker to the miner during my testing, this I believe this has to do with the fact you haven’t made your miner entity visible to the game, and haven’t mixedinto the jobs index.
You’ve aliased out the miners equipment and such but not the miner himself, you will need to add an alias to your manifest.json
"aliases" : {
"jobs:miner" : "file(jobs/miner"),
Then in /miner/jobs/miner/miner_description.json change
"alias": "stonehearth:jobs:miner",
to
"alias": "miner:jobs:miner",
Next take a look at /stonehearth/jobs/index.json, it’s a listing of all professions in the game, you need to mixin your miners alias into that list. I am guessing I don’t need to explain this as you’ve done the carpenter recipe mixins and such
Finally comes the tricky part to all of this, the promotion screen. As of now the promotion screen has hard coded positions for all the icons you use to promote citizens to professions. Your profession doesn’t exist in the list so it will error when trying to find the position for your miner icon. You have a few options here.
override /stonehearth/ui/game/promotion_tree/promotion_tree.js, and edit
Play around with x,y values to get it into the right position.
While doing things this way might be easy, it will lead to compatibility problems with other mods that are adding classes.
Use Jelly. Jelly does the base game modfications to allow for multiple mods to add professions to the game.Download here. you’ll have to rename the download to just, jelly. It’s a SH mod so put it in your mods folder. You will also have to extract it out of the .zip, SH will not load .zip.
If you choose to go this route, you will need to add a .js file to your mod. Add this to that file…
Jelly creates an event 'jelly.PromotionTreeLayout. The idea here is listen in on the event, then modify _layout to include a definition for your profession.
Last step here would be to reference the .js in your manifest.
So this got me thinking… it should work then… why doesn’t it work for me. Turned out I had another mod that was causing all the trouble.
So just to be clear @law your mod seems to work just fine as it is. In the future before I test out someone else’s mod I’ll remove other mods in my mods folder.
@honestabelink look here!As you said, I mean, modified, but wrong, I do not know where the mistake, can you help me?(“qb”change“zip”)miner.qb (127.7 KB)
There has been a few changes to StoneHearth… and there were a few errors in your mod.
In particular the errors in your mod, you removed stonehearth:jobs:miner from the promotion tree, while adding yours to the .js would make yours show up, the game was still looking for the normal miner, not finding it the game errored.
There has also been some recent changes to StoneHearth’s job_component. Which changes the way (job)_description.json’s are written.
Basically we used to declare job abilities under the equipment key… they are now declared in there own.
This was also true with your override to worker_description.json.
I had to do testing anyway to make sure it worked… here’s my files. Continue to work off them or use them as a reference
Main differences in my mod to yours
I followed @flpsantoss advice and just overroad the default miner. (this avoids the promotion_tree nonsense , this was also what you were initially doing, sorry for any confusion)
I removed the copies of the workers models and such, instead just referenced them from the mod.