scripting problem - skipping to 'else' (solved)

Started by Duzz, Thu 19/06/2003 09:52:21

Previous topic - Next topic

Duzz

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 =)
Powerhoof - My new indie games company! | Wintermute Studios - My older AGS games: The Historical League of Bouncy Boxing, Grr! Bearly Sane,  Duzz Quest...

SMF spam blocked by CleanTalk