User Tag List

Results 1 to 8 of 8

Thread: Random value but never be this value.

  1. #1
    ExtremeDeadGames
    Guest

    Question Random value but never be this value.

    I want to do like this: the counter do a random value of 0-10 but never be 7 for example. How do i do that in the same expression?

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleFirefly 3D Module

    Join Date
    Sep 2010
    Posts
    596
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    One way is to have a counter/global/alt value serve as a holder for the number you don't want and if your randomized value equals that number you make a new randomizer. Might be better ways but that's what i came up with on the spot :-)

  3. #3
    ExtremeDeadGames
    Guest
    hmm... but how do i do to put in the expression is the number that i don't want, do it again?

  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,374
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    The best I can come up with is this: Val(Mid$("00010203040506080910", Random(10) * 2, 2))

  5. #5
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    Burfelt's Avatar
    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    526
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    That's actually a brilliant approach Popcorn!

  6. #6
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,312
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    Holy crap, that IS pretty clever!

    I was going to say simply add 1 to the result if it is 7. That makes 8 have a slightly higher chance of being the number, but probably not too bad.

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    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)
    Wodjanoi's Avatar
    Join Date
    Jun 2015
    Location
    Germany
    Posts
    695
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    String functions in Fusion are great and can be a lifesaver sometimes. See also this thread with a similar random number problem:
    http://community.clickteam.com/threads/92505-Random-number-without-last-number-(It-s-possible-)-(random-counter

  8. #8
    ExtremeDeadGames
    Guest
    Thank you for helping Popcorn. But still it repeats the value in a row. :\

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. Mario ghost random random spawn
    By Sparckman in forum Guides, Tutorials, Examples, Widgets
    Replies: 0
    Last Post: 30th May 2014, 06:48 PM
  3. Make Random Pool not-so-random?
    By UltraHammer in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 4th April 2013, 02:53 PM
  4. Random and MT Random strange behaviour
    By crusher in forum iOS Export Module Version 2.0
    Replies: 0
    Last Post: 8th October 2011, 01:32 PM
  5. 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

Tags for this Thread

Posting Permissions

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