Sign in to follow this  
guvidu

Luabind/lua: calling a function from a specific script

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this