User Tag List

Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 40

Thread: Better Logic Flow: Nesting Conditions, Else, Or

  1. #1
    No Products Registered

    Join Date
    Jul 2006
    Location
    Madison, WI, USA
    Posts
    250
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Better Logic Flow: Nesting Conditions, Else, Or

    Much of my events would be simplified if I could do some of these behaviors. These are common basic logic-flow controls from any programming language and I'm curious if there's any way to replicate these with the event editor.

    For example, say I have 3 types of ships, and when they press the fire button, I want them all to fire, but different objects. As it is now, I'd have to have 3 separate events that duplicate conditions and actions like so:

    *Event 1*
    Condition: ship pressed fire1 + ship ammo > ship Alterable Value A (ammo cost) + ship Alterable Value T (type) = 0
    Actions: play ship type 0 fire sound + create ship type 0 projectile + subtract ship's ammo cost from ship's ammo count

    *Event 2*
    Condition: ship pressed fire1 + ship ammo > ship Alterable Value A (ammo cost) + ship Alterable Value T (type) = 1
    Actions: play ship type 1 fire sound + create ship type 1 projectile + subtract ship's ammo cost from ship's ammo count

    *Event 3*
    Condition: ship pressed fire1 + ship ammo > ship Alterable Value A (ammo cost) + ship Alterable Value T (type) = 2
    Actions: play ship type 2 fire sound + create ship type 2 projectile + subtract ship's ammo cost from ship's ammo count

    As you can see, most of that is duplicated, which is more work to set up, more work to revise/update and creates more opportunity for mistakes. The only difference is the type of object it shoots and what sound it plays (this is a big problem for me, btw, I don't see any way to just say "play my fire sound" and be able to define different fire sounds - alias or macro them, so to speak).

    If I could nest and use else, it would look like this:

    *Event 1*
    Condition: ship pressed fire1 + ship ammo > ship Alterable Value A (ammo cost)
    Actions: subtract ship's ammo cost from ship's ammo count
    Nest Condition: ship Alterable Value T (type) = 0
    Nest Actions: play ship type 0 fire sound + create ship type 0 projectile
    Else Condition: ship Alterable Value T (type) = 1
    Else Actions: play ship type 1 fire sound + create ship type 1 projectile
    Else Condition: ship Alterable Value T (type) = 2
    Else Actions: play ship type 2 fire sound + create ship type 2 projectile

    This is a simplified example, but I have some groups of events that would really benefit from this. Adding an "OR" would be great, too, for a case where, say, ship types 1 and 5 both fire the same type of projectile.

    Anyone know if this is possible using existing features? If not, anyone know if of an extension that adds this?

  2. #2
    No Products Registered

    Join Date
    Jul 2006
    Location
    Madison, WI, USA
    Posts
    250
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Better Logic Flow: Nesting Conditions, Else, Or

    Much of my events would be simplified if I could do some of these behaviors. These are common basic logic-flow controls from any programming language and I'm curious if there's any way to replicate these with the event editor.

    For example, say I have 3 types of ships, and when they press the fire button, I want them all to fire, but different objects. As it is now, I'd have to have 3 separate events that duplicate conditions and actions like so:

    *Event 1*
    Condition: ship pressed fire1 + ship ammo > ship Alterable Value A (ammo cost) + ship Alterable Value T (type) = 0
    Actions: play ship type 0 fire sound + create ship type 0 projectile + subtract ship's ammo cost from ship's ammo count

    *Event 2*
    Condition: ship pressed fire1 + ship ammo > ship Alterable Value A (ammo cost) + ship Alterable Value T (type) = 1
    Actions: play ship type 1 fire sound + create ship type 1 projectile + subtract ship's ammo cost from ship's ammo count

    *Event 3*
    Condition: ship pressed fire1 + ship ammo > ship Alterable Value A (ammo cost) + ship Alterable Value T (type) = 2
    Actions: play ship type 2 fire sound + create ship type 2 projectile + subtract ship's ammo cost from ship's ammo count

    As you can see, most of that is duplicated, which is more work to set up, more work to revise/update and creates more opportunity for mistakes. The only difference is the type of object it shoots and what sound it plays (this is a big problem for me, btw, I don't see any way to just say "play my fire sound" and be able to define different fire sounds - alias or macro them, so to speak).

    If I could nest and use else, it would look like this:

    *Event 1*
    Condition: ship pressed fire1 + ship ammo > ship Alterable Value A (ammo cost)
    Actions: subtract ship's ammo cost from ship's ammo count
    Nest Condition: ship Alterable Value T (type) = 0
    Nest Actions: play ship type 0 fire sound + create ship type 0 projectile
    Else Condition: ship Alterable Value T (type) = 1
    Else Actions: play ship type 1 fire sound + create ship type 1 projectile
    Else Condition: ship Alterable Value T (type) = 2
    Else Actions: play ship type 2 fire sound + create ship type 2 projectile

    This is a simplified example, but I have some groups of events that would really benefit from this. Adding an "OR" would be great, too, for a case where, say, ship types 1 and 5 both fire the same type of projectile.

    Anyone know if this is possible using existing features? If not, anyone know if of an extension that adds this?

  3. #3
    No Products Registered

    Join Date
    Jul 2006
    Location
    Edinburgh, United Kingdom
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Better Logic Flow: Nesting Conditions, Else, O

    There was an IfElse object for Multimedia Fusion 1.5 (Link) along with the Cunning Object which if I'm correct allowed you to do OR logic (Link).
    From what I remember Tigerworks has given the source code to a lot of his objects to Clickteam however he also lost a lot in a hard drive failure so I'm not sure whether they the Cunning Object will be getting ported. As for the IfElse Nest object again I don't know hopefully it will be.

    Regards,

    Lewis

  4. #4
    No Products Registered

    Join Date
    Jul 2006
    Location
    Edinburgh, United Kingdom
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Better Logic Flow: Nesting Conditions, Else, O

    There was an IfElse object for Multimedia Fusion 1.5 (Link) along with the Cunning Object which if I'm correct allowed you to do OR logic (Link).
    From what I remember Tigerworks has given the source code to a lot of his objects to Clickteam however he also lost a lot in a hard drive failure so I'm not sure whether they the Cunning Object will be getting ported. As for the IfElse Nest object again I don't know hopefully it will be.

    Regards,

    Lewis

  5. #5
    No Products Registered

    Join Date
    Jul 2006
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Better Logic Flow: Nesting Conditions, Else, O

    i think the stuff you asked about could be done with fast loops.... any time you want an action "macro" type thing, a loop would probably work.

  6. #6
    No Products Registered

    Join Date
    Jul 2006
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Better Logic Flow: Nesting Conditions, Else, O

    i think the stuff you asked about could be done with fast loops.... any time you want an action "macro" type thing, a loop would probably work.

  7. #7
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, Århus
    Posts
    3,456
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Better Logic Flow: Nesting Conditions, Else, O

    I have suggested sub-events/nested events to clickteam before but it seems it's a major feature that will take time to implent in MMF at this stage.

    My idea would look like this in your example:

    Code:
    + Fire button 1 is pressed
          + Value A of [ship] = 1
          --------> Play sound A, shoot ect. ect.
          + Value A of [ship] = 2
          --------> Play sound B, shoot ect. ect.
          + Value A of [ship] = 3
          --------> Play sound C, shoot ect. ect.
    It could really simplyfy the code. I guess we have to wait for stuff like this for the next version though. <img src="/center/images/graemlins/smile.gif" alt="" />

  8. #8
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, Århus
    Posts
    3,456
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Better Logic Flow: Nesting Conditions, Else, O

    I have suggested sub-events/nested events to clickteam before but it seems it's a major feature that will take time to implent in MMF at this stage.

    My idea would look like this in your example:

    Code:
    + Fire button 1 is pressed
          + Value A of [ship] = 1
          --------&gt; Play sound A, shoot ect. ect.
          + Value A of [ship] = 2
          --------&gt; Play sound B, shoot ect. ect.
          + Value A of [ship] = 3
          --------&gt; Play sound C, shoot ect. ect.
    It could really simplyfy the code. I guess we have to wait for stuff like this for the next version though. <img src="/center/images/graemlins/smile.gif" alt="" />

  9. #9
    Clicker

    Join Date
    Jul 2006
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Better Logic Flow: Nesting Conditions, Else, O

    I made the IIF and Looper. IIF was an Immediate If, though it worked within actions, not events. And Looper was similar to FastLoop, but had all the different types of loops (While, For, etc.)

  10. #10
    Clicker

    Join Date
    Jul 2006
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Better Logic Flow: Nesting Conditions, Else, O

    I made the IIF and Looper. IIF was an Immediate If, though it worked within actions, not events. And Looper was similar to FastLoop, but had all the different types of loops (While, For, etc.)

Page 1 of 4 1 2 3 ... LastLast

Similar Threads

  1. Pyroclastic Flow
    By Maveritchell in forum Released Games & Apps in Flash
    Replies: 0
    Last Post: 6th May 2013, 09:35 PM
  2. need help about traffic flow
    By webwolf in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 26th March 2012, 06:48 AM
  3. What is the Logic Behind This? (negate object overlapping "logic")
    By Blue66 in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 10th January 2012, 11:54 PM
  4. Budget Flow
    By Jeff in forum iOS Released Games & Apps
    Replies: 0
    Last Post: 31st October 2011, 02:40 PM
  5. flow control?
    By lincore in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 20th October 2008, 09:05 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
  •