User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: Pause system using Game and Pause groups, "only one event" fires upon un-pause?

  1. #1
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    704
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)

    Pause system using Game and Pause groups, "only one event" fires upon un-pause?

    I've been using a manual pause system for my game where all the game events go in a Game group and all of the pause toggle events go in a Pause group. When the game is paused, the Game group is disabled, and when it's unpaused, it's re-enabled. This works well since only sub-groups that were enabled are re-enabled. Unfortunately, I've noticed that "only one action when event loops" is triggered each time the game is unpaused, as are "on group activated" which makes it difficult to keep track of certain in-game sequences that rely on things happening only once when a group is enabled as part of the game (not from unpausing). Is there a way around this without setting a second set of flags that toggle off once an "only one event" action is run?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    541
    Mentioned
    20 Post(s)
    Tagged
    0 Thread(s)
    I get around this by having a lot of groups.

    The main group has the on group activation event in it and at the end of those events it deactivates itself and activates the next group that has no activation events in it.

    For the most part I try to avoid - only one action when event loops - as it can have unintended consequences in a variety of ways. I would set a flag or a value. I do have a group of events that triggers when a game returns from paused, where it tests the state of a bunch of values and continues from there, I have no better solution.

  3. #3
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    704
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Thanks, yeah I often deactivate state groups but sometimes I needed them open and it didn’t occur to me they’d get reactivated if the parent group or parent parent group was deactivated then reactivated. I also expected “only one” to be consistent over groups, so that’s quite unexpected to me.

    Well, I’ve at least got “run once” for one-shot “on group activation” tricks, but some of these are going to be unpleasant to fix. I did use a flag toggle for one of them where I had two flags:

    (Only one event if) If distance from enemy is less than ** and flag 0 is off and flag 1 is off: turn flag 0 on and flag 1 on, shoot player
    If flag 0 is on and flag 1 is on, flag 0 off

    Something like that, but a simpler and more robust method would be much appreciated so I can quickly change out any bugs that pop up during extending pause testing!

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    541
    Mentioned
    20 Post(s)
    Tagged
    0 Thread(s)
    Yes, a selective pause system is definitely needed - it doesn't seem like Fusion was ever developed with a custom pause in mind - it's missing a lot of features that other software have in.

    You could turn the flags on at your end of pause event so that the shoot player event doesn't immediately trigger - assuming that turning them off again will be after the shoot event in the event lists.

    Another trick I have is to reactivate things half a second later (I mainly use that to eliminate the click to end the pause from triggering an action in the game).

    Trick two - I use a pause control value and everything can only trigger if pause control = 0. Pause sets it to 1, and it's only reset after a second or so when returning from pause.

  5. #5
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    704
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Janette5 View Post
    Yes, a selective pause system is definitely needed - it doesn't seem like Fusion was ever developed with a custom pause in mind - it's missing a lot of features that other software have in.

    You could turn the flags on at your end of pause event so that the shoot player event doesn't immediately trigger - assuming that turning them off again will be after the shoot event in the event lists.

    Another trick I have is to reactivate things half a second later (I mainly use that to eliminate the click to end the pause from triggering an action in the game).

    Trick two - I use a pause control value and everything can only trigger if pause control = 0. Pause sets it to 1, and it's only reset after a second or so when returning from pause.
    I did try setting a special pause that went on during pause, then turned off at the end of the fist frame and all events "on group" and "only one" events would be checked against it, but I could never get the order right no matter what I tried, and it just kept turning off too early. A timer of 1 or 10 milliseconds might also work, but I tend to try and avoid timer events if possible, although in this situation it would probably be preferential.

  6. #6
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    704
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Any ideas how to best force a flag off reliably one frame after unpausing so I can check against it for any actions that re-trigger?

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    541
    Mentioned
    20 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure what you're asking - you want the flag to go off after 1 frame, or stay off for 1 frame?

    I've attached an example - it still works if you change the timer to trigger after 1 - 60th of a second, but even a little slower the player won't see any difference.

    I don't think there's a reliability issue with flags in Fusion - perhaps something else is triggering or changing it later on in the frame which might be why you're seeing it as unreliable.
    Attached files Attached files

  8. #8
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    704
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Janette5 View Post
    I'm not sure what you're asking - you want the flag to go off after 1 frame, or stay off for 1 frame?

    I've attached an example - it still works if you change the timer to trigger after 1 - 60th of a second, but even a little slower the player won't see any difference.

    I don't think there's a reliability issue with flags in Fusion - perhaps something else is triggering or changing it later on in the frame which might be why you're seeing it as unreliable.
    Thanks, I appreciate the example, I'll double check my events to see what's causing it, I know toggle can sometimes do some unexpected things, so I'll have a good look. Thanks again!

  9. #9
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    704
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Ahh, now I know what wasn't working:
    tick1.PNG
    tick2.PNG

    Unfortunately, it will still play the sample, it'll just be delayed by 1 frame. I can't think of a way of being able to test for "only once when loops" only once, other than replacing them all with "run event once" but that would be only be good for events that should never run twice.

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    541
    Mentioned
    20 Post(s)
    Tagged
    0 Thread(s)
    At some point is paused ticked is going to equal 0 and you're not providing for that.

    So it will add 1 while it is negative and then stop at zero. Your next step is to test it when it equals 1 and I don't see where it's going to go from 0 to 1 (unless that's just not part of your screenshot).

    From my understanding - the code that you have written will cause Fusion to play a sound once every frame loop. From what you're explaining you don't want Fusion to do that - but that's more or less what you've programmed.

    If you want the sound to trigger on an action then you can change it to:

    User Shoots
    Set Sound = 1

    If sound = 1
    Play sample
    Set sound = 0

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Replies: 9
    Last Post: 25th September 2019, 03:56 PM
  2. Replies: 4
    Last Post: 8th October 2016, 11:40 PM
  3. Disabling the "Control + P" pause feature
    By Dominic in forum Fusion 2.5
    Replies: 2
    Last Post: 23rd December 2014, 02:09 PM
  4. Replies: 10
    Last Post: 15th October 2012, 05:33 PM
  5. Sound "pause" event trouble
    By 300happy in forum SWF/Flash Export Module Version 2.0
    Replies: 1
    Last Post: 20th September 2010, 09:37 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
  •