ID:1951633
 
(See the best response by Konlet.)
Code:
mob/proc
Control()
for(var/mob/D in world)
if(D:owner == usr)
if(!D.returned)
client.controlling = D
usr.client.perspective=EYE_PERSPECTIVE
usr.client.eye= D
D.owner:lock=1
else
client.controlling = usr
usr.client.perspective=MOB_PERSPECTIVE
usr.client.eye= usr
usr.lock=0
else
return


Problem description:
Using this code, I was trying to allow a player to be able to control other NPCs which works. However if you are in control of another NPC, save the game, and log back in, you are no longer able to control your original character. How do I fix this?


Best response
You could either reset the client.controlling variable back to controlling the user upon login, or use tmp type variables to specify not to save those variables.
In response to Konlet
Konlet wrote:
You could either reset the client.controlling variable back to controlling the user upon login, or use tmp type variables to specify not to save those variables.

Thank you, I very much appreciate it. I tried doing the first part previously and it didn't work, but after changing them to tmp, I found out that I had conflicting codes/variables in the move proc as well. Thanks again.
Agreed w/ Konlet. Temp card are the best way to go about this IMO.