-
MMF2 and decimals
I'm trying to get a counter to display the player's health in percent. So, for example, if the player had 15/20 health, then the counter would say 75%. I'm using this formula:
Code:
100 / (Value("HP") / Value("HP max"))
However, MMF seems to round off the value of (HP / HP max) every time. So instead, if the player had 15/20 health, it wouldn't return 1.333, but MMF would round it off to 1.0, so the counter would say 100%.
Why does it do that, and how can I get MMF to work with decimals? I've tried sticking random .0's in there, and multiplying/dividing everything by 1.0, but it doesn't seem to work.
I'm using Multimedia Fusion 2 Developer, build R243.
-
Re: MMF2 and decimals
MMF2 will treat numbers as integers unless you make it clear that it should use decimals. E.g 2/3 is 0 but 2.0/3.0 is 0.6666. Regardless, your method of getting a percentage is flawed. Try:
Code:
(100.0*Value("HP"))/Value("HP max")
-
Re: MMF2 and decimals
Ugh, nevermind. I figured it out (The formula was all wrong! X_X)