Download

SGK Food Spoilage?

Hey, community, I’ve been working with the Survival Games Kit, by Defuse Studios, for a couple of months now, and have thus far been able to work out most of the features that I would like to add on my own. I’m wondering if anyone has figured out how to make food items continually lose points from their condition, like a spoil timer in Ark or other survival games.
I saw that this question was asked on the product page, but it wasn’t really answered - the developer gave information about an item’s fuel timer instead. I’ve tried to decipher the way the inventory is set up, on my own, and added variables to the item structure for spoil rate, and a “CanSpoil” bool, but I can’t figure out where I need to call these, or where to attempt to attach them.
If anybody has figured out how to implement this kind of feature, I would appreciate a little help.
If anybody has also figured out how to make specific items become other items after spoiling, that would be helpful too.
I know other kits have managed to do this, but I’ve spent too much time making my project around the Survival Games Kit to change now.

This might not be useful as I don’t use the Survival Game Kit. However, in my own project I have a system where things can spoil/lose condition over time. I have a day/night system also.
So basically what I do, is once an item has been picked up for the first time, I add a timestamp to the item. Whenever I open my inventory where I can see that item, I get the current timestamp, compare it with the one saved when the item was picked up and with the difference, remove a certain amount of condition depending on the difference. I then update the old timestamp on the item with the new one so it’s always only checking against the last time that item was viewed. Then if the condition is 0, i mark it as spoiled and that’s it.

Mind you, I don’t have a timer or anything running on tick, so the condition of the item only gets updated whenever the player might be viewing it as in opening the inventory. This suits my project but may not suit yours.

Anyway, that’s just how mine works and maybe might spark some idea you may have to get yours working.

Unfortunately, I don’t think that’s going to work with my project. It sounds like an interesting system though.
Edit: what I am having trouble with is making it work for every spoilable item in the inventory. I can’t seem to find a good place in the built-in inventory system to attach the variables for condition, spoil rate, etc as the inventory is spread across a few different actors and components within the kit.