ID:149983
 
My icons are really detailed and i don't want frames to be skipped if you use the arrows keys on the keyboard as macron. How do i make it that even if you have macro you can see all 3 frames when you walk, rather than missing some?
You'll find deeper problems than visual glitches if you allow people to access verbs and movement faster than ordinary input allows... the solution to both is to make a "minimum time elapsed" between one move and the next. There's various ways to do it... here's a rough mock-up of my favorite:

client/var/tmp/last_moved \\Make it a tmp var, because it shouldn't be saved.

client/Move()
if (world.time < last_moved + 3) return
last_moved = world.time
..()

This doesn't store actions in a queue, which makes it most appropriate for short delays where you want button-mashing or macroing to simply be lost. If less than 3 ticks have elapsed from the last time a movement was entered, it's ignored.
In response to Lesbian Assassin
Thanks, Lexy(is it ok if i call you this?)
In response to Gojira
Gojira wrote:
Thanks, Lexy(is it ok if i call you this?)

Maybe we should start calling her LesbyAnne now.
In response to Gojira
It's my name.
The slime (green team) in Halloween Tanks looked horrible if the move frames skipped, and the tanks move too fast to wait on the framerate, so I had to use a workaround. Play with the Tanks slime to see how it looks, if it meets your needs, and if it is worth the effort. :)


First, you'll have to forget about setting a movie as a movement state. It won't help at all. You could make an icon_state or a separate icon for the moving animation, depending on how you prefer to do it.

Assign a timer var to the mob, just like Lexy showed you for last_moved in her post above. You should use a separate variable from the movement timer, since this var just times the animation and doesn't care how many actual steps the mob has taken. The var should start at 0.

When the mob moves, compare world.time to the animation timer. If world.time is greater than the animation timer, then flick() the movement animation on the mob and set the animation timer equal to world.time plus the number of frames in the animation*.



* If you slowed the animation when you desinged it, you'll want to adjust the addend to reflect the number of ticks it actually takes to play the animation.
In response to Shadowdarke
The funny part is, that actuially makes sense :p
In response to Lord of Water
A new problem has arisen. I get all the Frames in but the mob walks to fast. What should i do?
In response to Gojira
Gojira wrote:
A new problem has arisen. I get all the Frames in but the mob walks to fast. What should i do?

Lexy gave you a way to slow the mob's movement in [link]
In response to Shadowdarke
And, it's also in the FAQ.
In response to Shadowdarke
Shadowdarke wrote:
Lexy gave you a way to slow the mob's movement in [link]

That was to allow all the frames to be seen without skipping any. The character still moves to fast for the frames to look realisitc.
In response to Gojira
No. That was to slow down a mob's actions, which would have the comparatively unimportant side effect of allowing all the frames in a sequence to be shown. As I told you in that post, you've got your priorities backwards if you only worry about macroers moving/attacking 20 times a second because you think it'll screw up your animations.
In response to Gojira
Gojira wrote:
Shadowdarke wrote:
Lexy gave you a way to slow the mob's movement in [link]

That was to allow all the frames to be seen without skipping any. The character still moves to fast for the frames to look realisitc.

As Lexy pointed out, that code doesn't do what you think it does.

Did you even read my post at [link]? I explained how to display all the frames independantly of movement speed. Using Lexy's code in [link] to slow movement, and the theory in [link] to play through the animations, you will have smooth movement that is slowed to a reasonable rate.

How many times do you want us to give you the same answers?
In response to Lesbian Assassin
Lesbian Assassin wrote:
No. That was to slow down a mob's actions, which would have the comparatively unimportant side effect of allowing all the frames in a sequence to be shown. As I told you in that post, you've got your priorities backwards if you only worry about macroers moving/attacking 20 times a second because you think it'll screw up your animations.


well that code allowed me to see all 3 frames but the walking speed remained exactly the same