Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Hunger Script

I know I placed this in another forum already, but it was the wrong forum. Forgive me!
I just wanted to ask if there was a script for a hunger system out there. (The character's hunger stat slowly drops as the game goes on, and using food items restores it.) I'll gladly give credit for the script. Thanks in advance!
 
This can be done with variables and common events:

A parallel process event is giving hunger + 1 every 50 frames.
at the end of the parallel process event put a condition:

if hunger is 200 or more will say: "Died of hunger" Game over
else, if hunger is 160 or more will say: "Im starving!!!"
else, if hunger is 120 or more will say: "Im Hungry..."

When use food, call common event that reduces hunger by 30-40-50 depends how stuffing it is
after using food, if hunger is less than zero, set hunger to 0 and say: "Im stuffed"

if you don't know how to do it I send a demo...
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top