Hello everyone,
I've only started using the Adventure Game Studio a few days ago, and I'm sure that there is a simple solution to this problem but I can't find any documentation about it.
Upon clicking a button in my custom start menu (new game), the player is sent to a room using
player.changeRoom(4);
The menu itself is also a room, but with the player not showing in it (room options).
After clicking the button, however, the new room loads fine and the player is in it, but I can not use my mouse to walk around.
It only shows an "eye" (look at) mousepointer wherever I go with my mouse.
I did check if I set up the walkable area correctly, but that seems fine.
I added this code to the room:
function Intro1Click_AnyClick()
{
cEgo.ChangeRoom(3);
}
but it doesn't seem to recognise the "any click" event either.
Any ideas what I might be doing wrong?
Thanks in advance!
Paul-Luuk
IIRC, AGS disables the cursor mode for walking if you turn off the player character in a room. This will also make AGS switch to the next cursor mode in this case, since a disabled mode can't be the active one. The next one is "look at", the eye.
When you enter a room where the player character isn't disabled, the walk mode gets reactivated, but AGS doesn't switch back automatically.
However, it sounds like you have started with the default game template, so you can switch back to walking by right-clicking a few times, clicking the walk mode button in the bar at the top or pressing "w"(?) on the keyboard.
You can also add the room's "before fadein event", and in there, call "mouse.Mode = eModeWalkto;".
The anyclick event is triggered by all cursor modes except eModeWalkTo, afaik, so it should work with the eye cursor. If it didn't, the first thing is to check that you drew a proper hotspot, as in, a filled area while in Editing Hotspots mode. Also, the function has to be linked to the event. You didn't just type it into the script, right? You did create it in the events pane of Intro1Click?
Hey Khris,
Thank you for your reply!
I actually made the game from scratch, thinking I'd learn how to use AGS faster that way.
After reading your comment though, I had another look at the demo game and found that mouse clicks are not actually automatically processed, but need to be processed through a global script:
function on_mouse_click(MouseButton button) {
if (button==eMouseLeft) {
ProcessClick(mouse.x, mouse.y, mouse.Mode);
}
}
I was under the impression that clicks were processed automatically, so thanks for helping me find out what the problem was!
Cheers,
Paul-Luuk