ID:155208
 
I'm trying to switch control of one mob to another, basically one will get inside of another like a suit. I really have no idea how I would do this.... I tried switching the mob to the users key but that deletes the users mob. Instead I want the users mob to be inside of the suits inventory. I can make the user get inside of the suit with this The suit is like a full body suit, that modifies hp and such so no it can't be an overlay Any help would be appreciated.
if(Ruse==0)
usr.Move(src)
Ruse = 1
usr << "you are inside xxxx"
density = 1
usr.wealth = src.wealth
usr.HP += src.HP
else
density = 0
usr.Move(src.loc)
usr.HP -=src.HP
Ruse = 0
usr << "you have exited xxxx"
First of all, I don't know why "it can't be an overlay." There are ways to change vars without switching mobs.

That aside, setting the key like you mentioned should cause the player to switch mobs. Also, setting the client of the mob to the player's client would work too.

You just have to take into account that mob/Logout() and mob/Login() are going to be called when the player switches mobs. (i.e. You can't have regular player-logging-in-code execute when they are only switching mobs.)
In response to Complex Robot
How can I stop login/logout from being call? sorry I only started this a few days ago...
In response to Angelsam100
You can't stop those procs from being called, but there are ways to distinguish between mob switching and a player logging in and out. (If you read the reference entries at all, you would know this! >.<)

In Login, the mob's loc will typically be null if a player is connecting to the world for the first time.

In Logout, the mob's key will be null if it is a mob switch instead of a player logging out.
In response to Complex Robot
I've got it working now, thanks for the help.