Hello. I've searched the forums, but I haven't found anything that mentions this.
I started a club at my school, and we are creating a fps with a fantasy rpg setting. You can play as either a wizard or a worrior, and cast spells / hit people with your sword etc.
What I wanted to do, so that we could easily split up the code amongst ourselves, as well as make it easy to build in pieces, was to put all the functions in seperate .dba files and then include them. For example, I would have a 'spells' folder, and in it would be a bunch of .dba files, each containing the code necesary to execute that particular spell.
I then want the code to look in the spells folder, and #include all the .dba files. I wrote some code that looked up all the file names, checked if they ended with .dba, and then included them. The problem is, it doesn't seem like you can #include a variable, but must #include an absolute string.
In the simplest form, here's where I find the problem:
This works:
#include "C:\db\myfunctionsfile.dba"
and this doesn't
srcpath$ = "C:\db\myfunctionsfile.dba"
#include srcpath$
If I could somehow get the 2nd example to work, then I'd have no problems, I could use my code to find the .dba's and include them. The reason for all this is so that, to add another spell, all i have to do is put the code in a .dba file, and throw it in the 'spells' folder, without code change to the main program.
Thanks!
I am who I am