Questions about mods adding classes

I’m considering doing a ‘worker expansion’ mod which basically adds 3 classes to the game.e

The Builder, the Forester, and the Miner.

The reason I am mostly considering this is because I usually end up delegating the worker role to whoever has the lowest states(triple 1’s and such). And that generally results in all my workers being relatively slow.

The reason I’d like to add these specific classes is to have ‘super workers’ that are less all-rounder’s and more 1 specific niche. They’d each have their own attire(mining helmet on miners for example).

  • The Miner would have increased movement speed and diligence(to work longer hours) and would possibly mine larger chunks out(2x2x1).
  • The Forester would have similar stat buffs but would also replant trees(perhaps in designated zones similar to Shepard/Farmer/Trapper).
  • The Builder would just have much faster speed to help build faster.

I have only played with mods back in early spring so I’m not exactly sure how long it’d take to add entirely custom classes. Also not sure if things like adding a zone component for the Forester or modifying how mining works for the miner would work.

New classes aren’t hard to do, but they are pretty tedious. I think a great start for what you want to do is to get the 3 of them working properly into the promotion tree where you don’t have any issues with the clothing, tallisman, etc.
Step 2 would be limiting what each class can do, and maybe overriding existing classes. I dug through all the ai packs that determine what abilities each class has (at least the ones that existed at the time, I don’t know if there are any new ones since) and documented it [Collective Knowledge] Class Abilities (Jobs).

You can also read through Scholar Mod 1.1.2.1 - Revived! (Semi-transparent features fixed) where I was helping @fantasyworm to see just how tedious it can get, and all the small little details that are easy to miss when creating a new class. I’m sure he/she will be probably also be able to chime in and help out when/if you start running into walls. Just remember, the error log is your best friend.

my earlier post suggesting that we abolish canned classes altogether.

The whole idea is: building, foresting, mining are just jobs. Why can’t we allow hearthlings to take on any combination of them (ideally with priority from NO to HIGH).

The tasks that a job is involved, is a separate thing. i.e. a job can require many kinds of tasks/actions.

Each task/action, how well a hearthling does them, depends on his attributes/skills. (and doing those task/actions will in a way train those attribute/skills, at a rate specified by the task.)

Any “abilities” should be (task, attribute/skill) specific.
E.g. A hearthling has super high construction skill. When he is building scaffolding, an ability that allows him to do it 2x as fast because his skill exceeds a threshold kicks in. That ability though is only for building scaffolding. however, the same skill (construction) can have a different ability for other tasks (e.g. carry 1.5 x more materials when constructing buildings).

What all the above implies is that “class” will become nothing but a template set of priorities for the jobs. (e.g. builder class template will have high priority for building jobs, maybe medium for hauling, and no priority for other crafts). Which, can be customized by the player.

e.g. want your builder to go fishing when he is idling? set “fishing” job from NO to LOW.
Want a super master crafter “class” that do all carpentry, masonry, metalsmithing? yes you can!

So how do people introduce “new” classes? well, they don’t, directly. They will introduce new jobs/tasks/skills instead. Then produce a “template” class that specifies prefixed priorities over them.

I hope to see the end of “canned classes” someday. :wink:

If you look through the post I linked earlier, you can defiantly mixinto all the ones each class is missing, and allow everyone to do everything. At one point I stated poking around to see how hard it would be to create a “One Man Show” mod, where you only had one hearthling that had the ability to do everything.
It might be possible to dynamically enable and disable the ai packs and task groups (located in the class description file) for each class, you would have to figure out where they load to in the game and create a ui to toggle. Or better yet, look into how the the ones you can enable/disable already and build on to it.

I would look at how the promotion perks are triggered onto a hearthling using buffs. Example from trapper:

  "1": {
     "perks": [
        {
           "type": "apply_buff",
           "name": "i18n(stonehearth:jobs.trapper.trapper_description.level_1_data.perk_000_name)",
           "id": "trapper_speed_up_1",
           "icon": "file(images/speed_up.png)",
           "buff_name": "stonehearth:buffs:trapper:speed_1",
           "description": "i18n(stonehearth:jobs.trapper.trapper_description.level_1_data.perk_000_description)",
           "level": 1,
           "demote_fn": "remove_buff"
        }
     ]
  },

I would say from all the code I’ve sifted through in the past, it is possible to accomplish what you are looking to do by re-purposing and/or copying and modifying mechanics that currently exist in the game. Sure it’s a larger task than just adding in new furniture, but I don’t think it would end up being a monster either.

I am not disputing that it can be done currently.

the difference is: you could make it work for a specific case, like combining 3 classes into one.
But if a new class comes out? will have to create another mod that does that.

With a skill/job based system, all that is not necessary. To create a “class”, player just have to assign priority to job types that a hearthling will do, possibly saving and reusing this template which can be applied to other hearthlings to create another one of same “class”.

No modding necessary to create custom classes. That is what I hope to see :wink: