Announcement

Collapse
No announcement yet.

Hit Point Percentage

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Hit Point Percentage

    I need help on how to make a % value from the current Hp of a party member.

    I know how to use variables to a certain extent.

    If anyone who is good at math, calculations, or formulas, please help or add.

    Thanks in advance.

    #2
    Re: Hit Point Percentage

    Well the best way to get decimals in the game it to mutiply a number by a power of 10 for the number of decimals you want. In your case since you want percentage you want to get 2 decimal places, so multiply Hp by 100 then divide (HP * 100) / Max HP. So in RPG Maker 2 terms

    Data: Variable [HP*100] = [Hit Points] * 100
    Data: Variable [HP-Percentage] = [HP*100] / [Max Hit Points]

    You have to multiply first because RPG Maker does not keep fractional parts so if you divided first and then multiplied the answer by 100 you would still get 0. This should work, though I haven't tested it I'm pretty sure it will.
    はじめまして。真(しん)の冷静(れいせい)です。どうぞよろしく。
    http://www.thetruecoolness.com/

    5198-2124-7210 Smash

    Comment


      #3
      Re: Hit Point Percentage

      Thanks, I'll try it out.

      EDIT: Works like a charm! Thank you very much!
      Last edited by AbstractOrigin; 07-06-2005, 03:01 AM.

      Comment


        #4
        Re: Hit Point Percentage

        Oh snap. I tried this for the first time in my life and it works. You guys sure know what you're doing.

        Comment

        Working...
        X