User Tag List

Results 1 to 5 of 5

Thread: OR Condition in an alterable value

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleXNA Export ModuleInstall Creator Pro
    Shadeve's Avatar
    Join Date
    Aug 2011
    Location
    GA USA
    Posts
    228
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    OR Condition in an alterable value

    Is it possible to make an OR condition inside of a condition that says "If alterable value A=1 OR 5?" I know I could use the regular OR condition, but I have a lot of other conditions in the event, and I need to do this to 20+ events, so I would have to copy and paste all the conditions to the new OR condition.
    If this isn't possible, is there some sort of equation that returns 1 or 5?

  2. #2
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    644
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Using compare two general values, check if:

    Max(1 - Abs(value - 1), 0) + Max(1 - Abs(value - 5), 0) = 1

    This works because of the formula: Max(1 - Abs(x - n), 0). If X = N it'll return 1, otherwise it'll return 0. I picked this trick up from Jacob a while ago and found that you can just keep stacking them with + for however many numbers you want to check for, and if your value is any of them the result will always be 1.

    Take note that "compare two general values" doesn't take object scope into account, so you will need to specify which object you are comparing, usually by running a foreach loop.

  3. #3
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,274
    Mentioned
    90 Post(s)
    Tagged
    0 Thread(s)
    That's gold! I'll need to remember that one, casleziro!

  4. #4
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    644
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    It's pretty nifty.

    Could be used in expressions too i.e

    >X = X + 1 * (Max(1 - Abs(value - 1), 0) + Max(1 - Abs(value - 5), 0))

    As a very simple example.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleXNA Export ModuleInstall Creator Pro
    Shadeve's Avatar
    Join Date
    Aug 2011
    Location
    GA USA
    Posts
    228
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Ah a true stroke of genius. Much appreciated! Saved me lots of time now, and also in the future when I come across another situation like this. I wish my math skills were up to that level haha.

Similar Threads

  1. Replies: 2
    Last Post: 26th September 2015, 08:23 PM
  2. Replies: 8
    Last Post: 7th May 2015, 11:26 PM
  3. Alterable Strings as Alterable Values?
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 27th March 2012, 08:14 PM
  4. Alterable Strings and Alterable Values limit :(
    By Pedro Almeida in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 13th October 2006, 07:38 AM
  5. Alterable Value and Alterable String conflict
    By Patrick in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 28th September 2006, 03:51 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
  •