Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Alynn on Sat 20/12/2003 18:19:02

Title: Don't automaticly move character in walk mode
Post by: Alynn on Sat 20/12/2003 18:19:02
Ok, I have to have this option turned on for a few special movements (like when the character walks from the first to the second floor in my first room). Walking is accomplished with this script
if (GetCursorMode()==0){
     MoveCharacter(0, mouse.x, mouse.y);
   }
   else {
     ProcessClick(mouse.x, mouse.y, GetCursorMode());
   }


This works except for my scrolling rooms, which he will only walk so far into the screen (im assuming at 240 pixels) is there a way to turn that off for some rooms, or anyone know of a better work around than what I am using?

Thanks.
Title: Re:Don't automaticly move character in walk mode
Post by: Scorpiorus on Sat 20/12/2003 18:36:11
You see, the mouse.x/y ranges are within (0,319) (0,239) but in a scrolling room coordinates may be greater:

if (GetCursorMode()==0){
MoveCharacter(0, GetViewportX()+mouse.x, GetViewportY()+mouse.y);
}
else {
ProcessClick(mouse.x, mouse.y, GetCursorMode());
}

~Cheers
Title: Re:Don't automaticly move character in walk mode
Post by: Alynn on Sat 20/12/2003 19:33:06
Horray... I kept looking just couldnt figure that one out...

*Warning memory capacity is full*

Time to make more room, lets see, wife's birthday and aniversery date, I dont need those...

/me Shift+Del's