Resting Requirments

I want to make certain rules (like a house rule in DnD) that says you can't camp (and recover HP and remove states) unless your HP has fallen below 50% that day. The character is going through a boot camp of sorts and I wanted to make sure he did enough combat before letting him rest.

Is there any way to have events check HP? How would I write that? Thanks in advance!
That is basic eventing, with control variable to load whatever game data you want and then conditional branch to check the value you got.
This is how I do it (This is spontaneous, so I'm not sure that this is going to be efficient):

Make 2 Variables:
  • PlayerHalfMaxHP
  • PlayerCurrentHP
Set the PlayerCurrentHP to Player's HP (at the moment).
Set the PlayerHalfMaxHP to Player's MaxHP.
Divide PlayerHalfMaxHP by 2.

(Conditional Branch)
If PlayerCurrentHP <= PlayerHalfMaxHP
Allow player to rest.​
Else
text: "You cannot rest now." or something...​
End

If this doesn't work, let me know.
Wow! Thank you both!! I'm checking it out now!! Love you guys and these forums!

Original thread: https://forums.rpgmakerweb.com/threads/resting-requirments.89341/