Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: georgebbb on Sun 17/05/2009 17:10:08

Title: Make character keep head on same horizon line at all time
Post by: georgebbb on Sun 17/05/2009 17:10:08
Is there a way to make a character keep his head, when walking, on the same horizon line?

Instead of having him walk all over the place, ruining the perspective, I want him to walk like in Broken Sword.

Any way of doing this?
Title: Re: Make character keep head on same horizon line at all time
Post by: RickJ on Sun 17/05/2009 17:32:43
If you are asking how to setup walkable area scaling then you just need to enter the desired values in the property pane in the room editor.   I believe it is explained in the tutorial and the manual much better than I could possibly do here.
Title: Re: Make character keep head on same horizon line at all time
Post by: georgebbb on Sun 17/05/2009 18:44:52
Hello Rick,

I’m actually referring to the room perspectives horizon line.

Say you have a one point drawing of a room.
It has a single horizon line (the line the eyes are on).
The players head (more precisely his eyes) are supposed to always be on this line (except when he ducks or sits down).
In AGS the character moves al over the place, leaving this line and ruining perspective.

So I’m wondering if theirs a way to have a pivot on the characters head that never moves and have the body resize it self depending on where you are on the screen.
'If you’re in the foreground then the character sprite is big, but with the head pivot on the line, and if you move in the background, the sprite gets smaller, but again with the head pivot in the same place.

If you move sideways the sprite stays the same size.

If you have any ideas, please let me know.
Title: Re: Make character keep head on same horizon line at all time
Post by: RickJ on Sun 17/05/2009 21:06:41
I suppose if the walkable area scaling is setup properly this behavior could be achieved.
Title: Re: Make character keep head on same horizon line at all time
Post by: lostbuthappy on Sun 17/05/2009 21:28:45
Hi georgebb,
AGS comes with an extensive help file where the feature you're looking for is explained (Tutorial->Advanced Room Features->Character Scaling).
Title: Re: Make character keep head on same horizon line at all time
Post by: georgebbb on Wed 20/05/2009 11:59:29

Alright, didn’t make it clear so I made a sketch.

(http://farm4.static.flickr.com/3567/3548652118_a55ae91e81_o.jpg)

Is there a script for this?
If not, I’ll probably do it with scale and walkable areas.
Title: Re: Make character keep head on same horizon line at all time
Post by: Khris on Wed 20/05/2009 13:04:41
Like RickJ told you, this can be achieved using the walkable area's scaling.
You'll just have to calculate the right zoom factor for the lower and upper end.
I tested this using Roger:
With a horizon line at 140, a walkable area from 155 to 215 and scaling from 45 to 200, Roger's eyes lined up with the horizon line just fine.
Title: Re: Make character keep head on same horizon line at all time
Post by: georgebbb on Wed 20/05/2009 15:55:15
Alright, thanks guys
Title: Re: Make character keep head on same horizon line at all time
Post by: Khris on Wed 20/05/2009 16:01:37
Just to clarify: it's always possible to do manual scaling using a scripted function of some kind, but in this case, where a linear scaling will do the trick, it's easier to just use the built-in stuff.