ID:158577
 
I need to be able to somehow check if 2 direction macros are being held at once, so that I can enable diagonal movement by holding down Left+Down for instance in client/North()/South() etc.

All I need to do is check if a key is being pressed. For example using this fake proc it might look like this:

client/North() mob.Determine_Move()
client/South() mob.Determine_Move()
//And so on as above, for all directions.
mob/proc/Determine_Move()
if(!Can_Move) return
if(Key_Down("South")&&Key_Down("West"))
step(src,SOUTHWEST)
else if(Key_Down("North")&&Key_Down("West"))
step(src,NORTHWEST)
else //And so on
Well you could have a var that toggles itself when the buttons are held down and stop being held.

Then have a verb for each.

SOUTH+DOWN
SOUTH+RELEASE (I think that's how they're called in the macro window)

mob/verb/south_down()
southdown=1
mob/verb/south_release()
southdown=0


Just an example of how I'd probably do it.
Have a single variable that holds the direction that you are currently pressing. On both keyup and keydown, ^= the appropriate direction with the current direction. ^ is the binary XOR (exclusive or) operator, which will turn the appropriate bit on if it's off and off if it's on. Each cardinal direction is one bit, so this works perfectly. Like so:

client
var/tmp/movedir = 0
North()
movedir ^= NORTH


Alternatively, route every direction key into one command and give it an argument for the direction.

Anyway, that will give you a valid direction. Note that you might get something silly if somebody mashes keys, like NORTH|SOUTH|WEST, but that is simply interpreted as WEST by procs such as step(), so it's not an issue.