Quit script not working.

Started by Sewer Agent, Mon 14/02/2005 11:45:15

Previous topic - Next topic

Sewer Agent

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.

Ashen

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.
I know what you're thinking ... Don't think that.

Sewer Agent

#2
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!

Ashen

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.
I know what you're thinking ... Don't think that.

Sewer Agent

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?

Remco

It is not the tutorial. I followed the tutorial 2 days ago with the newest ags version, and it all worked out fine.
There is only 1 entertainer, the Q entertainer!

Sewer Agent

Ok then must be something I was doing then, thanks.

Scorpiorus

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.

SMF spam blocked by CleanTalk