ID:140706
 
Code:
mob/var/tmp
transfered = 0
TransPerson
mob/Yama/verb
MT(mob/npcs/M in oview(6))
set name = "Mind Transfer Jutsu"
set category = "Jutsus"
usr.Handseals()
if(usr.firing) return
if(M.CNNPC){usr<<"You cannot control NPCs";return}
else
if(usr.TransPerson==null)
if(usr.chakra>=1000)
usr.chakra -= 1000
usr.TransPerson = M
usr.controlled=M
M.controller = usr
usr.controller = usr
M.Frozen = 0
usr.client.eye = M
usr.client.perspective=EYE_PERSPECTIVE|EDGE_PERSPECTIVE
sleep(600)
view(M) << "[usr] is no longer controlling [M]."
usr.TransPerson = null
M.Frozen = 0
usr.chakra -= 100
usr.controlled=null
usr.client.eye = usr
usr.client.perspective=MOB_PERSPECTIVE
else
usr << "Need more chakra!"
return
else
view(M) << "[usr] is no longer controlling [M]."
usr.TransPerson = null
usr.Frozen = 0
usr.controlled=null
usr.client.eye = usr
usr.client.perspective=MOB_PERSPECTIVE
return




mob/var/atom/movable/controlled

mob/var/atom/movable/controller
mob/Move(l,d)
if(controlled)
step(controlled,d)
else
return ..()


Problem description:
The problem is that every single time I do this jutsu, the person that I am trying to control is always able to move. I am trying to make it so the person that does that jutsu is in control and not the person that is being affected until the time limit is done.


You're never even trying to prevent a player being controlled from being able to move. Anyway, if you use the forum search you'll see that entails basically overriding client/Move() and not letting it execute the default function ( ..() ) if the player not supposed to be able to move, and if he is then do execute it (and return its value as well). To do this with the controlled person, you'll need to set a flag on him indicating he is controlled and then check later to see if a player should be allowed to move or not. You're already doing most of this with the controller var. Also, your code preventing a controlling person from being able to move as normal should really all be in client/Move() instead as well.
In response to Kaioken
Also: your controlled and controller vars need to be declared as tmp (var/tmp/atom/movable/controlled). Otherwise, if you save the mob while controlling / being controlled, it will save the other player's mob as well, which causes issues (and the infamous "rollback" bug).
In response to Garthor
Oh, good catch there. That would've probably been a prime rollback-bug inducer.
In response to Kaioken
I see what you are saying.. Its just that I don't quite understand how to do it. I am experienced, but not at movement and such. Perhaps you can show me.
In response to Lighting007
In response to Chowder
Tried everything.. Couldn't get anywhere. It is really frustrating.
In response to Lighting007
http://www.byond.com/developer/forum/?id=724089

Try examining this post, its does the same thing basically. DO NOT COPY AND PASTE!! STUDY!