Advice for a Time-Based State System? (MV)

Howdy folks,

I'm trying to make a very light Thirst and Hunger system in my game. The idea is basically:
Every minute or so, use a random variable (for ease of explanation, 1 or 2).
If 1: Nothing happens.
If 2: Give character the "Hungry" state.

I've got the system down simply enough with a Common Event, but is there a way to make this a global function as opposed to putting a Parallel event on every single Map?

Many thanks and have a great day!
You could make it a common event (Database > Common Events). 🙂

Note that since Parallel events reset on map change, I would recommend having at least two common events:
  1. "Time" - trigger Parallel - handles the timing (can use for multiple checks if need be)
    Spoiler: Event example
    Code:
    ◆Comment:Advance counter variable
    ◆Control Variables:#0001 HungerTime += 1
    ◆Comment:Check if it's been a long enough time (+2 per second means 120 = 1 minute)
    ◆If:HungerTime ≥ 120
      ◆Comment:If so, do the hunger check!
      ◆Common Event:Update Hunger
      ◆Comment:Then reset the timer~
      ◆Control Variables:#0001 HungerTime = 0
      ◆
    :End
    ◆Comment:Run once per 30 frames (i.e. twice per second)
    ◆Wait:30 frames

  2. "Update Hunger" - trigger None - handles the actual hunger effects
    Spoiler: Event example
    Code:
    ◆Control Variables:#0002 Random = Random 1..2
    ◆If:Random > 1
      ◆Text:None, Window, Bottom
      :    :You feel hungry.
      ◆Change State:Entire Party, + Hungry
      ◆
    :End
Feel free to change the numbers around, this is just as an example! Note that without a Wait command, Parallel events will typically run once per frame, which is often unnecessary...that's why it's there~ 😤
@caethyril Thanks!
I was hoping to avoid putting a common event on every map, but it's probably a must.
I like the way you've it set up; much nicer than mine was. Very nice help!! 🙂
@caethyril Thanks!
I was hoping to avoid putting a common event on every map, but it's probably a must.
I think maybe you've misunderstood what common events are: the approach I suggested requires no map events (other than the one to turn on the "Time" common event's switch). 😅

Anyway, you're welcome~ 😂
Oh, sorry! I meant to say Parallel event in that post. My bad! Even with almost 2,000 hours on Maker I'm still bad at the lingo haha.

Thank you again for your help! <3

EDIT: Oh, my god, I've only just now noticed that Common Events have triggers. All this time I'd thought you need to use an event to specifically call the common event every time.....

Original thread: https://forums.rpgmakerweb.com/threads/advice-for-a-time-based-state-system-mv.118395/