Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Sinister on Sat 14/02/2004 06:16:11

Title: Questions on Message Windows
Post by: Sinister on Sat 14/02/2004 06:16:11
I want to edit the Message windows. I know how to edit the ones GUI that are available, but i dont know how to edit the (quit/play) window.

i want to change colors and maybe style (i know text can be changed in the general message thingy)

and also how do i make (those Restore/Restart windows).. when you get killed?
Title: Re:Questions on Message Windows
Post by: on Sun 15/02/2004 01:38:31
This is from the manual on restarting after you die or something like that.

ResetRoom
ResetRoom (int room_number)

Discards all the data that the engine has in memory about when the player last visited ROOM_NUMBER, and resets it as if they'd never been there. The next time the player goes to that room, all the objects and scripts will be in their initial state (as set up in the editor), and not how they were when the player left the room. The "First time enters screen" event will be run when they enter this room again.
This function is useful if you want to have a "View intro" option to allow the player to watch an intro again - this function can reset all the objects in the intro rooms to their starting positions.

NOTE: You cannot reset the current room (ie. the room that the player is in).

Example:

ResetRoom(0);

will reset the intro room so it can be played again if the player wants to.



(NOTE: since this only resets one room, you will have to do the code for every room, like this
ResetRoom(1);
ResetRoom(2);
ResetRoom(3);  etc.)

Title: Re:Questions on Message Windows
Post by: Kweepa on Sun 15/02/2004 08:48:07
Hmm, since you can't reset the current room, using ResetRoom doesn't seem like a great solution.

I think you should use a save slot instead, so when you know the player has the option to do something dangerous, call

SaveGameSlot(100, "Ooh, dangerous");

and when they click the "Restore" button,

RestoreGameSlot(100);

The manual recommends using slot 100 and up for this sort of thing, since the standard save slots are 1-20.


As for changing the standard dialogs, your best bet is just to create new ones. For example, the Quit/Play dialog only pops up if you call QuitGame(1) in your global script. Instead, GUIOn a new dialog of your creation and if the player clicks Quit on it, call QuitGame(0).

Steve