I've often been a fan of using Only one action when event loops, because often you want something to happen every time something first happens, but not otherwise. A simple example: you want a "thud" sound to play when a player lands on the ground after jumping. So you play the sound if onGround=1 but Only one action when event loops so that the sound plays each time the player first lands on the ground, but not on the subsequent frames that the players is touching the ground immediately afterwards.
But now I'm in the somewhat dispiriting process of going through my game's code and removing just about every instance of Only one action when event loops that I've put there over the past 7 years. The reason? Pausing. I've realised that pausing and Only one action when event loops don't mix, at least not the way I do pausing, which is by deactivating the main event group so that it won't run if the player has paused the game. The problem is that once the player unpauses and that group is reactivated, every one of those Only one action when event loops conditions inside will now fire anew. So, to use the above example, while the player is on the ground, the "thud" landing sound will play every time the game unpauses. This is just a cosmetic example, but there are situations in my game where if the player paused/unpaused at the wrong time, it could lead to glitches, cheats, or game-breaking behaviour.
I understand that this is not a bug, but just a quirk of the underlying logic, as DavidN explains:
So I guess that in some technical sense, the condition (onGround=1) is not met, because the whole event is not processed as usual, since the group is deactivated. Perhaps each event has an invisible event is available condition in it that becomes false whenever its parent group is deactivated, which then triggers the Only one action when event loops to reset."Only one action when event loops" means pretty much what it says - if the conditions for the event are met on a cycle, then the actions are not carried out even if the conditions are met on the next cycle. The only time they are carried out is the first time the conditions are met. If the conditions are not met on a cycle, then the loop is broken and the actions will be performed again the next time the conditions are met.
Anyway, has anyone figured out a good way to be able to still use Only one action when event loops inside a group that may get deactivated? Maybe there's some clever way to trick Only one action when event loops into not resetting when it's in a deactivated group?