Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Anralore on Tue 31/08/2021 13:51:45

Title: Cannot see Cursor
Post by: Anralore on Tue 31/08/2021 13:51:45
When I run the game and mouse over it, my cursor disappears so I cannot click anything.

How do I solve this?
Title: Re: Cannot see Cursor
Post by: eri0o on Tue 31/08/2021 14:48:33
In the Editor, in mouse, do you have a cursor sprite/view specified for the modes you are using?
Title: Re: Cannot see Cursor
Post by: Anralore on Tue 31/08/2021 15:44:04
Quote from: eri0o on Tue 31/08/2021 14:48:33
In the Editor, in mouse, do you have a cursor sprite/view specified for the modes you are using?

No, how do I do that? I am making an FMV game so I just need a cursor to click stuff not: "walk to" or "look at" or "Pick up" and so on.
Title: Re: Cannot see Cursor
Post by: Crimson Wizard on Tue 31/08/2021 19:05:36
I may forget some details, but iirc AGS begins with "walk to" cursor unless template or your script changes that.

In your case I'd suggest to disable all the cursor modes but the one you need at the very start of the game, in the function "game_start" in GlobalScript, like:
Code (ags) Select

for (int i = 0; i <= eModeUsermode2; i++) {
   Mouse.DisableMode(i); // this disables everything first
}
Mouse.EnableMode(eModePointer); // enables one you need, use whatever mode you like to use, eModePointer, eModeInteract etc


Then make sure that in "on_mouse_click" function you do not have "Mouse.SelectNextMode()" or similar commands (this is present in "Sierra" template).

This will fix your game on one cursor mode, and you'll only have to provide graphic for it.
Title: Re: Cannot see Cursor
Post by: Anralore on Tue 31/08/2021 20:01:35
Quote from: Crimson Wizard on Tue 31/08/2021 19:05:36
Code (ags) Select
Mouse.DisableMode(); // this disables everything first

This line is causing this error: "Not enough parameters in call to function"

How do I fix that?
Title: Re: Cannot see Cursor
Post by: Crimson Wizard on Tue 31/08/2021 20:06:06
It should be "Mouse.DisableMode(i);"
Title: Re: Cannot see Cursor
Post by: Anralore on Tue 31/08/2021 20:14:55
Quote from: Crimson Wizard on Tue 31/08/2021 20:06:06
It should be "Mouse.DisableMode(i);"

Now the mouse will appear if I right click first?

Which mouse triggers hot spots?
Title: Re: Cannot see Cursor
Post by: Crimson Wizard on Tue 31/08/2021 21:42:45
Quote from: Anralore on Tue 31/08/2021 20:14:55
Now the mouse will appear if I right click first?

Maybe you should also add
Code (ags) Select

mouse.Mode = eModePointer;

after calling Enable.

But if it appears after right click - this could mean that you still have an unnecessary code in your script that changes cursor mode on right click.

What template did you use to create your game? If you are making a FMV game, I'd suggest "BASS" template, because it already does all this cursor setup.

Quote from: Anralore on Tue 31/08/2021 20:14:55
Which mouse triggers hot spots?

Hotspots, and everything else, have several events. For example, you could use either "interact" or "any click", which correspond to "eModeInteract" and "eModePointer" respectively.
Title: Re: Cannot see Cursor
Post by: Khris on Wed 01/09/2021 01:18:31
If you started with an empty game, there are no sprites. Therefore the cursor will be invisible.
For a 1st person game you should probably use the interact mode for everything; this means you should

1. remove  mouse.SelectNextMode();  from the right button block in the global script's on_mouse_click function
2. add  mouse.Mode = eModeInteract;  inside the global script's game_start function
3. assign a sprite to the Interact cursor in the Project tree
Title: Re: Cannot see Cursor
Post by: eri0o on Wed 01/09/2021 03:19:08
(or just set the same image for all cursor modes)
Title: Re: Cannot see Cursor
Post by: Crimson Wizard on Wed 01/09/2021 03:34:01
Quote from: eri0o on Wed 01/09/2021 03:19:08
(or just set the same image for all cursor modes)

I think this may make it harder to notice that something is wrong, for example that game or player switched to a wrong cursor mode which is not supposed to be used in the game.
Cursor will look the same, but player's clicks won't work or work differently; such situations are more difficult to diagnose.
Title: Re: Cannot see Cursor
Post by: Khris on Wed 01/09/2021 09:22:44
Indeed; I'd use a dedicated image for eModeInteract and a small red X or whatever for the other modes.