User Tag List

Results 1 to 4 of 4

Thread: Compare value on all alterable values on one object?

  1. #1
    Clicker 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)
    Bree's Avatar
    Join Date
    May 2014
    Posts
    317
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Compare value on all alterable values on one object?

    Hey all!

    I have 1 active with 5 alterable values that I need to do a comparison to see if any of them equal 1, or 2. If they do I will have a counter set based the value returned. Only one of them will have a value larger than 0 when the check is done. I know I could do this set up Alterable value A = 1, Alterable Value A = 2, Alterable Value B = 1, Alterable value B = 2 ect, but that's a lot of code and seems like there could be a simpler way. Is there any easier way to do this?

    I tried playing with loops and AltValN but couldn't figure out how to check and return the value properly, only how to set it the values on a loop. I thought about doing Compare two general values but once in there I couldn't figure out how to do all of the values at once.

    Anybody have any ideas?

    Thanks so much!

  2. #2
    Clicker Fusion 2.5 DeveloperiOS 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)
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Compare value on all alterable values on one object?

    I don't know if this would work since I'm not in front of my computer, but this would be my thought process.

    Use fast loops to quickly check and compare all of the alterable values in an active. If you can, find the number of alterable values in the active (not sure if there's an expression for this). Then you set a fast loop for that number so it'll check each one.

    On each loop compare the current alterable value (using the loop index) to 1. Copy that line of code and test to see if it compares to 2. If it's true then set your counter to the number.

    The only problem in my mind is that I don't know if you can loop through multiple alterable values using a numeric value, but if you can that would be the easiest way.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    marius's Avatar
    Join Date
    Dec 2015
    Location
    Oslo, Norway
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Given that it is just 1 active object with 5 alterable values that are to be compared to 1 and 2 (or a range from n to m), you can use pretty much what Sumo said, but compare it to a range instead. This will save you a line of code for every value between and including n and m

    Since you said you tried to play with AltValN, here is an example. What it does is to check AltVal A, B, C, D and E (you specify the number of loops) and compare their values to the range in 1 to 2. My values are 1, 2, 3, 4 and 5. If they are in range, they are added to counter.

    Compare.mfa

  4. #4
    Clicker 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)
    Bree's Avatar
    Join Date
    May 2014
    Posts
    317
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Ooo! Thank you Marius! Was trying to work on Sumo's suggestion but couldn't get it quite working right, thanks to both of you! That helps so much!

Similar Threads

  1. Replies: 5
    Last Post: 11th October 2015, 10:48 AM
  2. 'Compare to one of the alterable values' VS 'Compare two general values'
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 1st January 2012, 06:26 PM
  3. Help with Alterable Values and Object Creating
    By Fr34kSh0w in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 7th August 2011, 02:59 PM
  4. Alterable Values for the String Object
    By DukeHighway in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 4th December 2010, 09:56 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
  •