06-07-2012, 03:32 AM
lua_State is automagically passed when you call a function from Lua. Or something like that..
But even if you did get a plugin reference, you still can't call Lua functions on it ( you can call the c++ functions, but why would you )
All plugins have their own 'sandboxed' lua_State (own stack, memory, etc.) which means they cannot interact with each other in a normal fashion.
I don't think you can easily forward Lua functions with any number of arguments/return values called from one state to the other.
The easiest way is to add a generic function to plugins that accepts a string and returns a string
But even if you did get a plugin reference, you still can't call Lua functions on it ( you can call the c++ functions, but why would you )
All plugins have their own 'sandboxed' lua_State (own stack, memory, etc.) which means they cannot interact with each other in a normal fashion.
I don't think you can easily forward Lua functions with any number of arguments/return values called from one state to the other.
The easiest way is to add a generic function to plugins that accepts a string and returns a string