Luabind/lua: calling a function from a specific script
Hey guys!
I need to load a function from a specific script. What i need to do is something like this:
Load a bunch of script files
luaL_dofile(m_luaState, script1Path);
luaL_dofile(m_luaState, script2Path);
luaL_dofile(m_luaState, script3Path);
all of this scripts have a "update" function
what i need to do is call "update" function from script 2 for instance. Any way i can do that? I dont want to have multiple luaStates. I want only to have one lua state that load multiple scripts and have a function executed from a specific script
Thanks
[Edited by - guvidu on October 14, 2008 2:35:20 AM]
This might help. Essentially you want to sandbox each script into a seperate enviroment so you can invoke a common function across all the sandboxed scripts.
http://lua-users.org/lists/lua-l/2006-05/msg00122.html
Good Luck!
-ddn
http://lua-users.org/lists/lua-l/2006-05/msg00122.html
Good Luck!
-ddn
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement