User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 17 of 17

Thread: Whats the deal with decimals.

  1. #11
    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.

    Thanx for all your help but I dont need the stored value to be a float value, I just need it to calculate everything as a float, and than round it.

    Also the im using different namedvaribles, I just said NAMEDVAR for simplification.

    I would appreciate it if someone made an example of doing this in LUA.

  2. #12
    No Products Registered

    Join Date
    Jun 2006
    Location
    Texas
    Posts
    1,002
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Whats the deal with decimals.

    Alright, doing something like this in Lua should be a fairly simple task.

    What you would do is:

    function DoCaculate(x,y)
    return (x+0.0)/y;
    end

    from here you could call the lua function from MMF 2 and get the return value of the caculation, or you could do the following:


    function DoCaculate(x,y)
    return (x+0.0)/y;
    end
    myVar=DoCaculate(2,3);

    and then myVar would be the public variable you would get in MMF 2.

  3. #13
    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.

    I think you might need to create a .mfa for me because I had no succsess using lua to do this (I did try tho), I even managed to crash MMF.

    So could you plz plz plz plz plz make an example, please.

  4. #14
    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 need it to calculate everything as a float, and than round it.[/]

    I'm not really sure why you want to do this with LUA - just put Round( ... ) around your equation (and add the .0 bits). Without that, the named variable object will Floor your final value (Floor strips the decimal part without checking it, i.e. 1.8 becomes 1 instead of 2) So you need to force it to round instead. That should fix your problem.

  5. #15
    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.

    sure. im not exactly sure how to attach it on the forum but if you send a private message with your email address on it ill send it.

  6. #16
    No Products Registered

    Join Date
    Jun 2006
    Location
    Texas
    Posts
    1,002
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Whats the deal with decimals.

    If you want an example using Lua then please send me your email through a pm. I haven't configured my FTP servers on this laptop yet.

  7. #17
    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.

    Look in "File Archive" under raytrace examples

Page 2 of 2 FirstFirst 1 2

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
  •