User Tag List

Results 1 to 3 of 3

Thread: MMF2 and decimals

  1. #1
    No Products Registered

    Join Date
    Jul 2006
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.

  2. #2
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    England
    Posts
    3,546
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    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")
    .:::.Joshtek.:::.

  3. #3
    No Products Registered

    Join Date
    Jul 2006
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: MMF2 and decimals

    Ugh, nevermind. I figured it out (The formula was all wrong! X_

Similar Threads

  1. Counters: MMF2 No Decimals, but Android Shows
    By Mikegames in forum Android Export Module Version 2.0
    Replies: 1
    Last Post: 3rd June 2013, 01:12 AM
  2. MMF2 and Decimals
    By VAH in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 17th January 2011, 11:42 PM
  3. Don't want decimals.
    By Cossin in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 18th October 2008, 06:42 PM
  4. Decimals In x and Y pos?
    By Dynamite in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 20th December 2007, 12:36 PM
  5. Decimals
    By Mantoid in forum Multimedia Fusion 2 - Technical Support
    Replies: 31
    Last Post: 20th July 2006, 01:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •