Is making a pause menu on UPBGE even possible? Or are pause menus dead?

It used to be really simple in 0.2.5 and below - you would superimpose a scene on top of the suspended scene and resume from there. That was until 0.3

With 0.3, you cannot even suspend collections in the entire scene, they need to be done manually, and cannot be done by python. Then there is the resuming thing which also cannot be done globally in python anymore.

How can I get a working pause menu with all collections paused and able to be resumed along with overlay collections hidden and shown?

I’m curious. UPBGE 0.3 Scene Collections are legacy UPBGE’s Scene Layers. With the latter, you couldn’t suspend them, so why assume now that they (collections) can be? If you want to suspend logic, Object States (KX_GameObject.state) is still available for getting/setting logic states - you don’t even need to use them if you want to use Python (use game-properties or Python variables instead maybe).

How would I do that on a global scale with python as in suspending logic?

import bpy

print all objects

for obj in bpy.data.objects:
print(obj.name)

print all scene names in a list

print(bpy.data.scenes.keys())

change

if “status” in bpy.data.meshes:
mesh = bpy.data.meshes
mesh[‘status’] = “pause”

That really depends on how you want it to be setup. You can get every object in the current scene (or all active scenes with a bit more code), or get objects marked with a certain game-property, or an object with a certain name, or an object with a certain state, etc.

import bge

def main(self):

  for o in self.owner.scene.objects:
    # Global
    o.state = 1
    # Certain game property
    if "SPECIAL_PROPERTY" in o.getPropertyNames():
      o.state = 2
    # Certain object name
    elif o.name == "SPECIAL_OBJECT_NAME":
      o.state = 3
    # Certain active state (warning, might produce looping)
    elif o.state == 0:
      o.state = 4

For example, for my pause screen in one of my videos, I checked if a certain GAME_PAUSED game-property was set to True, and if so, to set my player’s state to an inactive state.

You can actually make a simple test collection (example, level), put a cube inside it for testing the collection actuator, then create a seperate game level file, place all linked objects and non-linked objects you want inside said level collection in the file and done! I think it will pause if you use Suspend Collection on it. Just make sure that the level file is seperate from the player blend and that the player is linked to the level .blend file.

Well, a while ago I got the same problem. In my case I just want a way to disable the collections as the player progresses through the campaign, it can’t be done with python, very frustrating for me.

The workaround I come with is to create an empty object with a message listener and a collection actuator to disable it. The script will send a message to activate the actuator to suspend the collection.