User Tag List

Results 1 to 7 of 7

Thread: random?

  1. #1
    No Products Registered

    Join Date
    Feb 2012
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    random?

    Hello

    How do i exclude a number of random?

    Some example:

    Set value1 to random(5)+1 * This sets value to a number between 1 and 5, right? Now let's say value1 got the random number 3.

    Now i wanna do:

    Set value2 to random(5)+1 "but exclude value1" * What would in this particular time mean "Pick a number of 1,2,4,5"

    I hope you understood what i mean?

  2. #2
    Clicker Fusion 2.5 DeveloperHTML5 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
    Jul 2006
    Location
    USA
    Posts
    2,982
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Well, what you could do is set up your events so that if it picks 3, it does another random(5)+1 check. So in essence, it will completely ignore it by re-rolling if it rolls up a 3.

  3. #3
    No Products Registered

    Join Date
    Feb 2012
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm getting mad here. It's all not working! Bah!

    And, while i'm here, why are some events red?

  4. #4
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    The red events are fired first.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  5. #5
    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)
    What Shawn says is the best solution. You can accomplish it by running a fastloop until a valid random number is picked.

    * Button1 is clicked
    - Set Value1 to Random(5)+1
    - Start loop "PickRandomNumberForValue2" 1000 times

    * On loop "PickRandomNumberForValue2"
    - Set value2 to Random(5)+1

    * On loop "PickRandomNumberForValue2"
    + Value2 <> Value1
    - Stop loop "PickRandomNumberForValue2"

    This last two events tries to set the random value 1000 times. If it picks a value that is different from Value1, it means it has succeded and doesn't do any more tries.

  6. #6
    No Products Registered

    Join Date
    Feb 2012
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, so what i'm doing is i let the enemy decide in what direction to move (top down view, 4 directions only).

    On enemies loop an animation is played that has an 'arm' to all 4 directions. Frame1 = arm to the top, Frame2 = arm down, etc. To see if there is an obstacle.

    Now i write in 4 alterable values standing for top, left, right, down either a 1 for no obstacle or a 0 for obstacle.

    Szenario:

    The enemy is standing, on top is an obstacle, to the left, right and down not.
    That would make alterable value
    A = 0
    B = 1
    C = 1
    D = 1

    How do i make him pick one of the legit variables, without starting another loop or using up to 100 events...?

  7. #7
    No Products Registered

    Join Date
    Feb 2012
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone an idea or a workaroud?

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 object spawning random y set x
    By Armiferamortalis in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 23rd December 2013, 11:47 AM
  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. BUG: Random is not random in Flash mode
    By oldkliker in forum SWF/Flash Export Module Version 2.0
    Replies: 1
    Last Post: 11th October 2011, 08:56 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

Posting Permissions

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