User Tag List

Results 1 to 7 of 7

Thread: Is there a way to do "else if"?

  1. #1
    Clicker Fusion 2.5 DeveloperSWF Export Module

    Join Date
    Sep 2006
    Posts
    540
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is there a way to do "else if"?

    Example

    if 100 yards away, run
    else if 30 yards, jog
    else walk

    Thanks

  2. #2
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleFirefly 3D Module
    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)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    1,444
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Well, there are extensions for that, but it's all Windows only...
    There are other ways of doing it, like using groups, opposite events or if you get 2.5+ you can easily do it with child events.

  3. #3
    Clicker Fusion 2.5 DeveloperSWF Export Module

    Join Date
    Sep 2006
    Posts
    540
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The child events sounds interesting.
    Can you put child events within child events?

    BTW which extension does if else for windows?

    Thanks

  4. #4
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleFirefly 3D Module
    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)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    1,444
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Yes, as long you don't add immediate conditions (those green/red conditions) in child events, cause those work as a trigger and run in a separated order, so Fusion won't allow you to do so.

    IfElse Nest Object for example

  5. #5
    Clicker Fusion 2.5 DeveloperSWF Export Module

    Join Date
    Sep 2006
    Posts
    540
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I checked out the else if, but it does not seem to reduce any steps. At some point soon, I'll have to purchase the 2.5+.

    The group event is looking the most promising at this point.
    I'm thinking you can activate it, then close it when one of the ifs is true.
    If I come up with a noteworthy-ish work around, I'll post it.

    Thanks for your help

  6. #6
    Clicker Fusion 2.5 Mac
    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)

    Join Date
    Jan 2015
    Location
    Australia
    Posts
    301
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Child events are *very* useful, but if you're doing an ELSE/IF type condition you can use a flag to do it:


    edit: in hindsight this is probably more like 'select case'

  7. #7
    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
    3,070
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dascribe View Post
    Example

    if 100 yards away, run
    else if 30 yards, jog
    else walk

    Thanks
    In many cases, you can just do this using an always condition:

    1. Always - walk
    2. If =>30 yards - jog
    3. If =>100 yards - run.

    This effectively puts the "else" part at the beginning, instead of at the end. It will walk first, then immediately override that with jog or run, as needed. So if it's, say, 120 yards, the code will execute both walk and jog before finally overriding them with run. In many cases, this is fine. Obviously it depends on what the actions are. You obviously wouldn't want to do something like this:

    1. always - Create Blue Sky object
    2. If cold - Create Snow object
    3. If very cold - Create Blizzard object

    If it was very cold, then the above would obviously create two separate objects - a blue sky and a blizzard - which would be wrong. But in most other cases, the action in #2 or #3 will just safely override the earlier action(s) and no harm will be done.

Similar Threads

  1. Replies: 2
    Last Post: 17th June 2022, 12:20 AM
  2. Replies: 6
    Last Post: 30th December 2019, 02:59 PM
  3. Replies: 0
    Last Post: 29th October 2015, 09:42 AM
  4. Replies: 6
    Last Post: 18th August 2015, 03:23 AM
  5. "Cannot load joystick2.mfx" when "Compress the runtime" unchecked. Fine when checked.
    By DistantJ in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 14th September 2013, 10:44 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
  •