Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Chicky on Wed 26/05/2004 13:36:33

Title: problem with quit gui
Post by: Chicky on Wed 26/05/2004 13:36:33
hey, im making a quit gui for my mags game. This is my first game so im teh n00b when it comes to scripting.

tell me, whats wrong with this script

 
  if (interface == QUIT) {
   
   if (button == 0) {
     
     QuitGame (0) ;
     }

if (button == 1) {
   
   GUIOff (3) ;
   }
}


cheers
Title: Re: problem with quit gui
Post by: Ishmael on Wed 26/05/2004 13:48:43
Nothing, if you have the buttons set to "Run Script" on left-click, and the "Yes" button is GUI object 0, and the "No" button is GUI object 1...

You sure you have all the brackets right? So that you're not nesting that inside another if (interface == ) conditional?
Title: Re: problem with quit gui
Post by: Chicky on Wed 26/05/2004 14:05:22
new problem,

function inventory6_a() {
  // script for inventory6: Use inventory on this item
AddInventory (7) ;

LoseInventory (2) ;

LoseInventory (6) ;
}

function inventory2_a() {
  // script for inventory2: Use inventory on this item
AddInventory (7) ;

LoseInventory (2) ;

LoseInventory (6) ; 
}


it says there's a problem, but i cant see it.
Title: Re: problem with quit gui
Post by: Ishmael on Wed 26/05/2004 14:14:22
nothing seems to be wrong there either... unless you just typed those into the global script, instead of using the interaction editor for the inventory items...
Title: Re: problem with quit gui
Post by: Chicky on Wed 26/05/2004 14:17:21
i used the interaction editor, The thing is when it says there's a problem the script opens on that part of the script.
Title: Re: problem with quit gui
Post by: Ishmael on Wed 26/05/2004 14:20:14
Can you copy the error message to show us?
Title: Re: problem with quit gui
Post by: Chicky on Wed 26/05/2004 14:38:30
(http://www.2dadventure.com/ags/dfhfdh.gif)

there ya go
Title: Re: problem with quit gui
Post by: Ishmael on Wed 26/05/2004 15:20:34
There's one or more } missing from the end of the fucntion before those.