How can I make a life counter in the corner of the screen?

It's a pretty simple question, I suppose. I'm working with an horror game where the main character is supposed to be depending on a mirror to live. I was thinking that when the mirror crashes in 7 pieces (1 per damage given), a Game Over screen would show up, just like Ib.

Does anyone know any coding or tips to do this? I need an answer soon, please!
How does the mirror crash/ break?

I am not fluent in ruby coding so I can't help with a HUD HP bar related to the mirror. But I can help with the logic.

At the start of the game, have an autorun event that sets a variable eg "MirrorPiece" with a value of 7 and also gives a key item "Mirror" (see below).

Have a key item "Mirror". To add a key item, go to your database and then the item tab. Add a new item and change its type to "key item". When used, set it to trigger a common event. MAKE SURE IT IS NOT A CONSUMABLE OR ONE USE ITEM.

In this common event insert a text command, in it put something like "Mirror Integrity: n" or "Mirror Pieces left: n" where n is the value currently stored on the variable set up at the start "MirrorPiece". (I'm not sure exactly how to add variable into text command since I don't have RPG Maker with me rn. What you can do is insert a text command and hover your mouse over the input box and see the list of calls.)

Now things get a little messy. I'm assuming the mirror breaks with a battle, but regardless, whenever the player encounters conflict and loses add a command "Control Variables" -> MirrorPiece - 1. So for example you have an event that starts a battle, set the "Battle Processing" to allow the player to continue even when loser and in the subcommand of the battle processing where you have the "win" branch and the "lose" branch, place the command "Control Variables" -> MirrorPiece - 1 in the lose branch. This means if the player lost a value is also lost from the Mirror. Right after this command you must also add a "Conditional Branch" that checks variable "MirrorPiece" = "0". If "MirrorPiece" = "0" is true then you must a "game over" command.

It should play out as so:

1. Player starts out with a key item "Mirror" with a variable attached with value 7. 

2. Player can use the key item "Mirror" to check how many pieces they have left. When used, a text box appears "Mirror Pieces n" where "n" is the value stored on the variable "MirrorPiece"

3. When the player loses a battle, a piece of the mirror is lost. (MirrorPiece variable minused by 1)

4. If all 7 pieces have been lost, it is game over. (MirrorPiece = 0 true)
How does the mirror crash/ break?

I am not fluent in ruby coding so I can't help with a HUD HP bar related to the mirror. But I can help with the logic.

At the start of the game, have an autorun event that sets a variable eg "MirrorPiece" with a value of 7 and also gives a key item "Mirror" (see below).

Have a key item "Mirror". To add a key item, go to your database and then the item tab. Add a new item and change its type to "key item". When used, set it to trigger a common event. MAKE SURE IT IS NOT A CONSUMABLE OR ONE USE ITEM.

In this common event insert a text command, in it put something like "Mirror Integrity: n" or "Mirror Pieces left: n" where n is the value currently stored on the variable set up at the start "MirrorPiece". (I'm not sure exactly how to add variable into text command since I don't have RPG Maker with me rn. What you can do is insert a text command and hover your mouse over the input box and see the list of calls.)

Now things get a little messy. I'm assuming the mirror breaks with a battle, but regardless, whenever the player encounters conflict and loses add a command "Control Variables" -> MirrorPiece - 1. So for example you have an event that starts a battle, set the "Battle Processing" to allow the player to continue even when loser and in the subcommand of the battle processing where you have the "win" branch and the "lose" branch, place the command "Control Variables" -> MirrorPiece - 1 in the lose branch. This means if the player lost a value is also lost from the Mirror. Right after this command you must also add a "Conditional Branch" that checks variable "MirrorPiece" = "0". If "MirrorPiece" = "0" is true then you must a "game over" command.

It should play out as so:

1. Player starts out with a key item "Mirror" with a variable attached with value 7. 

2. Player can use the key item "Mirror" to check how many pieces they have left. When used, a text box appears "Mirror Pieces n" where "n" is the value stored on the variable "MirrorPiece"

3. When the player loses a battle, a piece of the mirror is lost. (MirrorPiece variable minused by 1)

4. If all 7 pieces have been lost, it is game over. (MirrorPiece = 0 true)
Aah, I see! I guess I'll just find a script somewhere for the HP Bar, but this helped a whole lot!

Thank you very much! This is really helpful 😀

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-make-a-life-counter-in-the-corner-of-the-screen.48097/