User Tag List

Results 1 to 4 of 4

Thread: 5 Counters higest number wins?

  1. #1
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    warlords's Avatar
    Join Date
    Oct 2011
    Location
    Dk
    Posts
    544
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    5 Counters higest number wins?

    Hello everyone

    I have a question I would like to have some help with!

    I have 5 counters with random(20)

    How can I know which counter who have the higest number of all 5 counters?

    How to prioritize it, so the higest number wins, then second highest number and so on ...

    Is it possiple to make such a thing?

    Thanks mark

  2. #2
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Easiest solution: Use the Sort X object. It's pretty self explanatory... You set numbers to different values in the sort array, and then you can sort by decreasing... then you can output that info into a string or list or whatever. But of course I'm not sure how platform friendly the Sort X object is.

    Harder but more platform friendly solution: You'll need to create either an array or use a list object or something... anything to keep track of all the numbers, and then run fastloops through the list of numbers and re-order them based on any number that is "above" them in the list. So for example if you have the numbers:

    5,2,9,8,6

    It would start by looking at number 2 and checking if it is greater than number 5. It isn't, so move on to the next number. Then it checks if number 9 is greater than number 2, and then number 5. It is, so move it above 5 and 2. Then it checks 8 to see if it's greater than 2 5 and 9... it is greater than 2 and 5 so move it above those, etc...

    This might not be the best solution because my brain is foggy this morning. I'm sure someone else has a more elegant solution but this one would do in a pinch.

  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)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)
    Not really what you want, but in cases where you only want the highest value of all the counters, you can use this expression:

    Max(Max(Max(Max(value( "Counter" ), value( "Counter 2" )), value( "Counter 3" )), value( "Counter 4" )), value( "Counter 5" ))

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    It would really be awesome for MMF3 if they just have a math function that could spit this out... like:

    sortValdecrease(#,#,#,#,...)
    sortValincrease(#,#,#,#,...)

    And so you could do like sortValdecrease(5,2,1,4,3)

    and it spits back 5,4,3,2,1

    I guess as an array or something... so you could access the numbers like: sortVal[0] would be 5.

    edit: essentially what Sort X does... but not needing an entirely new extension just to do simple sorting.

Similar Threads

  1. change graphic of multiple number counters?
    By StingRay in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 18th October 2013, 12:31 PM
  2. Getting a random number between a negative and positive number
    By D_Light in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 9th January 2013, 10:51 PM
  3. selecting only the higest z ordered active?
    By BrashMonkey in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 20th September 2009, 10:51 AM
  4. Counters
    By Guitaristinmakin in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 29th August 2007, 04:01 PM
  5. the app dosnt goto the next frame when player wins
    By Personman64 in forum The Games Factory 2 - Technical Support
    Replies: 4
    Last Post: 9th August 2006, 11:45 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
  •