Hunger & Thirst etc

So I've basically set up a Hunger variable, the idea being 100 means you're full and 0 means you're starving. Food will increase it and actions or time depletes it. Thing is though could anyone please explain to me how to prevent the variable from rising above 100 or going below 0?
Also, if that's possible, how would I apply the variable number to a damage formula please?
I'm wanting it so the more hungry you are the less energy you have thus the damage being dished out will reduce cos you wont have as much power to swing the sword lol.
you could do this with scripts easily:
Code:
if ($gameVariables.value(id) > 100) {
  $gameVariables.setValue(id, 100)
}

if ($gameVariables.value(id) < 0) {
  $gameVariables.setValue(id, 0)
}

and the for the second part it's just as simple
v[id] in the damage formula returns the value of the variable with the said id
Thankyou! you are a superstar! 😀
I'm working on this exact thing for another forum member. I have plans to expand it well beyond simple stuff like Hunger, Thirst and Rest but that's what my alpha release is going to cover. Stay tuned. I'll link you to the Plugins in Development forums thread when I have it ready. I have a couple more things I need to get working on it before it ready to go.
Sounds awesome, look forward to seeing it when it's complete. Will help me out boat loads. 🙂
At the minute I'm thinking of using the regional events plugin to set a regional tile so it triggers a common event which reduces Hunger etc by one. I'll probably place the regional tile along certain areas like a grid so the drop rate isn't too fast.
Here is what I have thus far. Check it out and see if it's far enough along to be useful for you.

https://forums.rpgmakerweb.com/inde...st-rest-oxygen-sanity-and-more-to-come.92623/

Original thread: https://forums.rpgmakerweb.com/threads/hunger-thirst-etc.92616/