verify code

Started by
0 comments, last by WitchLord 12 years, 1 month ago
Don't know how to choose the topic.
I wrote an editor that features a script editor which does code verification (i.e. just builds the script and collects errors). Now here is the problem: The editor doesn't feature the character class because characters are only placed in the game and the editor doesn't need to know about them. So I saved the work to add the character class to the editor. Now the script editor returns me errors >> 'Character' is not a data type <<.
To circumvent this I'd register all object methods and properties to dummies. Since the return and parameters type vary a lot I'd need a lot of different dummy prototype functions which is a little tedious:

void dummy1(int foo);
void dummy2(unsigned int foo);
int dummy3(int foo);
...


Is there any other way to do this?
Advertisement
How about dumping the engine configuration with the add-on function WriteConfigToFile() and then loading it into the editor dynamically similarly to what is done in the asbuild sample? As the editor will not actually execute the scripts all the registered functions can just be null pointers, i.e. asFUNCTION(0). Properties can also be registered with a simple sequence number (to make them different).

You'll find WriteConfigToFile() in add_on/scripthelper/scripthelper.cpp.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement