When I run the game and mouse over it, my cursor disappears so I cannot click anything.
How do I solve this?
In the Editor, in mouse, do you have a cursor sprite/view specified for the modes you are using?
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.
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:
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.
Quote from: Crimson Wizard on Tue 31/08/2021 19:05:36
Mouse.DisableMode(); // this disables everything first
This line is causing this error: "Not enough parameters in call to function"
How do I fix that?
It should be "Mouse.DisableMode(i);"
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?
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
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.
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
(or just set the same image for all cursor modes)
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.
Indeed; I'd use a dedicated image for eModeInteract and a small red X or whatever for the other modes.