Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: xenogia on Tue 13/04/2010 23:09:44

Title: Creating walkable outside of room's co-ordinates?
Post by: xenogia on Tue 13/04/2010 23:09:44
There are points in my game where the character needs to be cut off and much lower than the room's co-ordinates require.  For example because it is only showing the character waist up it is very difficult to make a walkable area cause you can't do it in the editor.

An example of this is that his x co-ordinate is around 700, trouble is the room is only 640x400.  How would I go about making a walkable area.

I hope this made sense..
Title: Re: Creating walkable outside of room's co-ordinates?
Post by: GarageGothic on Tue 13/04/2010 23:19:22
The easy solution is simply to make the room 640x700 and lock the viewport so it doesn't scroll to follow the character (at least not vertically). This is probably the easiest if the sub-viewport area has different scaling/lighting than the walkable area at y=400.

Otherwise another solution would be to use a negative Character.z value to offset him vertically, but this would have to be done through scripting and whenever the character moves in sub-viewport space.
Title: Re: Creating walkable outside of room's co-ordinates?
Post by: xenogia on Tue 13/04/2010 23:22:03
I found some stuff on viewport in the AGS Manual, but from what I can see they are only read-only.  How do I go about changing the viewport.  I also try the Character.z value and see what I can come up with also :)

EDIT: Eventually found the command

SetViewPort (x,y);

Excellent, I'll try this out later on and see what I can come up with :)
Title: Re: Creating walkable outside of room's co-ordinates?
Post by: Khris on Tue 13/04/2010 23:48:40
I think GG misread your post; you want the character to walk off the right edge (x=700), right?

First of all, obviously you can't have walkable areas outside the room's dimensions.
Character.z can only be used to move them vertically, so that's not usable here either.

Like GG said, extend the room.
To prevent a 700x400 room from scrolling into the extra 60 pixels on the right, in its before fadein, call
  SetViewport(0, 0);
This stops automatic scrolling until ReleaseViewport() is called.
Title: Re: Creating walkable outside of room's co-ordinates?
Post by: xenogia on Tue 13/04/2010 23:59:18
Here is a screenshot of the room in question.

(http://pic.leech.it/i/cee82/3ba9144scn.jpg)

From there I want the character to move left and right and up and down.   So I am guessing all it really needs is the SetViewPort (0,0) and instead of making the room the standard 640x400 make it 640x700.
Title: Re: Creating walkable outside of room's co-ordinates?
Post by: GarageGothic on Wed 14/04/2010 00:15:05
Quote from: Khris on Tue 13/04/2010 23:48:40I think GG misread your post; you want the character to walk off the right edge (x=700), right?

True, I did misread it - though looking at the screenshot it seems Xenogia meant y=700, no?
Title: Re: Creating walkable outside of room's co-ordinates?
Post by: xenogia on Wed 14/04/2010 00:21:57
Ahh my apologies, it was 7.30am in the morning.. My head wasn't screwed on straight.. lol