HUD with Common Events Help

Ximsol182

Villager
Member
Joined
Jun 7, 2017
Messages
13
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
I’ve started working with HUDs, but I’m having trouble with the one I’ll be using for my project. The bars are supposed to represent Health & Invisibility. The question is, how I can make the pictures for the HUD move if the bars work with common events.

The Invisibility Bar works fine by now and it’s reduced when I press a certain button, but the problem is…..how can I make the player visible again after the bar depletes to 0?

Captura.JPG
(this is for the invisible mechanic)

Captura2.JPG
(And this is for the Invisivility Bar)

Meanwhile, the Health Bar….it’ supposed to work like this. The player’s visual range gets reduced and if they get hit 4 times, it’s Game Over. Originally I planned to use this method, but I don’t know how to adapt it into a Health Bar for a HUD. (Btw, I’m using Galv’s Visual Range Script, just in case.)

h1.JPG h2.JPG h3.JPG h4.JPG

Thanks for reading this, and I hope someone will know how to deal with this problem
 

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
219
First Language
English
Primarily Uses
RMVXA
You're using two different common events to handle visibility, and four for health... Consolidate.
Two common events is reasonable for what you're doing.

Use a variable for health, set it four, reduce it by one whenever the player receives damage.
Check the player's health using a conditional branch for each value.
Add an exception so that the value isn't being set constantly.
When it comes to parallel processes, be as efficient as possible.

As for invisibility, make it into one event.
Obviously there's no HUD included, but check out my example below.
invisible_01.PNG
 

Ximsol182

Villager
Member
Joined
Jun 7, 2017
Messages
13
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
The problem is how can I make the character turn back to normal after the Invisibility gauge reaches 0.
 

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
219
First Language
English
Primarily Uses
RMVXA
It's in the example. I used the player's MP as the invisibility gauge.
MP is stored in variable [0030:Inv], and Max MP is stored in variable [0031:Inv Max].
While holding down the Y button, if the player's MP is not greater than 0, Jump to Label: Cancel Invisibility.
 

Ximsol182

Villager
Member
Joined
Jun 7, 2017
Messages
13
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
It's in the example. I used the player's MP as the invisibility gauge.
MP is stored in variable [0030:Inv], and Max MP is stored in variable [0031:Inv Max].
While holding down the Y button, if the player's MP is not greater than 0, Jump to Label: Cancel Invisibility.
Yes, I noticed and now it works perfectly. I never thought about converting it into MP.

But what I do with the HP bar now? The player is supposed to slowly regenerate and if they're damaged, the vision gets darker (like an overlay)
 

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
219
First Language
English
Primarily Uses
RMVXA
You can use HP in a similar fashion.

For flexibility, I would set HP to 1000 (easier to work with) and have the player take 250 damage on average.
As for vision range, something like this:
invisible_02.PNG
Based on what you've shown me.
 
Last edited:

Ximsol182

Villager
Member
Joined
Jun 7, 2017
Messages
13
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
You can use HP in a similar fashion.

For flexibility, I would set HP to 1000 (easier to work with) and have the player take 250 damage on average.
As for vision range, something like this:
Based on what you've shown me.
Okay, it works perfectly now, but how can I make the character slowly regain health? I did this, but it doesn't work....

CapturaHP.JPG
 

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
219
First Language
English
Primarily Uses
RMVXA
It's not working because you're setting MaxHP to be equal to HP (player's current HP value).
Your event is missing a variable, Record HP, which keeps track of any changes to the player's Current HP (or HP in your event).
invisible_03.PNG
 
Last edited:

Ximsol182

Villager
Member
Joined
Jun 7, 2017
Messages
13
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
Yes, it's almost done! Also, last but not least.....how can I make the player not regain health if they're running?
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,661
Reaction score
563
First Language
English
Primarily Uses
RMVXA
Probably conditional branch -
if button :A is pressed down
nothing
else
character hp + 1
branch end
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

"You can thank my later", "But you haven't done anything", "Well, that's why ..."
Are we allowed to post about non-RPG Maker games?
I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

Forum statistics

Threads
105,884
Messages
1,017,242
Members
137,609
Latest member
shododdydoddy
Top