How to forcibly clo...
 
Notifications
Clear all

How to forcibly close the main menu?

4 Posts
2 Users
0 Reactions
35 Views
0
Topic starter

The project im working on has a specific map that serves as a main hub and I wanted to make an item that teleports the player back at some cost. For this purpose I created a common event that just changes the hero location to there but it keeps the menu open, fading in and out on the spot and only teleporting the player once the menu is manually closed. I wanted to make it so activating it closes the menu and then changes the location but I can't find how to. I tried disabling and enabling the menu but it did nothing and I don't see a "close menu" event like with the one to open it. Searching arround, I found a script that could do what I wanted:

Manager.Stack.pop(new Scene.Menu())

Manager.Stack.pop(new Scene.Menu())

However, using this has some issues of it's own. Using it after the player is moved automatically closes the menu but the effect still looks horrible while using it before stops the rest of the event from running entirely. Is there some other option I could use? Maybe a different script?

Wano Wano 08/11/2024 1:08 pm

@sergiop90 I didn't test but your can do only

Manager.Stack.pop(); Manager.Stack.pop();

What is the "horrible look" exactly?

SergioP90 SergioP90 Topic starter 08/11/2024 1:30 pm

The horrible look is that when using the item, the game will wait until the menu is closed to actually move the player but any transitions, sound effects, etc... will still play out. This means that the fade out effect plays, the fade in effect plays, the character snaps onto another map and the menu closes (intended behaviour due to the script being right at the end). If I instead change the script location to just before the teleport, you'd think the menu would close and then move the character but instead it will close the menu and then stop the reaction mid execution, meaning nothing moves.

Wano Wano 08/11/2024 1:48 pm

@sergiop90 I tried with this common event and it works as intended (show message a, + choice, if I press yes it closes menu and teleports + show message b once teleported)

Share: