Hi
How can I be sure that user will load the game, and not cancel loading. I have GUI that I am closing after user presses load. But if user presses cancel on load screen, GUI is off and there is a blank room.
Thanks!
I'm not quite sure what you are after but if you really want to force the user load a game just remove the cancel button from the GUI.
Or what behaviour do you want when the user presses "cancel"?
I think using a command to return the player to the room they came from would solve this.
For my load GUI (Interface 2) I use:
else if (button == 2) { //Resume playing
Ã, Ã, InterfaceOff (2);
Ã, Ã, SetDefaultCursor();
Ã, Ã, }
However if I get the player to an extra room first (like a map, or a book) I use this:
if (interface == 3) { //return
Ã, Ã, if (button == 0) {
Ã, Ã, Ã, NewRoomEx (character[ GetPlayerCharacter () ].prevroom, character[ GetPlayerCharacter () ].x , character[ GetPlayerCharacter () ].y);
Ã, Ã, Ã, InterfaceOff (3);
Ã, Ã, Ã, }
Ã, Ã, }
Does it help?
All the answers I got are related to custom load game GUI, but I am using built-in load game gui.
Is there a way to check if user has loaded the game and then do something (remove custmo GUI) and when he presses cancel, it does nothing (all with built-in load GUI)?
Yes, there is a global on_event function that can be used to catch the load event:
// main global script file
function on_event (int event, int data) {
if (event == RESTORE_GAME)
{
// code just after the game is restored
GUIOff(...);
}
}