ID:274047
 
Ok, I'm trying to make something new, I'd like to make a clone that the player can control through the directions arrows ( and the player will move with WASD ).
But I dont know what to do to ' verify ' if the player pressed the arrows, at least I did this :

mob
Clone
hp = 1
icon = 'player.dmi'

mob
var
clone= 0
verb
Clone()
var/mob/Clone/C = new()
clone= 1
C.overlays = src.overlays
C.loc = src.loc
flick('Skills/Clone.dmi',C) //Smoke xD
M_Left(clone,C) // I know that this is not the correct way, but its here that I dont know what to do...

mob
proc
M_Left(c1,c2)
var/t = b1
if (t==0)
return
else
walk(c2,WEST)

client.East() North() East() West() are called when they use the normal arrow keys to attempt to move then you can use that to call up the different directions moving code for cloned bodies instead of normal people...also you could make it so only while "cloned" it doesn't move yourself that way people can still use arrow keys for themselves when not controlling "cloned" people.

These will have to work with the logic that the player CONTROLLING will call the proc to move the clone.

I assume you got WASD already but unless you can see yourself too it might be moot to allow them to even control themselves at the same time(using two different controls depending on the clone & self.)
In response to Superbike32
Well, I already finished this xD

The only problem is that there is no way to the Clone and Player walk together, but I already did it, now I just want to know how I can make the southwest northwest and etc with W-E and SD o.o

Edit: I can control my clones, but the player and clone cant walk together ( two buttons at the same time =/ ) but its, ok it is still fun xP
In response to Feferson Uchiha
for the clone & player to walk together when you over-ride client directions use ..() plus the proc to move the clone, you may not both move if there's a dense object nearby though in the direction of movement...

to make the W+A for example go NW & stuff like that though you need to know when each key is held down, you could do one macro for down & one for up setting a boolean as an example of whether a key is down, this could allow you to go NW if you do the checks for which keys are held as the movement proc is run through for example...

You could also make it different keys similar to number pad being off & diagonals are 1,3,7,9.

Choose whatever you think is best.
In response to Superbike32
ok o.o