Using Deadron's wonderful character handling library, how would I reconnect a player to their old mob on relogin? I am trying to simulate a MUD system, and being able to logoff in the middle of a battle is just slightly cheating. I would like to have the mobile carry on executing procs, such as battle swinging, etc., and then autosave and delete the mob if the user has not reconnected within 10 minutes. I'm a bit rusty, having been away from BYOND for a few months now. How might I accomplish this?
~Polatrite~
Edit: Just to give you an idea of what I have already tried, I know that an obvious point would be to disable the client/base_autodelete_mob variable. I then tried having a disconnected variable set to 1, when the player calls Logout without the "quit" verb (quit is the standard way of logging out, saves your character, and deletes your mob). I then tried looping through existing mobs on login, searching for a mob with the same key, that has the disconnected variable at 1, then connecting the player to that mob and deleting the old one. For some reason, this method either a) connected the player to a copy of the last saved mob, or b) caused an infinite loop, disconnecting and reconnecting to a mob. Hmm.
ID:148333
![]() Mar 27 2003, 11:08 am
|
|
![]() Mar 27 2003, 1:34 pm
|
|
When someone logs in, the default behavior is to connect them to a mob with the same key. Thus, if someone logs in, and their mob is still there, they should automatically Login() to that mob.
|
Yeah, I discussed this a while ago with some people. I'm using Deadron's library, however, and this doesn't function the same way. I was wondering how I could modify it to do so, without hacking apart the whole library.
|
Polatrite wrote:
Yeah, I discussed this a while ago with some people. I'm using Deadron's library, however, and this doesn't function the same way. I was wondering how I could modify it to do so, without hacking apart the whole library. I'd be happy to look at this and see if it's possible, or if something could be added. I'm insanely busy right now, so this is more likely to happen if you send me email to remind me. |