I have just started to experiment with HUDs and collections and gameproxies in order to implement a main menu and have the game go back and forth between them, there are plenty of examples here in the forum and I think I mostly got it.
But now I want to implement a dialog screen like this:
So if I have a main.collection with a mainController.script that switches between gameproxyMenu and gameproxyLevel, then inside gameproxyLevel I must have another game proxy and a HUD where I would set the pause, right?
But then, when I call from the mainController.script:
No, nested collection proxies will not be automatically loaded. If the collection that you load using the gameproxyLevel contains additional collection proxies you also need to load these manually.
So you have a main collection with one main menu proxy and one game controller proxy. The main collection has a controller script that takes care of loading and unloading of the main menu and the game, depending on the state of the game.
The game, in-game dialog system and perhaps other game specific stuff is put into the game controller collection, loaded by the main controller. The game controller script will load all of the “sub systems” like the actual game, the dialog system etc and it will be able to pause the game (by setting time_step on the game proxy) while the dialog system is active.
[Edit] I had a hud object instead of the game_controller.script and it was the one calling manually the “load” on the game.collectionproxy and I was going to use it to handle the dialogs, but your approach is better because you use a dialog.collectionproxy to contain this code, thanks again!
Cool! I also think that with the approach I suggested you’ll be able to quite easily test only the game without any of the rest of the stuff by setting the game.collection as the bootstrap collection in game.project and use the game_controller.collection as bootstrap collection to test the game and the dialog system without having to also click through the main menu and things like that.