<snip>
> class Skill
> {
> public:
> string name;
> int mana;
> ...
> SKILL_FUN *cast_code;
> SKILL_FUN *pulse_code;
> SKILL_FUN *upkeep_code;
> SKILL_FUN *expire_code;
> };
</snip>
Pointers, in Pythonese, to what I think you're trying to do... I'm sure you
can figure out the syntax needed. ;-)
def cast_code(self, args):
"""This is an external function to any number of skills that does nothing!"""
class Skill:
self.name=""
self.mana=0
self.cast_code=cast_code
...
s=Skill()
s.cast() # Exec's cast_code
The error you're getting is because you don't have the appropriate functions
declared in the class:
> class Skill
> {
> public:
> string name;
> int mana;
> ...
> SKILL_FUN *cast_code;
> SKILL_FUN *pulse_code;
> SKILL_FUN *upkeep_code;
> SKILL_FUN *expire_code; <-- These need to be actual function
> declarations rather than function pointers
> };
The way I suggested up top is probably what you're trying to do, but in case
its not, make those functions instead of function pointers, k?
Mark