User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 24

Thread: Calculations in MMF2 code - It's not working, help

  1. #1
    Clicker Android Export Module

    Join Date
    Feb 2010
    Posts
    130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Calculations in MMF2 code - It's not working, help

    Hi.

    So basically I'm trying to do a simple hit accuracy for my game (Bullets hit*100/Bullets fired) This works fine in a usual calculator, but for some reason it doesn't work in MMF2, it just seems to say 0 all the time, no matter what.

    I also have problems like this with other calculations such as ratios.

    Please help I cannot find the problem!

  2. #2
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Calculations in MMF2 code - It's not working, help

    Please don't post questions like this here. Post them in "Multimedia Fusion 2 - Technical Support".
    Replace the 100 by 100.0 - that way MMF will use floating point calculations.

  3. #3
    Clicker Android Export Module

    Join Date
    Feb 2010
    Posts
    130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Calculations in MMF2 code - It's not working, help

    Thanks! it worked! but how do I get rid of the decimals? for example, 678*100.0/1000=67.8

    How do I get rid of the .8? then I will be able to make 67% hit accuracy thanks again Looki

    Oh yeah and sorry for posting this here, I will in future I'm new here.

  4. #4
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Calculations in MMF2 code - It's not working, help

    You can use floor(67.8) to round down and get 67.
    ceil(67.8) rounds up and gets 68.
    If you want to round to the closest integer, use round.
    round(67.8) would return 68 since .8 is >= .5
    round(67.2) would return 67.

  5. #5
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Calculations in MMF2 code - It's not working, help

    Wait, I thought MMF2 only had floor()?
    Working as fast as I can on Fusion 3

  6. #6
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Calculations in MMF2 code - It's not working, help

    Well, you thought wrong.

  7. #7
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Calculations in MMF2 code - It's not working, help

    Why would MMF2 only have Floor()? :crazy:

  8. #8
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Calculations in MMF2 code - It's not working, help

    Because Ceil() is the same as Floor()+1? And you could make conditions for rounding. I guess I just mis-read somwhere. Plus, look at this:

    How the heck am I suppost to know something exists if it's not referenced anywhere, not even in the help?
    Working as fast as I can on Fusion 3

  9. #9
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Calculations in MMF2 code - It's not working, help


  10. #10
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Calculations in MMF2 code - It's not working, help

    Um, ok that's just wierd. Sometimes MMF2 glitches up if my computer has been on too long. I'll see if restarting helps.
    Working as fast as I can on Fusion 3

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. How do you code a working Kill/Death ratio?
    By moonyjacob in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 12th February 2010, 10:52 AM
  2. Need help getting my jump code working
    By mobichan in forum File Archive
    Replies: 2
    Last Post: 19th January 2009, 05:22 PM
  3. Working animation skipped over in new life code
    By scurvy in forum The Games Factory 2 - Technical Support
    Replies: 3
    Last Post: 21st February 2008, 11:03 PM
  4. MMF2 & Printing code
    By Patrick in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 25th October 2007, 12:55 PM
  5. EAX in MMF2? i got some source code!
    By Patrick in forum Extension Development
    Replies: 1
    Last Post: 9th February 2007, 09:37 AM

Posting Permissions

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