Un-animated keyboard-controlled character[SOLVED]

Started by Colxfile, Wed 06/07/2005 16:09:03

Previous topic - Next topic

Colxfile

I've been playing with a-v-o's keyboard control script as found here. The player character walks under the direction of the keyboard, but I've hit a small problem. The player character doesn't appear to be animated when he walks around the area.

My walking views for my character comprise two frames for each of the four directions. (Eg Frame A and Frame B for the U/D/L and R views) When the player is standing and doing nothing, frame A appears. When the player walks around, only frame B is displayed, rather than A then B then A then B etc...

I have some ideas why this could be happening:
* Perhaps the animation is taking place so fast that I don't see it?
** Or perhaps because the script for the movement is in the repeatedly_execute() block, does this mean that the animation is started, but immediately stopped and started again when the script is run each time?
*** Something elseÃ,  ???

I don't think that * is the problem, as I've slowed the game speed down, sped it up and done the same with the animation speed, all to no avail. This leaves options 2 and 3...

Does anyone have any ideas? Or a good workaround? Or both? Please?Ã,  ;D
Always carry a UV marker pen with you. When you go to a shop or a friend's house, if you see something you like, put your name and postcode on it. If it gets stolen and subsequently recovered, the police will get in touch with you so that they can 'return' it.

Ashen

#1
The first frame of a direction loop is the 'standing' frame, it's not played during the animation. Try changing them to A-B-A instead of A-B.

QuoteOr perhaps because the script for the movement is in the repeatedly_execute() block, does this mean that the animation is started, but immediately stopped and started again when the script is run each time?
This is also possible - I'm not familiar enough with the script to say. Try my suggestion first, though.

EDIT: Looking at the code, it only runs when the direction (i.e. which key is pressed) is changed, so this isn't likely to be the problem.
I know what you're thinking ... Don't think that.

Colxfile

Okay, I've tried using an A-B-A walking view and now my character does indeed appear to walk when he is walking.  ;D Thanks!
Always carry a UV marker pen with you. When you go to a shop or a friend's house, if you see something you like, put your name and postcode on it. If it gets stolen and subsequently recovered, the police will get in touch with you so that they can 'return' it.

SMF spam blocked by CleanTalk