|
Am 30.11.2012 um 00:43 schrieb Kevin Martin:
What do I return here? A reference to the lua function run !?
I do this in another example like: lua_getglobal(m_lua, "main"); // push the first two parameters lua_pushstring(m_lua, p_first.c_str()); lua_pushstring(m_lua, p_second.c_str()); lua_pushstring(m_lua, p_third.c_str()); // third parameter is an array lua_newtable(m_lua); for(std::size_t i=0; i < p_arrays.size(); ++i) { lua_pushnumber(m_lua, i+1); lua_pushstring(m_lua, p_array[i].c_str()); lua_settable(m_lua, -3); } lua_call(m_lua, 4, 0); I call the "main" function in my lua script and push the arguments in it, so in my case I will do this with different m_states for the different scripts Phil |