ID:139832
 
Code:
client
West()
switch(usr.client.dir)
if(NORTH)
usr.client.dir = WEST
//and so on for the other 3 directions
East()
switch(usr.client.dir)
if(NORTH)
usr.client.dir = EAST
//and so on for the other 3 direction


Problem description: I am trying to use the left and right buttons to change the client direction. As you can see, I only have the codes for East and West done, and I am fairly sure it is right. However, the issue I have is that once I use Either left or right keys, it works fine. But, I still want the up/down (North, South) to still step like they should. But instead, they change the client.dir again. Anyone know why this is happening?

Why do you have "usr.client" when src is ALREADY the client in question?

And look up the turn() proc.

As for your issue, it probably has to do with your North() and South() procs. Just, a rule of thumb: if thing X is giving you trouble, and thing Y is not, and you are asking for help, supplying thing Y is not particularly useful.
In response to Garthor
Garthor wrote:
Why do you have "usr.client" when src is ALREADY the client in question?
Ah, just noticed what you meant there

And look up the turn() proc.

K

As for your issue, it probably has to do with your North() and South() procs. Just, a rule of thumb: if thing X is giving you trouble, and thing Y is not, and you are asking for help, supplying thing Y is not particularly useful.

As far as the North and South procs go, I don't have them in yet. So they should act by default, shouldn't they? And considering "thing X" is non-existant, it is kind of hard to supply it.

As well as, I also noticed that when I use the West/East procs, I can walk using the left/right arrow keys. But after I do that if I try to use up/down, it changes the client.dir again. Then, I can only move using up/down. If I try to use left/right it will again change my client.dir and then I can only move using left/right keys.
In response to Koriami
Oh right, sorry. Changing client.dir also translates all the directional commands. So, if client.dir is SOUTH, pressing the down arrow will call North().
In response to Garthor
*facepalm* I knew that... I didn't even think about it though... So, there is no way to make it so only the left/right arrow keys will rotate? Or, actually, would it work if I set it so that each direction acts differently based on the current client.dir?
In response to Koriami
You are not looking for the 'client's direction, because a player on the computer doesn't necessarily turn away from the monitor, so to say ;)
You want the direction value of the client's mob, I assume.
In response to Schnitzelnagler
No, because the mob could be facing North, but the client could be facing any other direction. They are two different dir variables. Usually the client.dir is North, but I want to change that.