ID:1847115
 
Problem description: It's a little uncommon but there's two things I want to do that I don't know how to start:

1. I want the mobs of players who log out to stay on the map and to drop to the KO icon_state. Much like how SS13 does it. (Then other players will be able to drag their bodies around, yada yada. The idea behind it is to log out when in a bed to simulate going to sleep. While the character's conscious (the player) is gone, their body is asleep. :) )

2. I want players to be able to leave their bodies (their mob) and jump into another person's body whether they're online controlling their mob or not. It would be like someone's conscious leaving their body and entering another person's body. If two players are in 1 mob they're both able to move it around, speak, etc. I think the difficult part about this is that the "mob jumper" gets the same tabs, verbs, inventory items, etc as the original. If the "jumper" drop a Sword obj, then the sword on the original guy's screen drops too (since they share everything on that mob). Whenever the "jumper" leaves that mob to find another mob to take control of, their tabs disappear; they no longer have the inventory or verbs of the prior mob, etc.

Now I'm not asking anyone to code this whole system for me, because I know it will most likely be hard or tedious. But I'm still a beginner coder so I need some guidance on how or where to start at least. x_x


But... if you are in fact feeling like a beast then I definitely am not opposed to you posting more of the code for this idea to work!
Look into client.mob and mob.client. By setting either of these you can change the mob that the client controls. Login() and Logout() will then be called for the respective mobs; you can define behavior there. Just make the initial login to some sort of dummy mob, and then control a mob from there.

EDIT: Saw your part about two people controlling. That might be a somewhat different approach. You'd basically need to act as a proxy and forward input to the mob.
In response to Mightymo
Mightymo wrote:
Look into client.mob and mob.client. By setting either of these you can change the mob that the client controls. Login() and Logout() will then be called for the respective mobs; you can define behavior there. Just make the initial login to some sort of dummy mob, and then control a mob from there.

EDIT: Saw your part about two people controlling. That might be a somewhat different approach. You'd basically need to act as a proxy and forward input to the mob.

A proxy and forward input? Could you elaborate a little?
What I mean to say is that the client will own a mob that acts as a redirect to the mob being controlled. This means that all of the same verbs, etc. will be available to the mob, but rather than executing it will tell the mob being controlled to execute its version of the command.

Something like this maybe, assuming the mob you want to control is stored in controlledMob.
mob
possessor
verb
attack()
controlledMob.attack()
possessee
verb
attack()
//...


You'd have to be careful with usr; perhaps using procs instead if you can. You'd do the same with movement as well.
Oh shid. Smart way of approaching it. I was thinking something completely different.