Jump to content

Crafting Mod Trigger


Recommended Posts

I am looking for a line of code that will effect my custom character whenever he crafts something. I know the way this works right now in the game is that each separate item has a line of code that will effect your character depending on what he or she is crafting, but I wanted to know if there was a code to add this effect on everything. For an example, whenever my character crafts an item I want them to lose a bit of sanity. 

Link to comment
Share on other sites

In the builder component there are a number of events pushed, one in particular consume ingredients is only used for crafting.

Spoiler

    inst:ListenForEvent("consumeingredients", function(inst) --put into your onload function or postinit in the character.lua
        inst.components.sanity:DoDelta(TUNING.SANITY_MED)--change to w.e. you want it to be
    end)

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...