# Hud Help- Negative Variables?

#### Elissiaro

##### Veteran
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.

#### Rinobi

##### Veteran
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

##### Veteran
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!

### Latest Profile Posts

tfw, after your game being intensively played by many people, after 5 years, patch after patch released, suddenly an innocent person reported another bug.
"Never let a sense of morals/
Prevent me from doing what is right"
- Clutch
OMFG. I had typed \fiPhilosophia Hermetica\fi in a forum post and didn't notice it for AN HOUR.

(Anyone else ever catch themselves doing this?)
Stream will be live shortly with a guest stream! Feel free to drop by and listen to whatever weird stories we're telling~
fighting game fans might really enjoy my game battle wise, and I feel non fighting fans might learn some stuff. thanks row system. pokes, neutral, and zoning time...