Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: jamesreg on Wed 08/01/2014 19:56:06

Title: Custom mouse cursors not working
Post by: jamesreg on Wed 08/01/2014 19:56:06
I have created extra mouse modes via the side panel under mouse cursors
I have a total of 12 mouse cursors in addition to the standard ones.
However new ones I have created seem not to be picking up in AGS.
I have clicked the pull down menu that says make this cursor a standard cursor.

I know I am missing something simple here.

The mouse cursor in question is Mode12  which is named Close "eModeClose"
Title: Re: Custom mouse cursors not working
Post by: Ghost on Wed 08/01/2014 21:56:58
Quote from: jamesreg on Wed 08/01/2014 19:56:06
However new ones I have created seem not to be picking up in AGS.

How are you setting the mouse modes? Do you use "cycling" with the Mouse.SelectNextMode() command, or are you setting the mode with mouse.Mode == ? Are you using a template?
I am asking because technically your setup should allow you to set modes as you see fit.
Title: Re: Custom mouse cursors not working
Post by: jamesreg on Wed 08/01/2014 22:51:30


no thats not it im doing mouse.Mode = eModeInteract;
just like that
Title: Re: Custom mouse cursors not working
Post by: Khris on Thu 09/01/2014 00:30:58
I think I know what the problem is; you're looking for additional events and wondering why they won't appear.

AGS only supports the events already listed when you create a game; to process additional cursor modes, use the Any click / other click event, and in the code, check mouse.Mode:

Code (ags) Select
function hDoor_AnyClick() {
  if (mouse.Mode == eModeClose) {
    ..
  }
}
Title: Re: Custom mouse cursors not working
Post by: jamesreg on Thu 09/01/2014 03:40:26
Hmm Interesting I did not know this.
Its wierd some of the custom ones I created appear in the menus and stuff maybe they are ones I renamed or something.
Great ill try it like you said and see if that does the job got to head off to work right now though.

Thanks again for saving the day I hate little things like this that are so simple but make you pull you hair out lol.
Title: Re: Custom mouse cursors not working
Post by: Khris on Thu 09/01/2014 04:01:11
Yeah, you can rename the default cursors and the event names will change accordingly.
Also note that some cursors have hard-coded special behavior, like the walk, wait or useinv cursor.

It sounds like you're creating a GUI with lots of verbs, like Maniac Mansion's. A better approach might be to store the selected action in a variable and use the interact event for all of them. That's what the 9 verb GUI does. For one, you'll only have one function for each hotspot and object, and you can also more easily give a generic message in case an action is unhandled.
Title: Re: Custom mouse cursors not working
Post by: jamesreg on Thu 09/01/2014 04:48:24
I never looked at the 9 verb thing before cause I had never been interested in a doing a game like this before so I hadnt been as familar with that part of the engine.Thanks for pointing me in the right direction.
Title: Re: Custom mouse cursors not working
Post by: selmiak on Thu 09/01/2014 12:29:10
Quote from: jamesreg on Wed 08/01/2014 19:56:06
I have a total of 12 mouse cursors in addition to the standard ones.

It is probably good coding practise to get this working, but from a players point of view I have to say I hate cycling through 3-4 mousemodes already. If you have some kind of lucas arts verb interface that is always visible to select the mousemodes or a verbcoinlike interface that could still work without annoying the player. Or add some keyboard shotcuts to quickly change mousemodes. Just my 2cents...