chao.zhang Posted July 24, 2012 Share Posted July 24, 2012 hello all, I call a system script function engine.console.run with some command and parameters in C++ interface Unigine::Engine::runSystem(). I call it like this string path = "D:\example.world"; engine->runSystem("engine.console.run", Variable("world_reload"), Variable(path)); when executes, the console complain the following errors: Interpreter::get_extern_function() : can not find "engine.console.run" function with 2 auguments. the engine.console.run itself is a variable paremeter function with the definition as: engine.console.run(string command, ...); so what is the right method to call such script function in a C++ function? thanks in advance.gine.console.runystem I call a reload_world command with a path to a world file like this string str = "D:\example.world"; engine->runSystem("engine.console.run", Unigine::Variable("world_reload"), Unigine::Variable(str)); when execute, the console complain the following errors: Interpreter::get_extern_function(): can't find "engine.console.run" function with 2 arguments Interpreter::runFunction(): bad function id 0 so what is the right method to call this function in C++ functions? thanks in advance! Link to comment
carl.sutton Posted July 24, 2012 Share Posted July 24, 2012 Use runConsole for console commands in c++ engine->runConsole("world_reload"); Link to comment
chao.zhang Posted July 24, 2012 Author Share Posted July 24, 2012 thanks carl. then where should i specify the world file name to reload? like engine->runConsole("world_reload -filename")? Link to comment
carl.sutton Posted July 24, 2012 Share Posted July 24, 2012 world_reload takes no parameters, it just reloads the current world you are using. Perhaps you are wanting world_load? you can use it like this; engine->runConsole("world_load samples/objects/terrain_00"); Quick reference all standard console commands here https://developer.unigine.com/en/docs/1.0/getting_started/console Link to comment
chao.zhang Posted July 26, 2012 Author Share Posted July 26, 2012 thanks carl, it works. Link to comment
Recommended Posts