So I hit another problem which I couldn't find in the documentation.
I was wondering how would I expose something like
void Object::init(void* agent)
from C++ to Angelscript?
Jump to content
Posted 26 July 2013 - 04:01 PM
Do you really want to expose 'void*' to the scripts, despite the fact that you'll have no control of what is actually passed into this function?
If you really want it you can do so by registering it as a value type, like this:
// Register void* as a value type engine->RegisterObjectType("void_ptr", sizeof(void*), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_PRIMITIVE); // Register the method using the registered value type for void* engine->RegisterObjectMethod("Object", "void init(void_ptr)", asMETHOD(Object, init), asCALL_THISCALL);
Posted 27 July 2013 - 07:32 AM
Well, the funcion is only to be run inside C++, I just need it for registering some behaviour nodes through script, unless anyone has done an implementation of libbehaviour(behaviour tree) with exposed modules to Angelscript I would be very interested in seeing their approach to it. : )
I am just learning Angelscript so any advice on exposing it the best way would be very appreciated.
Edited by Zervoxe, 27 July 2013 - 07:38 AM.