I'm just wondering if it is possible to actually create an asIScriptObject in C++ and add member variables to it.
I know I can create an AS class and use it to create an asIScriptObject, but what I'd really like to be able to do is parse an xml file of name and type pairs and then build an asIScriptObject from it.
For example if the xml had <testMember>int</testMember> in it, then I would like to create an asIScriptObject instance and then do something like testObject->addMember("testMember", "int").
The idea is that latter on I can pass these dynamic asIScriptObjects to AS scripts to be operated on.
Creating an object in C++
It cannot be done the way you describe it, but you could parse the XML file and generate a script class declaration from it and then build that as a script in order to create the asIScriptObject. It can be compiled in a separate module so you don't have to rebuild the module where your real script is running, if you don't want to.
Regards,
Andreas
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
Popular Topics
Advertisement