ID:2008907
 
(See the best response by Ter13.)
Code:
mob
Login()
world << "[src] has joined the game!"


Problem description: I just want to change the message when a player logins to the above. Do I have to add ..() in the login override so that if functions as normal? Before or after the message or doesn't it matter? Thanks

Best response
You nailed it. Yes on both counts.

..() is the supercall. It calls the last override of the same function. That means it looks for a previous override in the same object prototype, or the last override (compilation order) found from the parent object.

In the case of the first override, ..() will call the default behavior, because you are overriding the default behavior with the first override.

mob
Login() //A
world << "herp" //will display "herp" to the world
..() //calls default behavior

Login() //B
world << "derp" //will display "derp" to the world
..() //calls A (displays "herp")
world << "butts" //at this point in the function, the output will be "derp" "herp" "butts"

subtype
Login() //C
..() //will call B, which calls A, which calls default behavior
I had no idea that it had an ordered behaviour like that. Interesting stuff.
Thanks Ter for you answer! The thing is that, in this Login() situation, even if I don't include the ..() line of code, as I test it then it seems to login normally. So, is it indeed needed here?
If you are manually locating the player on login, the default action is not necessary and therefore the supercall is not necessary.