User Tag List

Results 1 to 7 of 7

Thread: Use same button for multiple actions?

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleSWF Export Module

    Join Date
    Sep 2006
    Location
    UK
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Use same button for multiple actions?

    HI, after many years of use i have come accross a small issue ive never encounted before yet it seems so trivial.

    Im wanting to use a button for multiple actions, so i though i could use a flag or variable to differentiate which action is to be applied when the button is pressed.

    But what im finding is, it does ALL actions. I have included an example to show. Application.mfa

    You will notice there is 5 actions, but pressing the button once applies them all. How do i overcome this?

    Thanks
    Andy

  2. #2
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleXNA Export Module
    ProdigyX's Avatar
    Join Date
    Jan 2011
    Posts
    1,197
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    It does that because it goes from top to bottom. So when Global Value A is 0 and the button is clicked, Global Value A goes to 1. Then it moves on to the next instance of the condition. When the button is clicked, it still reads all instances of that condition, from top to bottom. To achieve something like what you want you can do one of two things.

    One:
    Do what you have now, but carefully order the events (may cause problems later on)

    Two:
    Put that series of events in a group. When the correct condition is met, deactivate the group. After the group have an "Always -> Activate group "xxx" "

  3. #3
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    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)Firefly 3D Module (Steam)
    Phi's Avatar
    Join Date
    Jan 2010
    Location
    England
    Posts
    1,964
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)
    You need to set a flag on as an action under all those click buttons, and check the flag is false in a condition on all the events. After all of the events, add a new event to reset the flag to false.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleSWF Export Module

    Join Date
    Sep 2006
    Location
    UK
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ProdigyX View Post
    It does that because it goes from top to bottom. So when Global Value A is 0 and the button is clicked, Global Value A goes to 1. Then it moves on to the next instance of the condition. When the button is clicked, it still reads all instances of that condition, from top to bottom. To achieve something like what you want you can do one of two things.

    One:
    Do what you have now, but carefully order the events (may cause problems later on)

    Two:
    Put that series of events in a group. When the correct condition is met, deactivate the group. After the group have an "Always -> Activate group "xxx" "
    I noticed that after and re-ordered yet i get the same result. Although ive not tried it yet, putting them all into groups and then activating and deactivating seems a very long way around this? Lots of actions for such a little job?

    Quote Originally Posted by Phi View Post
    You need to set a flag on as an action under all those click buttons, and check the flag is false in a condition on all the events. After all of the events, add a new event to reset the flag to false.
    I think i have tried to follow you on this yet i still get the same issue, and can see why as this still does the same as before, but now toggling flags? Is this what you mean? Application.mfa

    Thanks
    Andy

  5. #5
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleXNA Export Module
    ProdigyX's Avatar
    Join Date
    Jan 2011
    Posts
    1,197
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Initially, I meant put all 5 events into one group, not each event into its own group. With one big group, as soon as one of the conditions fire, the group gets deactivated and the rest of the events are "skipped" What you did with the flags is a slightly longer and more clustered way, but the flags and the groups achieve the same thing. With the single group. at most you would be adding 8 things; 6 actions, the group and 1 condition.

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleSWF Export Module

    Join Date
    Sep 2006
    Location
    UK
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ahh i see now, that seems to work fine. Thanks Prodigy.

    Andy

  7. #7
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Sep 2010
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am currently writing an application that uses several buttons, each of which have multiple actions. One way is to use flags, the other way is to create a global value or use a counter. Once the counter or GV is set to a specific value, upon click have the button do a set action. I use flags, GVs, and counters.

Similar Threads

  1. Multiple events triggering from one button press
    By Smakian in forum The Games Factory 2 - Technical Support
    Replies: 3
    Last Post: 20th September 2013, 09:58 AM
  2. Button is clicked condition works even when button disabled - Beta9
    By AyreGuitar in forum iOS Export Module Version 2.0
    Replies: 0
    Last Post: 29th May 2012, 02:29 PM
  3. multiple instances spawning at multiple places
    By CPW in forum Multimedia Fusion 2 - Technical Support
    Replies: 17
    Last Post: 22nd February 2009, 12:38 AM
  4. Importing multiple animations as multiple frames
    By Shawn in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 25th November 2008, 09:36 PM
  5. Multiple Turret Shooting With Multiple Targets
    By Brandon in forum File Archive
    Replies: 4
    Last Post: 29th January 2008, 02:34 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
  •