Problem changing mouse mode (Solved)

Started by Spike4072, Sat 13/09/2008 10:04:36

Previous topic - Next topic

Spike4072

I wanted my Mouse mode to be pointer in the first room because it is my titile screen. Then after you leave that room I wanted it to change to Walkto so I added this in the script for the first room.

Code: ags
function room_Load()
{
  mouse.Mode = eModePointer;
}

function room_Leave()
{
  mouse.Mode = eModeWalkto;
}


The problem is it always sets it to Lookat in the next room. ???

Khris

Try putting mouse.Mode = eModeWalkto; in the next room's room_Load();

Spike4072

#2
I put it on leaving the title screen because of when you leave it by loading a save.

It changing to Lookat doesn't really hurt anything it is just annoying. I tried making it change to all the other mouse modes on leaving and they all worked fine. It looks like the only one with the problem is changing it to Walkto.

Makeout Patrol

Quote from: Spike4072 on Sat 13/09/2008 17:27:03
I put it on leaving the title screen because of when you leave it by loading a save.

It changing to Lookat doesn't really hurt anything it is just annoying. I tried making it change to all the other mouse modes on leaving and they all worked fine. It looks like the only one with the problem is changing it to Walkto.

I don't know this for sure, but I highly doubt that leaveroom() gets executed when you load a save. That has the potential to cause billions of horrible, game-breaking bugs.

Spike4072

#4
Hmm well how do other games do it then? ???

*edit* Ok I think I get it now. After making a test save I see that the save keeps track of what the mouse mode was so your right. There is no need to have it in the room_Leave function. I changed it to the room_FirstLoad on the starting room when clicking New Game and it seems to work fine now. Thanks for the help. :)

SMF spam blocked by CleanTalk