ashwin.sudhir Posted June 16, 2011 Posted June 16, 2011 We used this pattern Interpreter::addExternLibrary("my_application"); Interpreter::addExternFunction("my_application.init",MakeExternObjectFunction(&my_application,&MyApplication::init,"1")); to export some member functions into UnigineScript. Later we realized that callbacks to such functions seem to work *only* if the call to addExternFunction() is *before* Engine::Init() Any function that is exported after engine initialization doesn't seem to work. Is this intentional or are we missing something? If this is by design, it is too restrictive and the initialization of various C++ sub-systems becomes unnecessarily complicated. -a.
ashwin.sudhir Posted June 30, 2011 Author Posted June 30, 2011 Sorry, but need to bump this up. Any insight? -a.
Guest anet Posted June 30, 2011 Posted June 30, 2011 Export into Unigine Script after engine initialization should work properly. But in this case you should not use exported libraries, functions and classes during engine initialization. Because engine still knows nothing about new functionality. For example during engine initialization system script is loaded. Also if you use console_command "world_load my_world" (as engine config parameter or as a command-line argument) world script will be loaded during engine initialization too.
Recommended Posts