Hud Help- Negative Variables?

Elissiaro

aka MsLilly
Veteran
Joined
Feb 19, 2016
Messages
165
Reaction score
263
First Language
Swedish
Primarily Uses
RMMV
So I've been trying to make a working hud for a while now.

I have 2 moving images, (and some not moving images around to frame them but those aren't important) and I want them to move left off the screen.

Like this basically:


Is there anyway to get like, a negative number from the "set hp/mp as variable" command? (As in, Hp is 100 so the variable is -100.)
Or do i have to do this the hard way and just set 100 conditional branches that subtracts 1 from the X of the image position for each HP? Would that even be possible or would it break the game with lag?

The mc is only gonna have 100 Hp and 100 Mp but thats still 200 checks.

Is there a script to let me do this(or something like this) easier? I've been looking but haven't found one that doesnt have the game draw things for you, and thats just a little bit ugly.

I would appreciate any help you can give me.
 

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
219
First Language
English
Primarily Uses
RMVXA
I don't understand why this would require that many conditions under any circumstances. (You didn't post your event)
Try to multiply the variables by -1 after setting hp/mp, then use those negative values to update the bars.

HP: 100
27 damage.
HP: 73 = HP_Variable
HP_Variable *= -1
HP_Bar = HP_Variable
HP_Variable = HP

(something like that)
 

Elissiaro

aka MsLilly
Veteran
Joined
Feb 19, 2016
Messages
165
Reaction score
263
First Language
Swedish
Primarily Uses
RMMV
I don't understand why this would require that many conditions under any circumstances. (You didn't post your event)
Try to multiply the variables by -1 after setting hp/mp, then use those negative values to update the bars.
(something like that)
Sorry i don't really get the explanation...
Did you mean like this?

Cause if you did... It didn't work... Um. It just made the bars empty when I had no damage and full when I had 0 hp and mp.

Maybe it was my terrible explanation of what I needed. Or maybe I'm just not getting the answer.

How do explain it better. So I have the HP variable. The HUD bar is ath the correct position for full hp when the image is at 0 on the X axel. And When it's at no HP it should be at -100 on the X axel.
So 100 Hp should be 0 X and 0 Hp should be -100 X.



So I tried it some more after writing this but before posting, and I figured it out!
I needed to do complicated math stuff.... Well ,complicated for me.

The event ended up looking like this now that it works (maybe that's what you meant all along):


Thank you for the help! :D
 

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