Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Slasher on Sat 04/05/2013 10:17:14

Title: Mouser Mode Wait issue..
Post by: Slasher on Sat 04/05/2013 10:17:14
Hi

this issue has been raised before (by strazer) quite some time ago I am unable to resolve at the moment. Hopefully some light can be shed to fathom out why and provide a solution.

With character 'Say' the cursor changes to Wait Mode yet when player is Walking in eBlock the cursor does not change to Wait mode but rather Interact after Interacting with an object.

I believe this code was mentioned in the post:

Code (AGS) Select

if ( ! IsInterfaceEnabled() )
{
mouse.Mode = eModeWait;
}


Problem is, though it works, it becomes a cursor Wait mode afterwards along with the other normal Mouse cursor modes.

Without having to put lots of script here maybe you can systematically see where the problem may lie?

Cheers for all help / assistance


Title: Re: Mouser Mode Wait issue..
Post by: Khris on Sat 04/05/2013 10:54:29
I did a quick test in a fresh Default Game and can't confirm this. The cursor changes to eModeWait during the blocking walk for me, as expected.

Are you using any modules or templates, or did you change a related game option or anything like that?

Also, for the code you posted to work, it has to be inside repeatedly_execute_always, since repeatedly_execute isn't called during blocking events.
(You didn't link to strazer's topic or tell us where you put that code though, so I'm just guessing here. I love solving problems with insufficient info though, so that's fine.)
Title: Re: Mouser Mode Wait issue..
Post by: Slasher on Sat 04/05/2013 11:29:42
Well Khris,

Default game will run ok, as it should, so it must be a script entry in Global that stops it from implementing as it should.

I'm not sure which part of the script is stopping it.

The Wait cursor is sprite 316, View=18.

Here is the entire Rep Exe Always in Global (unless problem is eleswhere?):
(I'll get the rather large mallet out ready ;))

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.
   
  // Button32.Animate(15, 0, 2, eRepeat);
   
  gfakeicon.Clickable=false;
  LScore.Text = String.Format("Rip pieces: %d of 7", note_piece);
  Lfilmleft.Text = String.Format("%d seconds", FilmTime);

GUI* theGui = GUI.GetAtScreenXY(mouse.x, mouse.y);
if (theGui == gStatusline && mouse.Mode != eModePointer)
{
old_mode=mouse.Mode;
mouse.ChangeModeGraphic (eModePointer, 2061);
mouse.Mode = eModePointer;
}

//WORKS OVER ICONBAR
GUIControl *gcat = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
if ((gcat == null) || (gcat.AsButton == null)) mouse.UseDefaultGraphic();
else mouse.UseModeGraphic(eModePointer);
{
if (theGui != gStatusline && mouse.Mode == eModePointer && mouse.GetModeGraphic(eModePointer) == 2061)
{
  mouse.Mode=old_mode;
 
}
  if (gSaveGame.Visible || gRestartYN.Visible ||gRestoreGame.Visible || gPanel.Visible)
{
   mouse.Mode = eModeInteract;
   mouse.Mode = eModePointer;

}

  //SEEMS TO WORK
if (gInventory.Visible==true && mouse.ChangeModeGraphic(eModeUseinv,2057 ))
{
     mouse.Mode = eModeUseinv;
}

// TO DISABLE CP SAVE RESTORE

if (gfilms.Visible==true || gletter.Visible==true ||  gmemory.Visible==true)
{
   gIconbar.Visible=false; 
   gStatusline.Visible=false;
   gSaveGame.Visible=false;
   gRestoreGame.Visible=false;
   gPanel.Visible=false;
   mouse.Mode = eModeInteract;
   mouse.Mode = eModePointer;

}

  if (cFrankj.Room==2 && gPasswordGUI.Visible==true)
{
   
   mouse.DisableMode(eModeLookat);
   mouse.DisableMode(eModeTalkto);
   mouse.DisableMode(eModeWalkto);
   gStatusline.Visible=false;
   gIconbar.Visible=false;
   mouse.Mode = eModeInteract;
   mouse.UseModeGraphic(eModePointer);
 
}
 
   // BOOK PIECES BUTTON GRAPHICS

  if(note_piece==1)
{
   Button1.Visible=true;
   Button1.NormalGraphic=171;
   note1=false;
 
}
else if (note_piece ==2)
{
   
   Button2.Visible=true;
   Button2.NormalGraphic=172;
   note2=false;
 

}
else if (note_piece ==3)
{
   
   Button3.Visible=true;
   Button3.NormalGraphic=173;
   note3=false;
}
else if (note_piece ==4)
{
   Button4.Visible=true;
   Button4.NormalGraphic=174;
   note4=false;

 
}
else if (note_piece ==5)
{
   
   Button5.Visible=true;
   Button5.NormalGraphic=175;
   note5=false;
}
else if (note_piece ==6)
{
   Button6.Visible=true;
   Button6.NormalGraphic=176;
   note6=false;
 
}
else if (note_piece ==7)
{
  Button7.Visible=true;
  Button7.NormalGraphic=177;
  note7=false;
 
}
else if (note_piece ==8)
{
  Button8.Visible=true;
  Button8.NormalGraphic=178;
  note8=false;
}
   
  // CHANGE MOUSE MODE FOR GLETTER AND GFILMS

  if (gletter.Visible==true || gfilms.Visible==true)
{
   gIconbar.Visible=false; 
   gStatusline.Visible=false;
   mouse.ChangeModeGraphic(eModeInteract, 2057);
}
 
  // FILMS TAKEN NOT TAKEN
 
  if (Button12.Visible)
{
       Lfilms.Text=("Films you have taken");

}
  else
{
   Lfilms.Text=("You have not taken any film");
}
  Button30.X = cFrankj.x/7;
  Button30.Y = cFrankj.y/5;
}

}


cheers



Title: Re: Mouser Mode Wait issue..
Post by: Slasher on Sat 04/05/2013 12:13:26
I have the feeling it could involve these  (roll):

Code (AGS) Select
GUI* theGui = GUI.GetAtScreenXY(mouse.x, mouse.y);
if (theGui == gStatusline && mouse.Mode != eModePointer)
{
old_mode=mouse.Mode;
mouse.ChangeModeGraphic (eModePointer, 2061);
mouse.Mode = eModePointer;

//WORKS OVER ICONBAR
GUIControl *gcat = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
if ((gcat == null) || (gcat.AsButton == null)) mouse.UseDefaultGraphic();
else mouse.UseModeGraphic(eModePointer);

}

if (theGui != gStatusline && mouse.Mode == eModePointer && mouse.GetModeGraphic(eModePointer) == 2061)
{
  mouse.Mode=old_mode;
}



EDIT:

Taking this out makes it work ok but then cursor does not turn into pointer over giconbar!

Code (AGS) Select
//WORKS OVER ICONBAR
GUIControl *gcat = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
if ((gcat == null) || (gcat.AsButton == null)) mouse.UseDefaultGraphic();
else mouse.UseModeGraphic(eModePointer);


EDIT: I have gone another way about doing this so this post is no longer valid.