• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Pausing trouble

Having trouble with making a pause menu. I tried it on my own using the instance_deactivate_all() and instance_activate_all(), but some of the instances remained deactivated when I unpaused.

Any pointers? (Preferably in DnD)
 

TsukaYuriko

☄️
Forum Staff
Moderator
(Preferably in DnD)
Sure... as soon as instance activation and deactivation in DnD becomes a thing.


Please post your code with full context. As in, post where which code is, and the code itself.

Do any issues occur aside from some instances remaining deactivated? How are you determining that they are still deactivated?
 
Sure... as soon as instance activation and deactivation in DnD becomes a thing.


Please post your code with full context. As in, post where which code is, and the code itself.

Do any issues occur aside from some instances remaining deactivated? How are you determining that they are still deactivated?
Well I use DnD mostly for my game but I used Gml for the pause.
I created a new object, then add a Key press event (for pausing) I tried it out, the first room it went smoothly, but as soon as I get to the next room, it leaves some objects deactivated.
For example, the Object controlling the camera.
 
Well I use DnD mostly for my game but I used Gml for the pause.
I created a new object, then add a Key press event (for pausing) I tried it out, the first room it went smoothly, but as soon as I get to the next room, it leaves some objects deactivated.
For example, the Object controlling the camera.
I used Slyddar's tutorial videos btw.
 

TsukaYuriko

☄️
Forum Staff
Moderator
Please post your code with full context. You have now posted some functions you're using in one post and some events you added in another post. If you want us to be able to provide accurate help, don't leave anything to us and our imagination to figure out and puzzle together. Provide concrete information.

All I can tell you with the information I have so far is that these functions, when used correctly and without external interference, will activate and deactivate instances without fail. But that won't get either of us anywhere. ;)
 
Please post your code with full context. You have now posted some functions you're using in one post and some events you added in another post. If you want us to be able to provide accurate help, don't leave anything to us and our imagination to figure out and puzzle together. Provide concrete information.

All I can tell you with the information I have so far is that these functions, when used correctly and without external interference, will activate and deactivate instances without fail. But that won't get either of us anywhere. ;)
Here, I took pictures. Hopefully that helps. If there's anything you don't understand, tell me.
 

Attachments

kburkhart84

Firehammer Games
Is it possible that you are trying to reactivate the objects AFTER going to the next room? As the manual states, any persistent objects that are deactivated when you go to another room will not actually be taken to the next room. You have to activate them BEFORE going to the next room. Finally, you also should understand that the activation/deactivation happens "between" steps according to the manual. So an instance that was just now activated won't actually be fully activated until next step.
 

TsukaYuriko

☄️
Forum Staff
Moderator
You have GML - so, plain text - code in your project that can be copied and pasted without any problems, and yet, rather than doing that, you did not just go for the vastly inferior option of screenshotting the code, but outright took a photo of it with a camera... that's one of the things I don't understand. 🤔

Before you do anything else, do yourself and everyone else a favor and learn how to screenshot:


That aside, when we ask you to "post your code with full context", that means any and all code that is related to the issue. So if your problem has to do with deactivated instances after going to different rooms, that includes any code that handles activation and going to different rooms. The way I see it right now is that your pause pauses absolutely everything, so it should be impossible to go to a different room while the game is paused (as you have not posted any code that is capable of going to a different room while the game is paused). That code would have to be in the only object that doesn't get deactivated during pauses. Is that the case?

I don't see any way for the code you posted to fail without external influence (e.g. changing rooms, which will leave deactivated instances behind). You said it yourself that you are doing this, but you didn't post any code that actually does that. So, like before, I have no idea what you are actually doing that leads to this issue, because the code you posted - by itself - can not physically cause the problem you describe because it does not go to any room. Get what I mean about the "full context"? ;)
 
Is it possible that you are trying to reactivate the objects AFTER going to the next room? As the manual states, any persistent objects that are deactivated when you go to another room will not actually be taken to the next room. You have to activate them BEFORE going to the next room. Finally, you also should understand that the activation/deactivation happens "between" steps according to the manual. So an instance that was just now activated won't actually be fully activated until next step.
I'm sorry to ask, but can you give me a visual example?
I'm not so good with learning information just by vocal or written examples alone.
 

kburkhart84

Firehammer Games
I'm sorry to ask, but can you give me a visual example?
I'm not so good with learning information just by vocal or written examples alone.
I don't have anything visual. And since you haven't really posted more details on your code etc... as @TsukaYuriko has been asking for, I don't really know how to help you. You need to understand what steps are, etc... to be able to understand what I mean.
 
Top