Hello!
I have been trying to create a hunger system for a project I'm working on. I wanted to make it so there would be a variable that kept track of how hungry you are - something simple like 0-10 = not hungry, 11-20=peckish, etc etc
I was trying to make it so that moving between areas on a map (say through a door) would a 1 point to this, kept track of by a single variable. At around say 50 points out of 100, the character would no longer be able to run. At 90 points out of 100, they would move at an incredibly slow pace. At 100 points, a cutscene would play automatically. Hunger could be "removed" by eating items that changed the variable.
However, I tried doing this with a series of common events + parallel procresses and it was.. it was a mess. If there was a story event on the map, it wouldn't always work. Sometimes it just straight up wouldn't work.
I figure the best way to do this is through a script, as then it would be constantly running throughout the game and would kick in instantly once the requirements were met.
Problem is I'm a novice scripter at best and I couldn't really get my head around how I would do it. Anyone feel like helping?
I figured it would be like this roughly:
>check variable on map load/change
>if under 50, do nothing
>if over 50 then disable running
>if over 90 then half move speed
>if = 100 then transfer to map ###
but part of me thinks thats way too simple and theres something I'm missing here. With it set up around a variable, I could have events and items change that variable and not have to worry about having a parallel process on every map slowing things down/not really working.
This has to be tackled before I can really get on with things beyond graphics so any help would be appreciated.