Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Bmi (https://forums.graalonline.com/forums/showthread.php?t=74502)

Angel_Light 06-10-2007 03:53 AM

Bmi
 
I'm script some super secret funny script that I'll post later but I need for the player to calculate there BMI so I went to the "Massive Encyclopedia Online" Which Is Kinda Irritating because I can't say the name of the site do to the rule. Anyways the formula is weight/height^2 then multiply by 703, but when I do this I get some outlandish number which is definitely not BMI. Weight is in pounds and height is in inches

BMI = Body Mass Index, btw

Anyone know a real formula for BMI?

DustyPorViva 06-10-2007 03:58 AM

BMI = (weight*703)/height²

I can't post the reference site though, PM me if you'd like to know.

Angel_Light 06-10-2007 04:16 AM

Afraid this doesnt work, I used a BMI calculator site and input this

height 6'4" = 76in
weight = 238 lbs

professional calc got this for the BMI : 28.9671052632

i tried both methods found

Method 1 : (weight/height^2) * 703 BMI got : 41828.5

graal formula
PHP Code:

(this.weight/this.height^2) * 703

Method 2 : (weight *703)/height^2 BMI got : 13357

graal formula
PHP Code:

(this.weight*703)/this.height^2

what am I doing wrong :[

DustyPorViva 06-10-2007 04:23 AM

Dunno, but I just inputted into a calculator(regular, used the formula) and got 28.96710...
Try, (this.weight*703)/(this.height^2); ?

Angel_Light 06-10-2007 04:36 AM

nope

dont know if this will help any :/
PHP Code:

 this.weight Weight_Edit_Text.getText();
 
this.height Height_Edit_Text.getText();
 
this.BMI1 = (this.weight*703)/(this.height^2);
 
BMI_Text.setText("Your BMI is : " this.BMI1); 


DustyPorViva 06-10-2007 04:46 AM

No idea, I used the formula in a calculator myself and it worked.
Try defining the numbers in the variables yourself without the getText and such? And also, I didn't mention it, but the height must be in inches.

Angel_Light 06-10-2007 04:49 AM

yeah, I'm using 76 as inches which is 6"4' I'll in a sec

FIXED!!! Thanks Dusty for your help, I changed this.height to this.height1, I think this.height is set somewhere else but I couldn't find it :P

DustyPorViva 06-10-2007 05:06 AM

Hmm, ya, I think this.height might be predefined, I forgot all about that.

zokemon 06-11-2007 09:36 AM

this.height would be the height variable for what ever object you are in. It seems you were probably in a GUI control judging by your script so that would be the control's height ;)

Crono 06-11-2007 01:47 PM

Quote:

Originally Posted by Angel_Light (Post 1316760)

height 6'4" = 76in
weight = 238 lbs

professional calc got this for the BMI : 28.9671052632

That's not healthy, just so you know.


All times are GMT +2. The time now is 03:45 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.