BigCSniper Posted April 7, 2017 Share Posted April 7, 2017 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 https://forums.kleientertainment.com/forums/topic/77404-crafting-mod-trigger/ Share on other sites More sharing options...
Lumina Posted April 8, 2017 Share Posted April 8, 2017 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 ? Link to comment https://forums.kleientertainment.com/forums/topic/77404-crafting-mod-trigger/#findComment-899641 Share on other sites More sharing options...
IronHunter Posted April 8, 2017 Share Posted April 8, 2017 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 https://forums.kleientertainment.com/forums/topic/77404-crafting-mod-trigger/#findComment-899692 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now