Original Post
Howdy.
Already, before I ask this question, I am guessing that the answer will be NO!!!!, but someone out there with superior programming skill might know a way.
Here is my situtation. I am writing a game. Its pretty basic, but hey I''m having fun. The enemys in the game are event driven, ie. they responde to thing that happen to them, (what they can see, if things hit into them etc...)
To control these badies, I have written a basic scripting language and a parser, so that the user/developer can reprogram the enemy without having to recompile the game.
For each badie in the game there will be an object, and an associated script. Presume the following.
The object has the following member variable
int iXCoor;
and in the control script there is the line
iXCoor = 7;
When I parse the script, the parser will recgonise this as an assignment statement parse it into a destination and an expression.
char* destination = iXCoor;
int expression = 7;
Is there any way that I can then access the member variable which name is held in destination.
if I wrote enemy.destination, I will get an error cause enemy has no member called destination.
In short, is there any way that I can access a variable, when I have a string, which contains the name of the variable that I wish to access.
Thanks a lot
Ciaran
"Only two things are infinite, the universe and human stupidity, and I''m not sure about the former." --Albert Einstein