Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
How to pause a game in Coppercube, is there any behavior or plugin ? |
||||
|
You can switch temporarily to another scene, for example with a "pause" screen or text. That's what I am doing. |
||||
|
erik, No, it's kill actions like "Do something later" and other scripts, it's wrong way to create Pause... sorry |
||||
|
Dear .... It will not pause game .... Enemy will be shooting the player behind your temp screen .... I need something , make time scale = 0 , just like in Construct 2 for e.g. .... |
||||
|
If you switch to another scene, the old scene will pause and isn't running in the background. And it will continue when you switch back. So yes, this should be an easy way to pause your game. But yes, a way to slow down time would also be a nice addition. |
||||
|
Thanks Niko .... Its working . |
||||
|
Wait, switching to another scene will pause the previous scene...which means...when you switch to another scene the previous scene is still in memory !!!! How does one unload the previous scene from memory altogether especially when the world of the game is enormous. |
||||
|
This is a bit old but i need to add a few points to this: 1- Switching to another scene for a pause does not work with the "DoSomethingLater" action. Those from scene A will still attempt to execute even in Scene B and will at best bring up a "Cannot Find Node" error, or even crash the whole application. 2- When you switch scenes the state of the previous is kept in memory. This means that having applications with many scenes will crash on weaker systems due to memory issues. The best solution I know of is: Switch from scene A to scene B Restart Scene A Excuse this Javascript - ccbCleanMemory() A proper way to pause or control game speed is really needed. |
||||
|
Ishmaru, you mentioned having to restart scene A while you are in scene B before you can call ccbCleanMemory() to clear scene A out of ram. From your own experiment, can you confirm this IS the case ? Would calling ccbCleanMemory() while you are already in scene B without restarting sceneA also clears it anyway ? |
||||
|
Yes, without restarting scene A, it remains in memory after ccbCleanMemory(). I have a game that has lots of small scenes, and with just ccbCleanMemory() the app would crash around 10th successive scene. Once I tried restarting each previous scene, THEN ccbCleanMemory() I no longer have the crashes. |
||||
|
I found that when I restart a scene from another scene then do clean memory function - the do later functions still happen and the damn game would switch back to the opening scene all by itself.... was big headache to diagnose but fixed it: I couldn't stop the do later timers from another scene continuing but instead added a variable for each scene so that once my game loaded from the opening scenes the opening scene variable had changed and so no running opening scene functions while in the game - fixed... |
||||
|
...this is a bit concerning, I didn't realize that 'Do Something Later' will continue functioning even after the scene has been switched. Is this the only action that's unaffected by switching scenes or did anyone find any others? I guess the only thing is @Robo's solution with inserting a variable in 'ActionToDo' for any following action after the timer of 'Do Something Later' runs out. This will be a living hell to fix for my game's intro, I have over 10 'Do Something Later' actions following one after another with multiple model/camera/light animation/position/rotation changes :( ...or maybe I'll just disable 'skip' button for intro :D |
|