ID:1187600
 
Keywords: override
Problem description:
Ok so, basiclly I am trying to make a single NPC in my game that will have his own move proc, but share the rest of the variables that his super class NPC has. This special NPC (lets call him Spooky) only moves away from mobs that are within 5 tiles of him, while the normal NPCs are going to move up to the mob. I know I could just make 2 different classes of this NPC but I was hoping I could use something called 'override' (in Java the notation was @override) to by pass the superclasses move and use the local move...

I know there are a few other designs for NPC/AI behavior, but I was hoping there was a quick way for me to do this.

Thanks!
Lemme write out the UML...after re-reading my OP it was kinda iffy.

mob/NPC
vars
move()

/Spooky
move()

/otherNPCs
Put your code in dm tags to make it more readable.

Yes, byond supports method overriding, but not method overloading like java. To call the superclass function call out to ..().

If you are looking for function overloading like java, take a look at named arguments.

You can also read from the args list for every function to set up a variable number of arguments.