Renaming skills with the #define keyword

Posted By: JimmyJazz

Renaming skills with the #define keyword - 05/27/08 14:46

I have a script that controls a player - in this script I can define meaningful names with the #define keyword and allocate values to them - no problem, this works fine. However, in a second script (for combat) any references to the meaningful name result in a "not a member of 'ENTITY'" compiler error. If I use the skill name (skill1, skill2, etcetera) it works fine and the values are correctly referenced it's just when I use the assigned label.

Funny thing is I've used a similar principle in another script (passing an ENTITY reference across scripts and referencing values using labels) and there are no problems.

Anyone else encountered this? If so, what was the work around?

Thanks in advance...

Cheers - Jim.
Posted By: Excessus

Re: Renaming skills with the #define keyword - 05/27/08 15:05

The error means that the compiler has not yet encountered the #define when you try to use it. So make sure the #define comes before the place where you use it. Take a look at the order in which you #include files.
Posted By: JimmyJazz

Re: Renaming skills with the #define keyword - 05/27/08 15:16

D'oh! That's solved it!

I've been pulling my hair out for two days over that - I suppose it's one of those solutions you just can't see for looking too hard!

Cheers, matey - much appreciated!

Thanks - Jim.
© 2024 lite-C Forums