Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Heros HP percentage..

Author
Message
DracoFireDragon
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location:
Posted: 3rd Dec 2002 22:42
Im kinda embarrised about my math skills...maybe im not thinking hard enough...

what do I find my heros life percentage from my heros HP and MAX hp variables??? X_X

such as whats my heros life if hes got 1203 hp / 2035 max hp

also if you can give me any code, make you give me some that rounds down so there are no decimals in the %??

I dont think I could use his percentage to make a health bar that only fills up 86.5555 percentage of that way hehe
DracoFireDragon
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location:
Posted: 3rd Dec 2002 22:45
hmmm nevermind not thinking today...

HPpercentage=Hp/MAXhp*100

then how do I get it to round up or down...hmmm

DracoFireDragon
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location:
Posted: 3rd Dec 2002 22:52
hmmmm my HPpercentage just shows up as 0...strange my calculations work on a calculator...I would really apreciate some help X_X

DracoFireDragon
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location:
Posted: 3rd Dec 2002 23:16
does DP do some weird order of operations or something?

DracoFireDragon
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location:
Posted: 3rd Dec 2002 23:26
oops I forgot that a varible thats defined like this:
HEROhp=3000

Can't have decimals like a varible defined like this:

HEROhp#=3000

since were talking percentages you need the later X_X my bad.

Epidemicz
22
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 3rd Dec 2002 23:30
Heh, I was just about to tell you that. Don't feel discouraged because nobody helped you lol, they normally do. I just got home and read your thread, it should be noted that I was about to help ya out tho Even wrote the code lol. Well, good luck in your game, now maybe I should get back to mine . Later.



I am the very disease you pretend to be.

Login to post a reply

Server time is: 2024-11-23 17:50:23
Your offset time is: 2024-11-23 17:50:23