User Tag List

Results 1 to 9 of 9

Thread: Brain stuck on Min/Max dilemma

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Chrille's Avatar
    Join Date
    Jul 2006
    Posts
    389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Brain stuck on Min/Max dilemma

    I'm trying to figure out how to use the Min & Max functions to make an expression pick the lowest of two values, but never the lower one if it's too low. I can't figure out HOW or even IF it can be done within one expression or if I'll need an extra event.

    Here's how the code works, roughly:
    * A loop checks for items in a list.
    * On each loop, IF an item is found, it should store its index in a counter, but only if it's lower than the current counter value.
    * However... If the current counter value is -1, it should always store the index value.

    I guess I'll just go with the two events for now, and see if anyone has Min/Max solution

  2. #2
    Clickteam Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform 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)
    Simon's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    2,735
    Mentioned
    65 Post(s)
    Tagged
    3 Thread(s)
    Use the immediate if object:

    blah = (min(vara, varb), "<", threshold_value, max(vara, varb), min(vara, varb))

    That will do it in one expression. If you want to always pick the threshold_value or higher, just wrap that whole statement (I'll refer to it as statementa) as follows:

    blah = max(threshold_value, statementa)

    It's fine to do nested statements and calculations like this.

    I hope that helps

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Chrille's Avatar
    Join Date
    Jul 2006
    Posts
    389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I must say I'm confused! Is there an IF object/extension?

  4. #4
    Clickteam Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform 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)
    Simon's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    2,735
    Mentioned
    65 Post(s)
    Tagged
    3 Thread(s)
    Yarp, I wouldn't have suggested it otherwise It is cross platform too.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Chrille's Avatar
    Join Date
    Jul 2006
    Posts
    389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, cheers

    I couldn't find it earlier, the extension manager server seems to be down.


    (and on that topic)
    Is there an alternative method to get the manager's featured extensions? I'm working from different locations and just got back home to realise I can't continue my work since I'm missing ZipObject.mfx on this machine. Did try to google it but only found dead links.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    I use the Immediate IF object too, and I'm quite happy with that
    but my extension manager says it's Windows only?

    Whithout this (hopefullybuiltininFusion3 ) extension,
    coud this work?

    Min(Max(-1,val1),Max(-1,val2))

    Assuming that "too low" is clearly defined as "-1":

    pick the lowest of two values,
    but never the lower one if it's too low
    ---> "<= -1"

  7. #7
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    Ziplock's Avatar
    Join Date
    Oct 2013
    Posts
    448
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "* However... If the current counter value is -1, it should always store the index value."

    Problem with Min(Max(-1,val1),Max(-1,val2)) is this will return -1 (neither of the numbers) if BOTH are lower than -1.

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    You're right

    What should the function output if both values are lower than -1?
    The highest of the two, even if it's lower than -1?

    Wait.. I've read more carefully the looping explanation.

    loopindex=A
    counter=B


    B <> -1
    if A<B ---> A
    else ---> B

    B=-1 ---> A

    Mmmmm.
    Can hardly see a way with Min/Max

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Chrille's Avatar
    Join Date
    Jul 2006
    Posts
    389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just went with the two events. I try to use as few extensions as possible

    Thanks again guys

Similar Threads

  1. Subapp build dilemma
    By RichTheDude in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 27th May 2014, 01:17 PM
  2. INI Delete Group dilemma
    By fwtep in forum Android Export Module 2.5
    Replies: 5
    Last Post: 14th April 2014, 06:41 PM
  3. Dungeon Dilemma
    By dragonguy in forum File Archive
    Replies: 17
    Last Post: 23rd September 2010, 09:57 PM
  4. Progressive String Dilemma
    By DisneyBoy in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 29th January 2010, 11:03 PM
  5. Saving Dilemma
    By Kid_Roleplay in forum The Games Factory 2 - Technical Support
    Replies: 1
    Last Post: 21st May 2007, 04:43 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
  •