Jump to content

Recommended Posts

The title may be a bit confusing, but how would i add a reduce-spoilage effect on a certain characters inventory, e.g whenever they have food in their inventory, it reduces spoilage by X time, or however the icebox calculates it in the code, im pretty new to the character modding aspect of this, so some explanation would be nice.

Nothing? eh, maybe once snow-chester (if he) comes out there'll be some more info on this, oh well :/

inst:AddTag("fridge")
Replace inst with GetPlayer() if appropriate.

Coding snow chester would be a feat sung by bards throughout the land! :razz:

EDIT: To see how it's done, check the Update() function in components/perishable.lua. You'll see that perish rate multipliers are very much hardcoded, so getting an effect more flexible than that would likely require some serious overriding of the functions in perishable.lua.

Edited by simplex
inst:AddTag("fridge")
Replace inst with GetPlayer() if appropriate.

Coding snow chester would be a feat sung by bards throughout the land! :razz:

EDIT: To see how it's done, check the Update() function in components/perishable.lua. You'll see that perish rate multipliers are very much hardcoded, so getting an effect more flexible than that would likely require some serious overriding of the functions in perishable.lua.

 

Thanks! That was... to say a lot less complicated then i thought it would be, granted not very flexible, but it will surely work for the purpose needed :D

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
×
  • Create New...