ID:154345
 
Looking at other peoples' code, I notice that there is a real trend in character creation where players are constanly having their mob reassigned once the creation proccess is complete. Why is this? So far, my project seems to work fine if I leave the mobs the same from log-in, maybe only changing them at a later time in the game for a different reason.

I did this because whenever I changed mobs in the middle of my login proc, it kept trying to start the whole login sequence over again, and I couldn't figure out how to stop the loop. It seems assinging the client to the 'new /mob/player/peasant' was calling the Login() or something. Anyway, if someone with some experience could explain anything about changing mobs, it would be appreciated. Some time soon, I'm going to have to add the code for changing mobs in mid-game. I hope it doesn't call the Login() proc then too!!

-- John

PS - Let me post the code I was using to change mobs, maybe I used a poor method.

//Keep in mind the player starts out as /mob/player

proc/Changemob()
var/mob/oldmob = usr
var/mob/newmob = new /mob/player/peasant
newmob.key = usr.key
del oldmob
Erm, if I understand your question correctly, then it's making the Login() stuff happen when you change mobs?

Then make the character choosing part in client.New(). That should clear up the problem.
Felegar wrote:
I did this because whenever I changed mobs in the middle of my login proc, it kept trying to start the whole login sequence over again, and I couldn't figure out how to stop the loop.

You probably have your character choosing code in mob.Login(), which is a bad place to have it, and leads to the answer to your first question:

Character code often uses another class, like mob/choosing_character, with its own Login() proc that doesn't call the superclass proc.

That way the character choosing behavior is separate from the login behavior for other mobs, since you may have reasons to change mobs during a game and don't always want character choosing to come up.