XceeD
08-20-2006, 02:41 PM
Ok... I'm doing this in C#, just in case you didn't realize in the title. But, since C# is similar to C++ (perhaps) and Java, feel free to post if you know how to do it xD.
[trust me, I tried googling but I don't know the term for it.] Okay, here's my situation: I'm making an MMORPG from scratch and I'm up to the point where I need some external coding done. Well, the best I can explain this is that I have NPCs and when you talk to them, they execute a script (or if you use an item, they execute a script) and stuff. I want to know how I can parse that script and actually be able to run it... I thought of several ways already but I keep having troubles with these topics: variables and conditionals.
In C#, (and Java and C++) variables have to be intialized or something of that word... Like you have to say whether it is an int, string, double, etc. You can't make an int variable into a string and vice versa. So, how exactly do I initialize variables in my scripts? Also, how do I remember the variables and their type?
Since I know Flash, I could do an Array but in C#, everything has to be the same type. Is there a way in C# to put any type in an array or something like an array?
Second problem is the conditionals. How would I do If, Else If, Else and stuff like that? Also, is there an easier way to make it so I don't have to match the symbol in the ( ) [in if(blah==blah)] with all the other combinations until I find what it is...
Hmm, I'm not even sure I said half of the stuff correctly but I'll highly appreciate it if you can help.
[trust me, I tried googling but I don't know the term for it.] Okay, here's my situation: I'm making an MMORPG from scratch and I'm up to the point where I need some external coding done. Well, the best I can explain this is that I have NPCs and when you talk to them, they execute a script (or if you use an item, they execute a script) and stuff. I want to know how I can parse that script and actually be able to run it... I thought of several ways already but I keep having troubles with these topics: variables and conditionals.
In C#, (and Java and C++) variables have to be intialized or something of that word... Like you have to say whether it is an int, string, double, etc. You can't make an int variable into a string and vice versa. So, how exactly do I initialize variables in my scripts? Also, how do I remember the variables and their type?
Since I know Flash, I could do an Array but in C#, everything has to be the same type. Is there a way in C# to put any type in an array or something like an array?
Second problem is the conditionals. How would I do If, Else If, Else and stuff like that? Also, is there an easier way to make it so I don't have to match the symbol in the ( ) [in if(blah==blah)] with all the other combinations until I find what it is...
Hmm, I'm not even sure I said half of the stuff correctly but I'll highly appreciate it if you can help.