Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Volcan on Mon 01/07/2013 17:55:20

Title: LOL - AGS likes walking icon (Solved)
Post by: Volcan on Mon 01/07/2013 17:55:20
AGS keeps showing walking icon with my custom Quit gui.

Code (AGS) Select
if (keycode == eKeyCtrlQ){
mouse.UseModeGraphic(eModePointer);
gQuitter.Visible = true;   // Ctrl-Q
}

Title: Re: LOL - AGS likes walking icon
Post by: Khris on Mon 01/07/2013 20:14:37
Try:
Code (ags) Select
  mouse.Mode = eModePointer
Title: Re: LOL - AGS likes walking icon
Post by: Volcan on Mon 01/07/2013 20:38:22
I tried:

Code (AGS) Select
if (keycode == eKeyCtrlQ){
   mouse.UseModeGraphic(eModePointer);
   mouse.Mode = eModePointer;
   gQuitter.Visible = true; // Ctrl-Q
}


The walking cursor still appears.

But the code I just found works fine. See bellow.

Code (AGS) Select
function repeatedly_execute_always() {
 
  // Put anything you want to happen every game cycle, even
  // when the game is blocked inside a command like a
  // blocking Walk().
  // You cannot run blocking commands from this function.
if (IsGUIOn(9)){
  mouse.UseModeGraphic(eModePointer);
}
}


Maybe there is an easier way to do.
Title: Re: LOL - AGS likes walking icon
Post by: Ryan Timothy B on Tue 02/07/2013 01:45:22
This doesn't change the cursor to eModePointer:
     mouse.UseModeGraphic(eModePointer)

What that's doing is changing the current mode's graphic to the graphic of eModePointer.

Are you sure there isn't something in your script that's changing the mouse mode to eModeWalkto?
Title: Re: LOL - AGS likes walking icon
Post by: Volcan on Tue 02/07/2013 15:25:33
Thanks Ryan.

Here a new code.
Code (AGS) Select
function repeatedly_execute_always() {
  // Put anything you want to happen every game cycle, even
  // when the game is blocked inside a command like a
  // blocking Walk().
  // You cannot run blocking commands from this function.
  if (gQuitter.Visible) mouse.Mode = eModePointer;
}
Title: Re: LOL - AGS likes walking icon
Post by: Volcan on Wed 03/07/2013 02:45:52
My new code works fine.

Thanks to everybody.
Title: Re: LOL - AGS likes walking icon (Solved)
Post by: Khris on Wed 03/07/2013 08:27:25
Ok, so you're forcing AGS back into eModePointer. Sure, that will work. But it's always better to fix the original problem, instead of patching over it like that.
In some repeatedly_execute of yours, the pointer is changed to eModeWalkto, presumably because GetLocationType() returns eLocationNothing.