The issue is:
When characters walk from point A to point B (say one character is walking to another character) AGS takes your move character code and tells the bottom coordinates of one image to move to the bottom coordinates of the other image right? (if the character was a human who had feet then the general area of the "bottom coordinates" would be where the characters feet are) Everyone still with me?
I hope so ... so anyway - what we have happening is character a walks to character b's position and stops when character a's feet touch character b's feet - maybe that cleared it up for anyone i lost.
well my issue is this ... i dont need ags to take the bottom right corner of the image and move it to a destination ... i want it to take the top center of the image and move it to the destination. does that make sense? i sure hope so cus i need to figure this out .... help ... please .... pretty please.
For the record AGS moves the bottom centre of the sprite to the Walk co-ordinates.
This is difficult for me to solve without knowing exactly what effect you're trying to achieve. You could try giving the character a z property that is negative half of its sprite's height, in order to move the "feet" halfway up the sprite. Or, when you give the Walk command, add half the height of the sprite to the y co-ordinate. Then when it moves the centre of the sprite will end up where you clicked.
So:
ViewFrame *frame = Game.GetViewFrame(cEgo.NormalView, 0, 0);
//And then:
cEgo.z=(0 - (Game.SpriteHeight[frame.Graphic] / 2));
//Or alternately:
cEgo.Walk(100, 100+(Game.SpriteHeight[frame.Graphic] / 2));
That, uh, that would work, right?
Quote from: AdamM on Wed 09/06/2010 00:13:28
So:
ViewFrame *frame = Game.GetViewFrame(cEgo.NormalView, 0, 0);
//And then:
cEgo.z=(0 - (Game.SpriteHeight[frame.Graphic] / 2));
That, uh, that would work, right?
where would you put that? in Room Load?
Well, if you want your character to be centred in every room, game_start() is a better one.
Since you want the top center at the clicked coordinates, don't divide by 2.
Oh yes, sorry. I have trouble with big words.