Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Baron on Fri 26/03/2004 04:30:27

Title: Scrolling Rooms
Post by: Baron on Fri 26/03/2004 04:30:27
This seems like a simple problem so I have posted it here.
I want to have scrolling rooms in a game I am working on.  The manual says that to do this simply import wider background pictures than your game resolution and the option to have scrolling rooms will appear.  So I imported an 800 x 400 background into a 640 x 400 resolution game.  A message came up saying that the image was not the same resolution as the game and that all areas had been resized (I paraphrase, but the point is that it didn't prompt me like the manual said).
Undaunted, I created my walkable areas right across the room and tested it out.  The room does in fact scroll to the full dimensions (since it's not really much wider than 640), but the character can not walk to the far right end of the screen.  I've checked this out and it can not walk farther than the 640 x-coordinate.  All settings seem to indicate that the room is functioning at 800 x 400 -the only thing I can think of is that I missed the prompt.  So I made a duplicate room and the same thing occurred.  I have searched the manual and explored the room edit interface and have been unable to find a way to initiate this prompt -do you think this is even the problem?
Title: Re:Scrolling Rooms
Post by: Gilbert on Fri 26/03/2004 08:44:38
Hmmm are you using a custom made template or GUI or whatever?
In that case, open up the global script, and try to location something like (details may differ):

MoveCharacter(EGO,mouse.x,mouse.y);

and change it to:

MoveCharacter(EGO,mouse.x+GetviewPortX(),mouse.y+GetviewPortY());
Title: Re:Scrolling Rooms
Post by: Baron on Sat 27/03/2004 03:00:53
No, I made an all purpose icon for all interactions (including walking) in an attempt to make the game idiot proof (it's for young kids).  So I had under on_mouse_click in the global script:

if (button == LEFT){
  MoveCharacter (ZORK, mouse.x, mouse.y);
  ProcessClick (mouse.x, mouse.y, GetCursorMode());
}

(which I suppose I must have copied from the original walk mode and interaction mode scripts).  Your solution has solved the problem, though, -many thanks!
Title: Re:Scrolling Rooms
Post by: Gilbert on Mon 29/03/2004 03:20:19
Like I pointed out already, just change the line:
MoveCharacter (ZORK, mouse.x, mouse.y);

to:

MoveCharacter (ZORK, mouse.x+GetViewportX(), mouse.y+GetViewportY());
Title: Re:Scrolling Rooms
Post by: Baron on Mon 29/03/2004 17:28:35
Quote from: BaRoN on Sat 27/03/2004 03:00:53
Your solution has solved the problem, though, -many thanks!

Sorry if I was unclear.  It works great, thanks!  I was just leaving a record of what exactly I did wrong in case someone with a similar problem is perusing the technical boards (as I do when I get bored or stuck).  Thanks again!