Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
How to Pause the Game

Prince
Guest
Quote
2015-02-01 12:52:25

How to pause a game in Coppercube, is there any behavior or plugin ?


erik
Registered User
Quote
2015-02-01 13:22:54

You can switch temporarily to another scene, for example with a "pause" screen or text. That's what I am doing.


rolevix
Registered User
Quote
2015-02-01 13:37:10

erik,
No, it's kill actions like "Do something later" and other scripts, it's wrong way to create Pause... sorry


Prince
Guest
Quote
2015-02-01 13:58:59

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. ....


niko
Moderator
Quote
2015-02-01 19:00:32

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.


Prince
Guest
Quote
2015-02-02 08:00:09

Thanks Niko .... Its working .


bracer
Registered User
Quote
2017-04-29 02:12:35

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.


ishmaru
Registered User
Quote
2017-05-12 17:54:11

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.


bracer
Registered User
Quote
2017-05-15 14:29:51

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 ?


ishmaru
Registered User
Quote
2017-05-15 15:40:16

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.


Robo
Guest
Quote
2019-06-27 12:49:54

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...


srfstudio
Registered User
Quote
2019-06-28 21:40:45

...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


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internation?l" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact