world
mob = 0
client
New()
..()
alert(src, "hello")
Not sure if this is intended by design. Kind of doesn't make any sense, if so. Why are we required to have a default mob for the client in order to show interfaces and alerts and such?
ID:779006
![]() May 27 2012, 4:08 pm
|
|||||||||||||
Not a bug
| |||||||||||||
Try this code out. Doesn't do anything.
world Not sure if this is intended by design. Kind of doesn't make any sense, if so. Why are we required to have a default mob for the client in order to show interfaces and alerts and such? |
Kaiochao wrote:
It's very intended. Clients need a mob and world.mob is the default type made. Obviously I just did this for example. I found it weird that not even the interface will show up if mob is set to 0. |
I just looked at the reference entry for world.mob, and it is documented that 0 is a valid value for world.mob, which makes no sense to me. I've never known of any clients without a mob set, if that's what it implies.
I have a feeling client/New isn't working because it relies on world.mob, if none of the previous searches are successful (see reference). I could be wrong, since I no longer fully understand what I'm dealing with here :/ |
It can be set to 0 if you want to designate and create a mob, or load a mob in client/New(), which I believe is in the reference as well.
|
But if there's no override in client/New and no prototype mob with a key set, using world.mob=0 won't work?
|
Well, it says "The default value is /mob. Setting world.mob to 0 prevents the creation of default mobs. "
the entire point is to avoid creating a default mob. If there is no default mob, of course it's not going to connect to anything. I don't know why it exists...but it's intended, and, along with it, you're supposed to override client/New(). |
Code-wise you need to designate the mob yourself. Something like this:
world You can't forget that you have to return something in client/New() to allow the connection. |
Don't modify client/New for things like alerts. The DM reference specifically tells you not to. You're better off using mob/Login instead.