User Tag List

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

Thread: randomizing items without overlaping

  1. #1
    No Products Registered

    Join Date
    Sep 2011
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    randomizing items without overlaping

    Hi guys, I did a quick search here but I could not find my answer so I'm asking here. I have a very simple quiz like frame in which when you point your mouse on several horizontally aligned objects you will hear a different voice and then you have to click on the correct obj to move to next frame or to restart frame in case you were wrong. The point is after playing few times players will remember position of the correct obj and it will be no challenge. Considereing that all objects are side by side(few px between each)how can I arrange them randomly at the start of frame without making them overlap eachother? Thanks.

  2. #2
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleXNA 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)
    gkinfinity's Avatar
    Join Date
    May 2011
    Location
    USA
    Posts
    284
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: randomizing items without overlaping

    Do your objects have the same width?

    I made you a quick example (but it only works if the above is true).

    View MFA

    There might be an easier way to do it too, idk

  3. #3
    No Products Registered

    Join Date
    Sep 2011
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: randomizing items without overlaping

    Thank you so much for your effort and time to make that mfa file for me. I'm afriad without your further explanation I can not figure out your codes completely.
    P.S. and yes my objects are all same size

  4. #4
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleXNA 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)
    gkinfinity's Avatar
    Join Date
    May 2011
    Location
    USA
    Posts
    284
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: randomizing items without overlaping

    You should basically just be able to copy this code over for your own project. I'm not sure what you really need help with either but I'll explain a few things.

    ~To Add your objects to a qualifier~
    -Highlight all of your objects and in the properties window click on the events tab. Click to the space to the right of where it says Qualifier(s) and an 'Edit' button should appear. Then click on add and select a qualifier (doesn't matter which one it is).

    Here's an updated MFA with one event changed to be more general which also has a little extra explaining. If you wanna know how to do something specifically let me know.

    View MFA

    If you just randomly change around the numbers in the last event you should get a pretty good idea of how it works.

  5. #5
    No Products Registered

    Join Date
    Sep 2011
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: randomizing items without overlaping

    Ok, let me work around a bit with your file and if there will be a question I'll be back here...maybe tomorrow!thank you so much.

  6. #6
    No Products Registered

    Join Date
    Sep 2011
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: randomizing items without overlaping

    Ok, I guess I have problem understanding these codes I hope you can explain: 1st in the start of frame we have a global value that we will set it to "NObjects( "Group.Good" )" what exactly is it? is Nobjects kinda a function or its what you typed it there?
    2nd: start loop"sort"...i dont get it. we have a loop that sorts something but how?
    and my most important question: according to your code we will always have a similar sequence of objects whenever we run the frame or game which was exactly my issue from the beginnig. I want foreach playing the frame we would have a random sequence of objects.

  7. #7
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleXNA 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)
    gkinfinity's Avatar
    Join Date
    May 2011
    Location
    USA
    Posts
    284
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: randomizing items without overlaping

    Okay so what's happening is that at the start of the frame it sets the global value to NObjects( "Group.Good" ). In other words, it's setting the value to the number of objects in the qualifier 'Good'. It's counting the number of objects you have so that it knows how many objects it needs to reposition later. To do this, click on Change a Global Value>Set in the Special conditions column of the events editor (the first column). Then click on the 'Retrieve data from an object' button, right click on the picture of the qualifier you used, and go down to Count>Number of Objects.

    The first event also activates the loop 'Sort'. The next event only happens when the loop 'Sort' is running, and it chooses one of the objects that hasn't been placed into a random position yet. It then places the object, decreases the Value of Global Value A by 1, and starts the loop again. Global Value A is essentially telling the loop how many times it should place objects. It starts off at 5 since there are 5 objects for my example, then it places an object and the value goes down to 4. There are then 4 objects which need to be placed and it chooses one, places it, and reduces the value down to 3. This process repeats until all objects have been placed and Global Value A = 0.

    And for your final question, are you saying that it isn't placing the objects into a random order when you try to run the application? Press F8 to run the application, look at the order, then close it. Press F8 again and look at the order again. It should be different (at least, it is when I try it). What build of MMF2 are you using?

  8. #8
    No Products Registered

    Join Date
    Sep 2011
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: randomizing items without overlaping

    Thanks for your elaborations, and about my version of mmf, im using mmf2 build 239 which is out of date I know. so you think that's the problem in my case, cause without touching your code and your mfa file, whenever i run application, it gives me exactly same sequence of actives. Do you think it is a problem of events or what?

  9. #9
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleXNA 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)
    gkinfinity's Avatar
    Join Date
    May 2011
    Location
    USA
    Posts
    284
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: randomizing items without overlaping

    I don't know really. There are a lot of other people here you can do a better job of helping you than I can. I would assume that it isn't working because it's an older version, but I'm not sure why that would be an issue with such a simple application.

    Hmmm, well I just realized that I had saved it in the HWA version so that actually might be the issue. Trying to open an HWA MMF2 file in an old version of MMF2 might cause problems. Try this last MFA out and if it doesn't work, just repost your question I guess and hopefully someone else will be able to help you out.

    View MFA

  10. #10
    No Products Registered

    Join Date
    Sep 2011
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: randomizing items without overlaping

    Nope, didn't work. It's not due to my OS (windows 7) right?

Page 1 of 2 1 2 LastLast

Similar Threads

  1. how to identify 2 same object overlaping?
    By mulder in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 31st January 2013, 12:32 AM
  2. randomizing
    By pikzilla in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 2nd April 2009, 10:02 PM
  3. Randomizing Pick?
    By Jdsfrog in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 24th December 2008, 09:52 PM
  4. Overlaping Active Objects
    By Jairo in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 9th January 2007, 05:01 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
  •