[RMMV] If HP/MP = 0 statement

A friend and I are making a game that includes a Points system that can be used to interact with the game throughout a day.
For example, you can only have 10 and will deplete with each use.

But now we're stuck, we can't seem to a switch turn on even with '$gameActors.actor(x).hp <= y' through Common Events > Conditional Branch and now we can't move forward. Are we missing something?
Can you show us a screenshot of the event you've made? It's hard to say what you've done wrong without seeing what you've done.
and usually such things are handled without scripts - you have direct access to the numbers through control variable game data after all.
so it has to be something in your logic steps that makes your events go wrong.
Double agree. From your description, there's no reason to be using any scripting instead of the included event commands, so please show what you actually have and describe exactly how the event is being called and what it should do.
Oh, I apologize for the vagueness of the post.

What we tried to do is:
The HP of our character will dictate how many points they'll use, so we set it up to 10.
Now the script we used basically dictates: if HP of character is equals to y, then they'll get a warning.

Hence: The switch event is just a demo though to see if it works.

1705801140850.png


Can't attach any videos 🙁 But to simply put it:

If health is 1/10 then the script will trigger the switch and the switch will make the fairy appear.
If health is 1/10 then the script will trigger the switch
no, it won't - it will do nothing because the common event itself will never start.

You need to tell us where and how you call that common event, because without a call common event that will never be triggered.
no, it won't - it will do nothing because the common event itself will never start.

You need to tell us where and how you call that common event, because without a call common event that will never be triggered.
I see, I had a hunch that common events would mean it would run almost like that - where it doesn't need to be called.

Well, with that out of the way, would there be alternatives to what we're doing? Like some sort of a script or different system itself?
Initially when I ran into this problem, I thought I would just do levels separately and have variables counted in them and when they get into 0/10 it would trigger a warning.
I see, I had a hunch that common events would mean it would run almost like that - where it doesn't need to be called.

Well, with that out of the way, would there be alternatives to what we're doing? Like some sort of a script or different system itself?
Initially when I ran into this problem, I thought I would just do levels separately and have variables counted in them and when they get into 0/10 it would trigger a warning.
Without plugins, you can add the common event to every battle troop where this health warning can show up.
1705878239105.png

With plugins, you can probably search for a plugin that automatically adds common events to all battles so we don't have to copypaste redundant data.

If you're a programmer, you can alias the Game_Actor.prototype.gainHP function to call the common event every time a player character's HP is set to 1 during battle
If you are in battle, you don't need any script - troop events have the condition HP= whatever automatically in default (where in the example above the turn number is)
No battles either though! I just used HPs as an indicator for how many turns you'll have for the 'day'.

To put it simply: we just want an energy-based system where you can only interact with certain things for x times. (which is 10 for us)
You may want to nip back and revisit some tutorials/the instructions, especially those focused on events. They're the primary way you achieve things in RPG Maker, so it's important to understand the different kinds and how they work. There shouldn't be any hunches involved 😉

Just a Common Event like you show above doesn't do anything unless it's called with a command or from an item/skill.

But if you change the Trigger to Parallel, that means it runs continuously for as long as the triggering switch is on, which sounds like exactly what you want.

Make sure to put a Wait command at the bottom of some amount, so that it's not needlessly running every single frame.
You could have CT_Bolt's Objects Ex run a script every time the HP is changed. if ==1, turn on fairy appears switch ($gameSwitches.setValue(4, true))

Original thread: https://forums.rpgmakerweb.com/threads/rmmv-if-hp-mp-0-statement.164895/