Sign in to follow this  

Recommended Posts

BigCSniper    5

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. 

Share this post


Link to post
Share on other sites
Lumina    2153

I know that everytime you prototype an item (first time crafting) you gain some sanity. I don't know how it's managed.

 

Or maybe a "listen for event", if there is one for crafting ?

Share this post


Link to post
Share on other sites
IronHunter    582

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)

 

Share this post


Link to post
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
Sign in to follow this