Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Remco on Thu 18/03/2004 18:22:29

Title: How to end a game
Post by: Remco on Thu 18/03/2004 18:22:29
I have a question. I am a bit testing ags. I am making a short room and stuff but how can you end a game? I have maked a room, and if you take a key then you can unlock the door, but how can i and the game then?
Title: Re:How to end a game
Post by: Darth Mandarb on Thu 18/03/2004 18:25:38
Quit(VAL);

:)

Seriously, it depends on how you want the game to end.

You can program a new room with ending credits:
You can have the game simply quit:
You can have it go back to the start screen:

So how do you want it to end?

~ d
Title: Re:How to end a game
Post by: Remco on Thu 18/03/2004 19:03:04
Well, first there stands in the screen: You have completed the game, GREAT!  and then it returns to the main screen.
Title: Re:How to end a game
Post by: Ben on Thu 18/03/2004 19:59:59
Select "Run Script" from the interactions editor..

Type this:

Display("You have completed the game, GREAT!");
RestarrtGame();
--------
Edit* there are only 2 'r's in Restart, teh silly!1
Title: Re:How to end a game
Post by: Remco on Fri 19/03/2004 12:57:52
if i do this the game is restarting to the beginning. But i want that the game returns to the menu.
Title: Re:How to end a game
Post by: Radiant on Fri 19/03/2004 13:11:06
I'm not sure what menu you mean but you could use SetRestartPoint() when it's on screen, then a future RestartGame() will warp you to that point.
Title: Re:How to end a game
Post by: Remco on Fri 19/03/2004 13:19:17
if you start a game, you can choose between: New Game Load or Quit. I want my game to return to that screen when you complete a game.
Title: Re:How to end a game
Post by: Scummbuddy on Fri 19/03/2004 14:56:45
The just use the NewRoom() command, and type whatever room that was, such as intro referring to intro.crm, or 1
Title: Re:How to end a game
Post by: Alynn on Fri 19/03/2004 19:23:46
Out of curiosity, do you have intro.crm as your title screen?

Because in my tests by default RestartGame() takes you to room1.crm.... What you should do is in your "First time Player enters  screen" For intro.crm is call SetRestartPoint ()
That should set that to the place the game is restarted too...

Test it out... I believe it will work...

EDIT: And scummbuddy, the problem with new rooming back to the title screen is that nothing is reset back to the defaults, so you would have to manually do it, restartgame does it for you.
Title: Re:How to end a game
Post by: Remco on Fri 19/03/2004 21:01:42
where can i see what my starters menu room is?
Title: Re:How to end a game
Post by: Scummbuddy on Fri 19/03/2004 21:46:53
well, if you havent made an intro.crm room file, then i suppose its room1.crm for you.
Title: Re:How to end a game
Post by: Remco on Sat 20/03/2004 06:31:55
room 1 is the room where the caracter starts
Title: Re:How to end a game
Post by: Ben on Sat 20/03/2004 18:01:27
So, what is the problem, exactly? If you put RestartGame(); at the part when the player finishes, it should reset everything and take you back to room 1. You don't even need to bother with NewRoom(); in this case. Do you want the game to restart at some place other than room 1? That's what SetRestartPoint(); is for. If the game already starts at the point you want it to return to at the end, you don't even need SetRestartPoint. Or are you having trouble figuring out where to put the RestartGame(); command?

Title: Re:How to end a game
Post by: Remco on Mon 22/03/2004 07:03:16
Well, if you start a new game, then you start in the main screen right. Where you can start a new game, load or quit. If my character has finished the game, then i want him to return to the main screen so he can choose if he wants to play the game again or if he want`s to quit.
Title: Re:How to end a game
Post by: SSH on Mon 22/03/2004 09:29:49
By default, RestartGame() take you to the same screen as double-clicking the EXE. If that is your menu, then thats where restart game will take you. Have you actually tried doing this, Remco?

Alynn: that's not my experience, becuase in my game "Alba the Explorer" I just use a RestartGame call and it takes me back to the intro.crm. I didn't use any SetRestartPoint calls.
Title: Re:How to end a game
Post by: Alynn on Mon 22/03/2004 13:42:00
SSH:

HRm.... odd... with mine when calling RestartGame it bypasses intro.crm and goes straight to room1 which is my title screen.  Haven't used SetRestartPoint either.

Maybe it's because it automaticly switches from intro to room1...

Maybe because room1.crm is the first room with a gui on it...

Maybe Pumaman should interject with his infinite knowlage of how this damn thing works :P