ID:115630
 
Applies to:Dream Seeker
Status: Open

Issue hasn't been assigned a status value.
Ok imagine a game where you shoot guns. I have such a game. The problem is that when your holding down a movement macro, then you hold down a shoot macro, your movement stops until you release the macro.

This means that your character can not run and shoot at the same time. Every time they want to shoot they must stand still. This is very lame. Please change it. I don't think any macro should halt the movement macros unless the coder makes that action do so in Move() or something.

Thanks.
The default controls might not do what you're asking for, but it's certainly possible to do this yourself. I'm not sure if Macro Move will handle this. The default movement works by having keys repeat while they're held down, but you can define macros for when the arrow keys are pressed and released. Your program can remember which keys are held down and make the player move accordingly. Because it doesn't rely on the macro repeating, the movement won't be interrupted by another key press.
Seems like it'd be perfectly easy, and at the same time a worthwhile improvement to BYOND, if they just coded it to allow multiple repeating macros at once. Like every other game engine.
You probably can't ever have multiple repeating macros at once. Open up a word processor and hold down two keys at the same time - what happens? Your computer automatically makes the key that you're holding repeat but it only does this for one key. If you hold down one key, then a few seconds later hold down a different key (without letting go of the first), the second key will repeat.

You can easily use key press and release events to remember that a key is pressed and perform an action while it's being pressed. You don't need to use a repeating macro to do this:

mob
var
holding_key = 0
verb
KeyDown()
holding_key = 1
KeyUp()
holding_key = 0
proc
loop()
spawn()
while(1)
if(holding_key)
// do something
sleep(1)


My Sidescroller library does this so a player can run to the right, press the jump key, and keep moving to the right.
One caution worth mentioning is that certain key combinations won't work well on generic keyboards. I believe you can mix and match the arrow keys without trouble, and any modifiers like Ctrl and Shift should be fine, but hold down too many letter keys at once and you could surpass the keyboard's ability to read the keystate correctly. Users with gaming keyboards won't have this problem, but be sure to plan your macros around regular users.
After moving diagonally for a second and releasing one direction, I seem to keep moving diagonally for another half-second before moving cardinally. This is at 60fps.
mob
icon = 'mob.dmi'
bound_width = 24
bound_height = 24
step_size = 4

turf
icon = 'turf.dmi'

world
maxx = 25
maxy = 25
fps = 60

Is it because of queueing commands?

I also noticed that with a fps lower than 25 (24 and lower) dual-keys aren't registered at all.
I didn't test as high as 60 fps, where the repeat could be simply suffering from imprecision.

Unfortunately I do see the problem you mean at 10 fps. Crap.
This feature seems to have completely messed with my game's movement. It uses no pixel movement.

It's just made everything... inaccurate?
Previously, players make a 'wave' of projectile fire by pressing, for example:

Down.
Left.
Fire.
repeat.

Resulting in a line of projectiles. With this new system, it just sort of, leaves out lines randomly.
Even with this feature implemented, it's still better to use a loop.
Reopening this issue, as the feature in question has been backed out.
Think we could bring some light to this feature again? Whatever it was...