ID:122183
 
I was looking through some of my old demos and thought to myself, man, these are terrible. So I deleted them.

Macro Move, one of the deleted demos, was my first real attempt at making smooth diagonal movement using four directional keys rather than eight. It was far from perfect but it did the job for the most part. It was after reading this feature request that I decided to take another shot at it after having gained a bit more experience.

Simple Move is the result of that effort. I chose to build this as a library rather than a demo so users could drop it right into their game and have it working with minimal effort. The code itself should be fairly self-explanatory so I didn't bother cluttering it up with comments on every other line. I really don't like how comments can sometimes be needlessly long or wordy so I tried to keep everything simple and to the point. Hopefully anyone with at least a base level understanding of DM will be able to follow along quite easily.

There are three different movement types. DEFAULT is similar to the regular BYOND movement, only when holding two keys you will move in the direction of the key you pressed first. DIAGONAL will combine keys like NORTH and EAST to make you walk NORTHEAST. STRAFE will use movement similar to what's in Decadence where if you're walking NORTH and go to step EAST, your character will step NORTHEAST while still facing NORTH.

Simple Move is being released for free. You could donate if you'd like, but that's not necessary. If you notice any bugs or can't get it to work please let me know and I'll see what I can do.
Press and hold right arrow key then press the down or up key. When you let go of both you keep moving to the right and won't stop.
The arrow keys or WASD? I can't recreate that problem with either.
Arrow keys.
I'm mashing both WASD and the arrow keys yet it's not happening. Are you sure your keys just aren't getting stuck? Maybe your keyboard doesn't support certain button combinations.
It does it for me using WASD. If I push and hold D and then hit W & S at the same time while still holding D down I'm stuck heading east.
Shadow813 wrote:
If I push and hold D and then hit W & S at the same time while still holding D down I'm stuck heading east.

That's intended behavior. Pressing North+South will cancel each other out.
SuperAntx wrote:
That's intended behavior. Pressing North+South will cancel each other out.

I'm sure "stuck heading east" is not intended behavior. Once you let go of a key you should stop moving in that direction. Holding east, then north and/or south then letting go of north and south. Yes, north and south cancel each other but once you let go of east you still keep going.
MDC wrote:
I'm sure "stuck heading east" is not intended behavior. Once you let go of a key you should stop moving in that direction. Holding east, then north and/or south then letting go of north and south. Yes, north and south cancel each other but once you let go of east you still keep going.

What Shadow813 described was trying to walk North+South+East. North+South cancel each other out so there is no movement along the y axis. East on the other hand is free to move along the x axis.

Wait a minute, are you doing exactly what Shadow813 described? When you said "let go of both" did you mean let go on North/South and East or just North/South while holding East?

When you're "stuck" walking East are you...holding the East key?
SuperAntx wrote:
Wait a minute, are you doing exactly what Shadow813 described? When you said "let go of both" did you mean let go on North/South and East or just North/South while holding East?

When you're "stuck" walking East are you...holding the East key?

I meant let go of both the north and south keys, either at the same time or one after the other. Whether you're still holding east or not won't matter after that because you're going to keep walking east either way. The only way to stop is to hold west and when you let go of west you keep going east.
MDC wrote:
I meant let go of both the north and south keys, either at the same time or one after the other. Whether you're still holding east or not won't matter after that because you're going to keep walking east either way.

So when you're holding North+South+East you only let go of North+South?

This is crucial, I need to know.

When you are stuck walking East are you still holding the East key?
Yes only let go of North+South. When I'm stuck walking East I've done it both ways, still holding the East key and not holding the East key. It happens no matter if I'm still holding it or not.

Just tested the library again and I found out the bug can happen a lot easier than this. Just hold any key for a few seconds and when you let go you're stuck going in that direction.
I updated the lib, let me know if that fixed the problem.
As an expert in this field of movement, i can tell u when i first designed the system i too had that same bug and its at no fault of my code and probably not yours. There is a bug with the byond macro system when key+UP/key+DOWN where it will call either one of these commands twice if pressed in a certain way. So im going to assume u coded how i had done before using + movement for key down and - movement for key up. There is no way for this system to work with byond's macro system, there is another system that does work though if you want to see a demo message me and i'll host it.