User Tag List

Results 1 to 4 of 4

Thread: Random Integers.

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

    Join Date
    Sep 2007
    Posts
    242
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Random Integers.

    If I want to return a random number between, let's say 0.1 and 0.5, how would I go about doing that?


  2. #2
    No Products Registered

    Join Date
    Jun 2006
    Posts
    625
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Random Integers.

    Those are not integers...

    (random(5)+1)/10 if you only want 1 digit
    (random(50)+10)/100 if you need 2 digits...

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

    Join Date
    Sep 2007
    Posts
    242
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Random Integers.

    You're right. They aren't integers. I meant to say random numbers.

    But the answer I was looking for is actually:
    (random(5)+1)/10.00

    The code I needed had to return a number smaller than 1.
    The code you listed will always return 0.

    A decimel point is required to return anything smaller than zero, as in the example above, which yields 0.1 - 0.5

  4. #4
    No Products Registered

    Join Date
    Jun 2006
    Posts
    625
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Random Integers.

    Glad you found it yourself ! I'm at job, and couldn't test it here. Sorry for this mistake

Similar Threads

  1. Random Active Spawn in Random Location in Frame
    By Top_of_the_Temple in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 20th October 2016, 03:33 AM
  2. Random Speed + Ypos at random times
    By Keehan in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 14th May 2011, 05:25 PM
  3. Global Only Accepts Integers?
    By grimmy in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 16th April 2009, 05:29 PM
  4. Restore a counter to integers?
    By Pixelthief in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 12th March 2009, 01:35 AM
  5. Turn counter value to integers?
    By gum in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 24th October 2006, 09:24 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
  •