Start a scene paused

I have a scene I want to start off paused, and an overlay scene plays and then the scene resumes. It pauses and adds the overlay scene at the same time. It works ok now, but it jumps for a second before it pauses. Is there any way to stop it from doing that?

I’m afraid I can’t think of an easy way. Maybe the overlay scene adds the other scene once it has finished?

if keypress pause---------and-----------x=1
________________________------------pause scene

if x min 1 max 2--------and-------------add 1 to x

if x =3--------------and----------------open overlay

this needs to be in a separate scene, that is always active,

I’m not sure that is what he was asking. That will delay adding the overlay scene, but not pause the other scene any sooner.

what about

(scene that will be paused)
always--------and----------message I am on

(Control scene)
if message I am on inverted------and----------add overlay?

so not receiving the messages opens the overlay?

There is almost definitely room for improvement but this seems to work:

PauseSceneExample.blend (482 KB)

Run this script when you want to switch to said scene:


from bge import logic


# This is the name of the scene that you want to be paused on startup
scene = "PausedScene"


#Convert each item in the list to a string
lst = logic.getSceneList()
for item in lst:
    lst[lst.index(item)] = str(item)


# If the scene doesn't exist, add it.
if scene not in lst:
    logic.addScene(scene, 1)
else:
    logic.getSceneList()[lst.index(scene)].suspend()
    logic.getCurrentScene().end()

I will edit the code if I get some improved suggestions :yes: