Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Ghostlady on Thu 07/07/2011 01:50:47

Title: "Wait" Mouse Cursor Graphic
Post by: Ghostlady on Thu 07/07/2011 01:50:47
I am currently using a hourglass for my "wait" mouse cursor.  I would like to change that to a pointer when a speech gui is displayed.  How can I do this?  I tried this in my room repeat exec and it does not change.

    if(Mouse.Mode == eModeWait) {
      if (gGui3.Visible == true) {
          mouse.UseModeGraphic(eModeInteract); }}
Title: Re: "Wait" Mouse Cursor Graphic
Post by: Gilbert on Thu 07/07/2011 02:18:33
I'm not sure if this is the problem. Have you tried putting that in repeatedly_execute_always() instead?
I think when the game is in pause/wait mode repeatedly execute will stop running.
Title: Re: "Wait" Mouse Cursor Graphic
Post by: monkey0506 on Thu 07/07/2011 02:21:59
Gilbot's right here. It's explained in the manual..somewhere about blocking vs. non-blocking functions.

repeatedly_execute (and room_RepExec) are never called during blocking functions.

repeatedly_execute_always is called even during blocking functions (including dialogs depending on the option in the General Settings pane).

Edit: It's in the manual under Scripting > Understanding blocking scripts.
Title: Re: "Wait" Mouse Cursor Graphic
Post by: Ghostlady on Thu 07/07/2011 02:25:03
Ah.

Where is "repeatedly_execute_always"?
Title: Re: "Wait" Mouse Cursor Graphic
Post by: Khris on Thu 07/07/2011 02:51:43
Just create it in the global script:

function repeatedly_execute_always() {


}
Title: Re: "Wait" Mouse Cursor Graphic
Post by: Ghostlady on Thu 07/07/2011 03:03:10
I created it in the global script and it still is not changing the graphic.
Title: Re: "Wait" Mouse Cursor Graphic
Post by: Gilbert on Thu 07/07/2011 03:08:26
Depending on what template you started making your game from. If you're using the default game template the function should already appear in the global script, so add the codes there instead of creating a new one (it would be odd that the compiler did not complain about this though) if this is the case.

However, as you mentioned you put this in the room script originally, where do you want this to happen? If you want the behaviour for the whole game then yeah just put the codes in the function in the global script, but if you really only want it for a certain room, create that function in the room's script instead.
Title: Re: "Wait" Mouse Cursor Graphic
Post by: Ghostlady on Thu 07/07/2011 03:15:01
It is not working in either place.  Room script or global.
Title: Re: "Wait" Mouse Cursor Graphic
Post by: Gilbert on Thu 07/07/2011 03:21:47
I'm not sure about the reason. Maybe during pause mode the engine will force display the Wait cursor.
You may try changing the graphics of the cursor in pause mode altogether and see if that works:

if(Mouse.Mode == eModeWait) {
     if (gGui3.Visible == true) mouse.ChangeModeGraphic(eModeWait, mouse.GetModeGraphic(eModeInteract));
     else mouse.ChangeModeGraphic(eModeWait, slot1);
 }

Where slot1 is the original graphic slot for the wait mode.
Title: Re: "Wait" Mouse Cursor Graphic
Post by: Ghostlady on Thu 07/07/2011 03:50:58
Sorry, but this doesn't work either. :(