User Tag List

Results 1 to 7 of 7

Thread: Multiple comparisons at the same time

  1. #1
    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)

    Multiple comparisons at the same time

    Is it possible to do multiple comparisons of AVs and flags at the same time??
    Like, I often check if an alterable value is between, say 5 and 20. My usual way would be to check if it is greater than 5 + lower than 20. But I have seen Max and Min before, though I have never used it myself and Im not 100% sure how it works..
    Also, comparisons of flags: is it possible to compare multiple flags at the same time? If I remember correctly, you can check if a flag is off, and then enter the number as "0 and 1", which is a valid expression but a non working one - as far as I remember anyway..

  2. #2
    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)
    You can use range in the form of (Value, Min, Max)

    Alt.A = Range(Alt.A,5,20)

    As for flags, I'm not sure what you're getting at. You can compare as many flags as you want in the same expression.

    Flag 1 is off
    + Flag 2 is on
    + Flag 4 is off
    -> Action

    Something tells me that's not what you mean, though.

  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)
    Cool! Ill try this out when I get home - thanks

    As for flags, when you make a new event to check for a flag is on/off, in the expression you enter the flag, you are allowed to write "1 or 2". The event will say "Flag 1 or 2 is on" or "Flag 1 or 2 is off", but I dont think this expression works in reality.. I can post an example when I get home.

  4. #4
    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)
    OR is a bitwise operator. Base level binary stuff. In binary, each digit is the following digit times 2, with the final digit being 1. The digits 00000 have the values 16-8-4-2-1. Making a digit 1 instead of 0 will "turn it on," adding the digit's number to the string's value. This "5-string" binary number can have the values 0-31, hence the 32 flag limit. Once you get to flag 32, you've wrapped back around to flag 0.

    Flag 1 on would be 00001. Flag 2 on would be 00010. Flag 1 OR Flag 2 on would be 00011, also known as Flag 3.

    i.e.:

    Flag 3 = 00011
    Flag 13 = 01101

    OR: Produces a result of 0 in the digit if they're both 0. Otherwise, it's 1.

    Flag 3 OR Flag 13 = 01111, a.k.a., Flag 15

    AND: Multiplies the digits in each position.

    Flag 3 AND Flag 13 = 00001, a.k.a., Flag 1

    XOR: Results in a digit of 1 if they're different or 0 if they're the same.

    Flag 3 XOR Flag 13 = 01110, a.k.a., Flag 14



    I still think the only way to accomplish what you want is:

    Flag 1 is on
    +OR
    +Flag 2 is on:
    -> Action

  5. #5
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    I might also be misunderstanding, but I think he is saying the expression comparison of a flag is broken. Meaning, you can do a comparison in the expression editor and refer to a flag as a value of 0 (off) or 1 (on).

    + Flag ("active", 0) = 0 (using Compare 2 general values)
    - do some action

    In this comparison, if Flag 0 of "active" equals 0 (Flag 0 is off) then this condition returns true and some action occurs. It works fine for me when I test it out.

  6. #6
    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)
    Quote Originally Posted by marius View Post
    As for flags, when you make a new event to check for a flag is on/off, in the expression you enter the flag, you are allowed to write "1 or 2". The event will say "Flag 1 or 2 is on" or "Flag 1 or 2 is off"
    I get the impression when fusion is asking him which flag to check, he's literally typing "1 or 2." This is a bitwise operation that's no different than putting in a formula, like 7-4. Putting "1 or 2" in the flag number will check flag 3.

  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)
    mobichan, you gave me an idea though. You can get it done in one line with:

    Compare 2 general values - Flag ("Active", 1) + Flag ("Active", 2) > 0:
    -> Action

    This will check if Flag 1 or Flag 2 is on. I generally try not to use compare 2 values though, because of scoping. But I can't think of any other way to get this done with one condition.

Similar Threads

  1. Delete multiple objects at the same time
    By henryhissagames in forum Fusion 2.5
    Replies: 2
    Last Post: 23rd February 2016, 08:55 PM
  2. multiple overlapping instances at the same time
    By ArmedBanana in forum Fusion 2.5
    Replies: 5
    Last Post: 2nd June 2014, 05:30 AM
  3. Multiple Highscores in Time format
    By Perry in forum Fusion 2.5
    Replies: 1
    Last Post: 30th May 2014, 05:16 PM
  4. joystick input on multiple games running at the same time?
    By Chokito in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 19th November 2012, 08:12 PM
  5. Multiple Lasers at a time?
    By N64Mario in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 7th January 2010, 03:44 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
  •