Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Duzz on Thu 19/06/2003 09:52:21

Title: scripting problem - skipping to 'else' (solved)
Post by: Duzz on Thu 19/06/2003 09:52:21
I have the following code in my global script.
The problem is that the game skips to the final 'else' (last one in bold) ignoreing the other 'if's (also in bold).  But If I take out the final 'else' the other 'if' statements run fine, so I know they SHOULD be running...  Help!

function repeatedly_execute() {  // put anything you want to happen every game cycle here

 if (IsButtonDown(RIGHT)==0&&IsGUIOn(COIN)==1)  {  //if player releases right btn

   if (GetGUIObjectAt(mouseGUIx,mouseGUIy)==0) {
       GUIOff(COIN);
     Wait(1);
     SetMousePosition(mouseGUIx,mouseGUIy);
     ProcessClick(mouseGUIx,mouseGUIy, MODE_TALK);      
   }
   else if (GetGUIObjectAt(mouseGUIx,mouseGUIy)==1) {
     GUIOff(COIN);
     Wait(1);
     SetMousePosition(mouseGUIx,mouseGUIy);
     ProcessClick(mouseGUIx,mouseGUIy, MODE_USE);      
   }
   else if (GetGUIObjectAt(mouseGUIx,mouseGUIy)==2) {
     GUIOff(COIN);
     Wait(1);
     SetMousePosition(mouseGUIx,mouseGUIy);
     ProcessClick(mouseGUIx,mouseGUIy, MODE_PICKUP); //hurt      
   }
  else {
     GUIOff(COIN);
     Wait(1);  
     SetMousePosition(mouseGUIx,mouseGUIy);  
     ProcessClick(mouseGUIx,mouseGUIy, MODE_LOOK);
   }


   SetMouseBounds(0,0,0,0);
   GUIOff(CURSOR);
   ShowMouseCursor();
     
 }


I'm running the latest full release AGS, etc

EDIT:  Don't worry, I've figured it out, I had another gui on top of which I thought I had mad non-clickable, but I hadn'it....

sorry for the inconvenience =)