Main Menu
  • Welcome to The RPG Maker Resource Kit.

HP/MP Bar

Started by Kojinus, April 18, 2009, 07:41:06 PM

0 Members and 1 Guest are viewing this topic.

Kojinus

Hello, I'm just wondering if there is any way to get a floating HP and/or MP bar above my characters head while out of combat.

Sorry for the short post. x.x I really don't know how to fill up space with that question.

-Kojinus

&&&&&&&&&&&&&

#1
Make the Hp/Mp bars in some kind of paint program, then import them into the RPG maker pictures.
Now we go to common events, we'll be making two of them.

The first common event turns your character's Hp/Mp into variables. Lets name these variables HP and MP.

The second Common even will tell the game what picture to show, so tell it
                     IF MP = 1 THEN show picture 01
                     IF MP = 2 THEN show picture 02

This of course would have to be done with every number, so you would have to make 99 if your character has 99 hp... ._.
That's why, with this method it's best to only do every 10, with bars. So if your char has 99 hp... then they would have 9 bars of HP.

I'm sorry I wasn't very thorough. I have a headache and I fell sick... so I can't really think straight. If you have any questions just ask.
&&&&&&&&&&&&&&&&

modern algebra

Quote from: Kojinus on April 18, 2009, 07:41:06 PM
Hello, I'm just wondering if there is any way to get a floating HP and/or MP bar above my characters head while out of combat.

Sorry for the short post. x.x I really don't know how to fill up space with that question.

-Kojinus

Why would they need a HP bar when they're out of combat? Nothing can hurt them... It seems like clutter.

In any case, BoE is right. If you wanted to do a bar, rather than individual pictures, then I would do something more like this (say max MP is 15)


if MP < 8
  if MP < 4
    if MP < 2
      if MP == 0
        Show Empty MP Bar
      else
        Show MP Bar at 1/15 Zoom
      end
    else
      if MP == 2
        Show MP Bar at 2/15 Zoom
      else
        Show MP Bar at 3/15 Zoom
      end
    end
  else
    if MP < 6
      if MP == 4
        Show MP Bar at 4/15 Zoom
      else
        Show MP Bar at 5/15 Zoom
      end
    else
      if MP == 6
        Show MP Bar at 6/15 Zoom
      else
        Show MP Bar at 7/15 Zoom
      end
    end
  end
else
  if MP < 12
    if MP < 10
      if MP == 8
        Show MP Bar at 8/15 Zoom
      else
        Show MP Bar at 9/15 Zoom
      end
    else
      if MP == 10
        Show MP Bar at 10/15 Zoom
      else
        Show MP Bar at 11/15 Zoom
      end
    end
  else
    if MP < 14
      if MP == 12
        Show MP Bar at 12/15 Zoom
      else
        Show MP Bar at 13/15 Zoom
      end
    else
      if MP == 14
        Show MP Bar at 14/15 Zoom
      else
        Show MP Bar at 15/15 Zoom
      end
    end
  end

       
A method like that will reduce the number of conditionals the event runs (on average).

Kojinus

#3
Thank you very much, and yeah it it kind of pointless and clutter, but it's something I like seeing.
However, where do I put that code in? x.x Sorry if that's a stupid quesiton, but I can't find an event setup that has an option of "If MP" anything.
Sorry to be a hassle. :[

modern algebra

It's conditional branch. TO get MP just use a variable. You'll only want to run this event after there is a possiblity of it decreasing though, since otherwise it's a lot of useless overhead.

So:

Control Variable: [XXXX] = [Actor]'s MP
Conditional Branch: Variable [XXXX] < 8, etc...