Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Sewer Agent on Mon 14/02/2005 11:45:15

Title: Quit script not working.
Post by: Sewer Agent on Mon 14/02/2005 11:45:15
I am using the Sylpher tutorials which are really easy to follow and well written and I was very happy with what I was doing, until, that is, I tested it out for myself and it didn't work! I'm posting here to check if it's because this tutorial is out-dated or if I am doing something wrong.

Thanks.
Title: Re: Quit script not working.
Post by: Ashen on Mon 14/02/2005 11:55:35
You need to be a bit more specific about:
- What code you're using.
- Where it is.
- What it's doing (i.e do you get an error message, or does it just not work).
- Which version of AGS you're using.

As far as I can tell - and assuming I'm looking at the right tutorial - the code is still good, except maybe with the more recent betas.
Title: Re: Quit script not working.
Post by: Sewer Agent on Mon 14/02/2005 12:02:53
The problem is that when I run the command to leave the game (either by Ctrl and Q or by the Exit button.) my GUI runs but when I click on the button Quit or Play nothing happens. I assume I am using the latest edition as I only re-downloaded AGS a few days ago (I had AGS about a year ago but it was deleted so I have re-downloaded it.). As far as what code I am using I don't know what you mean lol!

EDITED:
I think I have found what the problem is but for some reason I closed the editor without saving my new GUI! I think the problem was that I set a button to value 0 and by looking through the script there seems that it must have to be a button value of 1 or more and I put in QuitGame(0); and I don't think that would work either and I should have put in QuitGame(1). If I am wrong please tell me lol!
Title: Re: Quit script not working.
Post by: Ashen on Mon 14/02/2005 12:38:13
Well, buttons can have the value 0 but, again assuming I'm looking at the right tutorial, object 0 on your GUI would be the label. So yes, you probably want button 1 to quit, button 2 to keep on playing.

QuitGame (1); will ask you to confirm quitting (i.e. bring up the built-in Quit GUI, after your custom one), while QuitGame (0); will just quit when you press the button.
Title: Re: Quit script not working.
Post by: Sewer Agent on Tue 15/02/2005 09:23:23
I probably did set the wrong values but wouldn't at least one of the buttons of done something? I think that if I had set the text as object 0 then wouldn't the play button been reconized as the quit button?
Title: Re: Quit script not working.
Post by: Remco on Tue 15/02/2005 10:04:17
It is not the tutorial. I followed the tutorial 2 days ago with the newest ags version, and it all worked out fine.
Title: Re: Quit script not working.
Post by: Sewer Agent on Tue 15/02/2005 12:59:54
Ok then must be something I was doing then, thanks.
Title: Re: Quit script not working.
Post by: Scorpiorus on Tue 15/02/2005 18:20:28
QuoteI probably did set the wrong values but wouldn't at least one of the buttons of done something?
Also, make sure these GUI button's Left click property is set to Run script.