User Tag List

Results 1 to 4 of 4

Thread: Multiple events triggering from one button press

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Sep 2013
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Multiple events triggering from one button press

    So I'm making my first game with TGF2. Not even a real game, just playing with it and seeing what I can do. And I know this is a simple problem, and probably covered in one of the myriad tutorials available. But I'm not sure which one or where to look, so I figure I'll ask here.

    So I have a character, a chair, and a counter. When the character is overlapping the chair, the counter is 0, and you push a button, it puts the character in the chair and sets the counter to 1. When the character is overlapping the chair, the counter is 1 and you push the same button, it's supposed to move the character out of the chair and set the counter to 0. Seems simple enough.

    Except that when you push the button, both actions seem to trigger. The character can sit down but never stands back up, because he then sits back down instantaneously. I've set a counter on the sit down action to confirm that that's what's happening, because the character doesn't appear to move. I get it- the counter goes to 0, and he's overlapping the chair, and enter is still being pressed, so the second event triggers and the game decides it must be sit down time again. Any advice on how to solve this no-doubt very elementary problem?

  2. #2
    Clicker Fusion 2.5

    Join Date
    Dec 2009
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could use a time delay on each action: Every 00"-15, Character overlaps chair, counter = 0, Button is pressed - - - - > set counter to 1, sit character in chair
    Every 00"-15, Character overlaps chair, counter = 1, Button is pressed - - - - > set counter to 0, character stands up

    I prefer to use a second counter set to 100 (or less depending on how sensitive you want the button to be), this way there's no slight delay when you first press your button, but enough delay for only one action at a time to occur:
    Always add 1 to counter 2
    Character overlaps chair, counter 1 = 0, counter 2 = 100, Button is pressed - - - - > set counter 1 to 1, set counter 2 to 0, sit character in chair
    Character overlaps chair, counter 1 = 1, counter 2 = 100, Button is pressed - - - - > set counter 1 to 0, set counter 2 to 0, character stands up

    Hope this helps . . .

  3. #3
    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)
    Put both of these events into one group. When either event happens, deactivate the group. After the group, add an always event that reactivates the group.

  4. #4
    Clicker Fusion 2.5Android Export ModuleSWF Export ModuleInstall Creator Pro
    Wackyjackie's Avatar
    Join Date
    Aug 2011
    Location
    Poland
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use a flag . Create one object that will be your values storage, and check out how the flags work. You can toggle them to change value from 0 to 1, or 1 to 0, what is solution to your problem.

    If you still don't know how to do it, please, put your MFA file in this topic .

Similar Threads

  1. Bug : Back button event is looped after one press
    By waw_demmon in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 4th April 2013, 10:28 PM
  2. Application pauses with every button press.
    By LemonyLime in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 23rd March 2012, 09:40 AM
  3. Press fire button Glitch? Design?
    By camelman in forum Multimedia Fusion 2 - Technical Support
    Replies: 30
    Last Post: 10th February 2010, 03:17 PM
  4. Can I force MMF2 to press a button?
    By Iwantmyrpg in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 24th August 2008, 05:58 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
  •