User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17

Thread: Whats the deal with decimals.

  1. #1
    No Products Registered

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Whats the deal with decimals.

    Could someone please explain how I can get MMF2 to correctly calculate equations with decimals in them?

    Im thinking of using LUA to calculate instead, any examples for simply calculating somthing in that?

    Thnx.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,366
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Re: Whats the deal with decimals.

    Don't know about Lua, but for MMF to calculate with decimals you have to tell it to calculate with floating points instead of integers.

    Example:
    8 / 5 will produce 1
    8.0 / 5 will produce 1.6

  3. #3
    No Products Registered

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Whats the deal with decimals.

    But I need to divide "Named Varibles" with each other.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,366
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Re: Whats the deal with decimals.

    (Named Variable +0.0) / (Another Named Variable)

  5. #5
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    1,812
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Whats the deal with decimals.

    What Popcorn said.

  6. #6
    No Products Registered

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Whats the deal with decimals.

    Nope it aint working, this is what im trying to do.

    (((( 2 * NAMEDVAR ) + NAMEDVAR + ( NAMEDVAR / 4 )) * NAMEDVAR / 100 ) + 5 ) * NAMEDVAR

    NAMEDVAR = NamedVarible(value) it is not a decimal value.

    -Ive tryed adding a .0 to the end of every number - doesnt work.

    -Tryed replacing NAMEDVAR with (NAMEDVAR + 0.0) - doesnt work.

    -Replaced NAMEDVAR with (0.0 + NAMEDVAR) -doesnt work.

    -Have tryed different combinations of the above to get it working - doesnt work.


    Maybe someone could make an example on how to do that in LUA, I assume LUA knows what math is.

  7. #7
    No Products Registered

    Join Date
    Aug 2006
    Location
    Westcountry, UK
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Whats the deal with decimals.

    if NAMEDVAR is one variable as opposed to lots then you can simplyfy the formula down to:

    x(0.0325x²+5)

    if you want to use lua the use the following...

    (run script
    "x=VARIABLE ; y=((0.0325*math.pow(x,2))+5)*x"

    alternatley you use "a" to(number of named variables) as values instead of "x"

    then retrive the public variable y (as value)

  8. #8
    No Products Registered

    Join Date
    Jun 2006
    Location
    here
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Whats the deal with decimals.

    I just did a quick test, and it seems that the Named Variable object is unable to store floats (it floors them)

    So I guess your problem is that you're trying to store the result in a named variable, meaning that even though the calculation is working correctly, when the result is stored it is rounded.

    Using lua will not help that. You'll have to find a different way to store the resulting value. It might also be a good idea to contact the extension creator to see if float support can be added.

  9. #9
    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: Whats the deal with decimals.

    Try Xinok's Store Float extension. It "converts between the floating point and long data types for storage purposes".
    .:::.Joshtek.:::.

  10. #10
    No Products Registered

    Join Date
    Aug 2006
    Location
    Westcountry, UK
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Whats the deal with decimals.

    or a global value <img src="/center/images/graemlins/wink.gif" alt="" />

Page 1 of 2 1 2 LastLast

Similar Threads

  1. How does apple deal with age ratings?
    By WhatPixelYouOn in forum iOS Export Module Version 2.0
    Replies: 3
    Last Post: 6th November 2012, 10:34 PM
  2. How to deal with different weapons
    By Pancra in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 20th October 2006, 08:49 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
  •