HUD Trouble Help

Status
Not open for further replies.

Ximsol182

Villager
Member
Joined
Jun 7, 2017
Messages
13
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
I'm making a HUD based on the player's decisions. It the player fails after 5 wrong decisions, it's a game over. Unfortunately, even though the HUD activates after I called the common event, when I do the wrong decisions, the HUD doesn't dicrease. What's happening?
 

Attachments

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
You call it once, when you have 50 hp, but not when your hp decreases.
 

Ximsol182

Villager
Member
Joined
Jun 7, 2017
Messages
13
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
You call it once, when you have 50 hp, but not when your hp decreases.
What? But I just called it once at the start of the event. Problem is that it does decrease but the image stays the same (with the 5/5 hearts instead of decreasing)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,100
Reaction score
13,705
First Language
English
Primarily Uses
RMMV
Yes, you just called it (the common event to show HP) at the start of the event. You need to call it each time the variable is changed.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
Exactly, you called it once, at the beginning of the event. When you have 50 hp. But not when you have 40 hp. Or 30 hp. Call common event processes the event once, not continuously.
 

Ximsol182

Villager
Member
Joined
Jun 7, 2017
Messages
13
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
Yes, you just called it (the common event to show HP) at the start of the event. You need to call it each time the variable is changed.
So I did and the HUD decreases now. But for some reason it's acting strange. It decreases even after I make the right choice. What's going on?
 

Attachments

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,100
Reaction score
13,705
First Language
English
Primarily Uses
RMMV
You are calling the Show HP common event before you process the result. You should change the actor's HP and THEN call the common event to update the HUD based on the actor's HP.

You are using the same variable for 2 different things. In the choices, you are increasing/decreasing the variable, but only if it's within a specific range, and in the common event you are completely ignoring what was done there and setting the variable to an actor's HP. I don't really know why they're not keeping pace, because you're changing the actor's HP at the same time as changing the variable. But you don't need to do both. Either use a variable to keep track, or use the actor's HP. Not both.
 

Ximsol182

Villager
Member
Joined
Jun 7, 2017
Messages
13
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
You are calling the Show HP common event before you process the result. You should change the actor's HP and THEN call the common event to update the HUD based on the actor's HP.

You are using the same variable for 2 different things. In the choices, you are increasing/decreasing the variable, but only if it's within a specific range, and in the common event you are completely ignoring what was done there and setting the variable to an actor's HP. I don't really know why they're not keeping pace, because you're changing the actor's HP at the same time as changing the variable. But you don't need to do both. Either use a variable to keep track, or use the actor's HP. Not both.
Okay, I called the event after changing the HP and it works perfectly now.

I don't quite understand about what you're saying about the variables.....Can you explain it with a screenshot, if it isn't much asking?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,100
Reaction score
13,705
First Language
English
Primarily Uses
RMMV
In your choice event, you are changing the actor's HP and then changing the variable.
In your common event, you are setting the variable to the actor's HP.

What is the point of changing the variable when you change the actor's HP, if you are going to reset it in the common event anyway? Just change the actor's HP and don't make any changes to the variable. The common event will take care of setting it to the correct value.
 

Ximsol182

Villager
Member
Joined
Jun 7, 2017
Messages
13
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
In your choice event, you are changing the actor's HP and then changing the variable.
In your common event, you are setting the variable to the actor's HP.

What is the point of changing the variable when you change the actor's HP, if you are going to reset it in the common event anyway? Just change the actor's HP and don't make any changes to the variable. The common event will take care of setting it to the correct value.
Oh, that! I put it just in case the HP decreasing didn't work but I noticed that now that I activated the event, it works even when I'm not using the variables.

All is well then.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
So is this solved? If it is, please Report your opening post and ask for it to be closed.
Thanks.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,354
Reaction score
8,536
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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