ID:179553
 
Login() only applies if a client is created of that mob type.

e.g.: For mob/bob, Login() is called, followed by New() when a client becomes mob/bob, but if you wanted to make a NPC bob then only New() would be called.
Evilkevkev wrote:
Login() only applies if a client is created of that mob type.

e.g.: For mob/bob, Login() is called, followed by New() when a client becomes mob/bob, but if you wanted to make a NPC bob then only New() would be called.

Actually it's the other way around. New() is called when the mob is created, but Login() is called once the client connects to it. For NPCs, you are correct: Login() is never called. Thus if you have behavior you want in Login(), you should move it to another proc and have Login() call that. Whatever creates your NPCs can also call that, or you can have some world proc loop through the NPCs to "start them up".

Lummox JR
In response to Lummox JR
Lummox JR wrote:
Evilkevkev wrote:
Login() only applies if a client is created of that mob type.

Actually it's the other way around. New() is called when the mob is created, but Login() is called once the client connects to it.

And the number one mistake people make is to put their "first time the player logs in" code in mob.Login()...cause that means that code will get called everytime a player logs into any character.

It's better to create a special mob type for first time players and put the one-time code in that Login() proc, or at least to have some kind of check for whether this is a new player before you spam them with new player stuff.