Character walking step by step?

Started by A-Hed, Wed 02/03/2005 18:26:10

Previous topic - Next topic

A-Hed

Ok, this is my first post in any of technical threads. I was wondering if it is possible to script so that my maincharacter is walking one step at a time without stopping in the middle of any of the steps depending on where I clicked for him to walk.

For example: if I want the character to walk to the other side of a table then this script should calculate so that he comes as close as possible to the point where I clicked without him stopping during a step (unless if he must turn to some direction and continue walking).

Is this possible to script? If it isnt, is there another way around this problem?

Pumaman

I'm not really sure what you mean. In what way is he currently "stopping during a step"?

Chicky

What he means is he wants it so when the character gets to the spot where the player clicked he will have finished atleast one full cycle of the walking animation and will end on the last frame of that cycle. He doesnt mind if the character goes over the exact spot where the player clicked a little as long as the animation has a chance to get to the end of the cycle.

Currently if you have a 6 frame walk cycle, and the character reaches the place where the player clicked on frame 3 then the character sprite will suddenly go to the standing frame for the character.

Ahed wants the character to have a chance to finish the walk cycle up to frame 6 and THEN go to the standing frame, thus meaning that the character may have to go slightly over where the player clicked in order to finish the cycle.

Rui 'Trovatore' Pires

Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

A-Hed

Thanks Rui! I will try what YOke said, thanks to Chicky also for making making clear of what I was asking for.  :)

YOke

You know where I'm at, so just give me a shout if you're stuck. ;)

Enlightenment is not something you earn, it's something you pay for the rest of your life.

Pumaman

Ah, ok, thanks for the clarification.

Well, it's not all that simple to do since the character's path is only calculated up to the destination point, so it would have to extrapolate a new path to continue moving him.

And what would happen if the character ran up against a non-walkable area mid-cycle? Would the animation continue and "animate on the spot" until the standing frame came round?

Gilbert

Quote from: Pumaman on Thu 03/03/2005 19:04:19
Would the animation continue and "animate on the spot" until the standing frame came round?
I think that's what should happen, the logic is when the character stopped moving, check whether the loop reaches the last frame yet, if not AnimateCharacter() from the current frame to the end then back to standing frame (unless you move him again or call other character graphics related functions before the animation stops).
I don't know if this is easy to implement or not, but I think it may be made a game option.

SMF spam blocked by CleanTalk