Needs System

Hi there,

I'm working on a project right now where one of your party members will have certain needs with a residual drain on it. These include and aren't restricted to hunger, thirst etc. Calculating these needs will all be based on a variable; where for example consuming a food item will add one to the variable, then if the value drops below a certain amount, a message or some kind of alert will let the player know.

So my question is, what would be the best way in getting the residual drain running in the background? Effectively, after x amount of time, variable drops by 1. I feel like I could use common events constantly running in the background, which would probably work albeit a bit convoluted. Is there a more effective way/obvious way I'm missing?

Thanks.
I guess your first hurdle is how to make time tick. The most common way is when an actor moves, but from the way you make it sound, the time should be flowing even if an actor is standing still?
Hmm. Well, for the decreasing part, I think you would only really need one common event. You just have wait commands followed by the command telling the variable to decrease. Then you have a conditional branch checking if it's below a certain amount. As for the addition of the variable, for each food item in the database, I'm not entirely sure if there's an option to attach variables, but if not, just make it call another common event which makes the variable increase by one.
Thanks for your advise! I'm pretty sure you can make an item call a common event. I'll have to check though. Getting time to tick, I was thinking of simply implementing a timed day/night system in a similar fashion to HexMozart's suggestion; wait commands running in the background. So, I could do wait commands followed by a conditional that breaks a loop and if variable is below x, pops the message, then jumps to a label at the top of the event so the process repeats- would that be the most effective way? I feel like such a thing could be quite a draw on a lot of systems running the game (especially older ones) but I'll give it a go if that's the case!

Original thread: https://forums.rpgmakerweb.com/threads/needs-system.91831/