Adding Buffs to clothing

I searched over and over in the original files but i can’t figure out how some models add Buffs to the Hearthlings. Like the Worker Outfit 2.

This Outfit adds the “devoted”-buff to the Hearthling. But where is this defined?. How it can be reproduced?

And is it possible to combine clothings also with perks? Like the “increase_backpack_size” of the trapper? This one is linked to the trapper with level upgrade

   "type": "increase_backpack_size",
   "name": "i18n(stonehearth:jobs.trapper.trapper_description.level_4_data.perk_000_name)",
   "id": "trapper_backpack_bonus_1",
   "icon": "file(images/backpack_up.png)",
   "backpack_size_increase": "2",
   "level": 4,
   "description": "i18n(stonehearth:jobs.trapper.trapper_description.level_4_data.perk_000_description)",
   "demote_fn": "decrease_backpack_size"

If this is possible how? :smiley: wanted to add some models with additive perks, buffs and so on…

It is attached in the worker outfit 2 json file inside stonehearth\jobs\worker\mixins
Buffs are stored in the stonehearth/data/buffs folder.

I think for the trapper perks, that specific upgrade is defined as a function in the trapper.lua controller, so not sure :thinking:

I don’t know much about the trait system yet, but I’d also suggest looking into the Pack Mule trait.

stonehearth/data/traits/pack_mule :slight_smile:

1 Like

Ahh i see! Merci! :smiley: I found already the buffs but not the code that connected the buff to the model.

It’s there a possibility to increase the backpack-size also with buffers? This will solve the problem with the perks. If it’s possible i don’t need to create a perk for this function :wink:

oh really? :open_mouth: seems the right code to make it also work with buffs. Butt i’m not sure if this code also works as a buff or just in this way :confused:

It might work. There’s a buff that uses a controller (shepherding_buff.lua). You could try to create your own buff, then copying the pack_mule code into the controller for your buff. :thinking:

Well, not sure that it’d work but it’s worth the try.