Joined: 13 Jan 2006
|Posted: Fri Jan 13, 2006 6:54 pm Post subject: Organizing MUD player skills in Coldc
|I'm new to Coldc and am struggling to find the best way to implement skills for players and mobiles for a MUD.
The skills are things like strength, agility, engineering, navigation, etc. They all contain values such as experience points, %usage of skill, etc, plus there are related methods for modifying each one.
The simplest idea is to add an array of values for each skill to the prototype object. Also, create generic methods in which the skill to be accessed is passed in. The problem with this method is that if a new variable for skills is needed, then all the arrays need to be changed. We plan to have 100-200 skills in the end, so this could get tedious.
Another idea is to create a prototype skill object, and have that as a parent to all other skills. This way, if a new variable or something is needed, only the prototype needs to be changed. The problem with this method, as far as I can tell, is that if a new skill is introduced, new skill objects for each user need to be created. If we have very many users, this could also be tedious.
I've also looked into frobs for the skills, but I'm having trouble understanding exactly what they do and what they're for. I've also read in many places that using frobs is 'bad.'
Is there a better option that I haven't thought of?
Here's another problem with the skills. I've noticed that when an object is @spawned (or @newed), all of the variables inherited from the parent are reinitialized to 0. This also applies to descriptions, which is bad if I'm trying to clone lots of the same weapon or monster or something. If I want to default them to some value, I have to create a method to initialize them. Is there a good way to do this without explicitly calling an initilization method?