ID:2864058
 
(See the best response by Ter13.)
Code:
Character_Select
parent_type =/mob

proc/Select()
src<<"Welcome to Kings Landing!"
return ..()


mob/Player
Select()
return ..()


Problem description:

Why does this not work? How can this work?
Best response
I wouldn't use parent_type like this. It's obscuring the problem you are running into.

mob
Character_Selection
proc/Select()
src << "Welcome to Kings Landing!"
return ..()
Player
Select()
return ..()


The problem you have run into, is that the proc Select() is defined under /mob/Character_Select, while you are trying to override it on /mob/Player.

This won't work, because /mob/Player has no Select() proc to override. You need to define a proc on a parent type (or the same type) in order to override it.

world
//set the default mob for players joining the game to /mob/Character_Select
mob = /mob/Character_Select

mob
proc
//define Select() on the common ancestor
Select()
Character_Select
//override Select() for character selection
Select()
src << "Select a character!"
return ..() //this isn't necessary right now
Player
//override Select() for players.
Select()
src << "Welcome to Kings Landing!"
return ..() //this isn't necessary right now

//You need to call a function for it to do anything.
mob/Login()
Select()
..()


All children of mob will have the same Login() behavior until it's overridden on a child type. The ..() you keep throwing in when you don't need to, calls the last override in the class hierarchy.

Stay away from parent_type until you really strongly grasp polymorphism and object oriented principles.
Ok I thought me putting /mob in parent type would work with all mobs regardless of name
parent_type is just a shorthand for setting the parent of a type declaration.