Troubles with custom pause
I've made a custom pause system in my game that uses 2 groups. When the pause key is pressed, one group is disabled and the other is enabled. When the main game group is re-enabled, it seems that all the On Group Activation events retrigger. Using "Run this Event Once" does not seem to work in this case.
Has anyone else encountered this and is there a workaround?
Mobichan
Re: Troubles with custom pause
Well, when do you activate the group? If there's another trigger to activate it, use that instead of on group activation. I've never really understood "On Group activation" because it could be the same as the event that activated the group, or a start of frame if the group was activated at start. That along with not being an immediate condition makes me wonder of its purpose.
But yes, I think you can replace the "On group activation" with whatever conditions activate the group, as long as the order of events is correct. Meaning that the group is activated before this event is supposed to be triggered.
Re: Troubles with custom pause
Well, the place I am running into this involves a series of groups that are "states" of a boss. Each state is a different attack pattern. So when one state is finished, that group is disabled and the next state's group is enabled. Each group has some "On activation" events that set up the boss' position and variables. The problem I am running into is that if you pause/unpause the game then the boss repeats the "On Activation" code. I also have some groups that handle when music is initialized and they are nested in groups that start the music "On Group Activation."
It isnt that easy to retrofit alot of flags or checks on my existing code, since it has gotten pretty big. I was hoping to not use the sub-app method for Flash compatibility as well. Can anyone offer a way to stop the "On Group Activation" events from firing again after a parent group has been re-enabled? Or is that just a "quirk" in MMF?
Re: Troubles with custom pause
Try the Run this Once workaround using a value somewhere and the events etst if it is 0. On the kast one set it to 1. ;)
Re: Troubles with custom pause
Would that even need the "Run this Once" event? If I am understanding your solution, I would replace all the On Group Activation events with a check to see if var=0. Then at the bottom of my event list (after all the game code) I would change the var to 1? Wouldn't that need the var reset to 0 every time the groups are enabled?
Re: Troubles with custom pause
I thought you wanted it so that it ran only once when the group was activated, and never again even if the group is deactivated then activated again. That is what you said, isn't it?
Re: Troubles with custom pause
Sorry, I need the groups to activate their code if that specific group is activated. The problem I have is that if a parent group is activated, all the enabled child groups seem to run their "On Group Activation" code. I still need the individual groups to be able to activate/deactivate multiple times. I just dont want parent groups to affect child groups.
edit: Oops, after re-reading my initial post, I guess I didn't explain myself well. ^_^'
Re: Troubles with custom pause
Can anyone confirm if it is possible or not to activate a parent group and not have a child group (that was already active) run "On Group Activation" events?
Re: Troubles with custom pause
When you deactivate a parent group it effectively deactivated the child ones too. When you activate it is also activates the child groups that were active before the parent was deactivated. You just have to find a workaround. :(
Re: Troubles with custom pause
As I asked in my first post, I'm hoping for suggestions for a workaround, as I haven't been able to find one on my own. :(