Original Post
I'm having some fun with quite an old game that uses LUA to handle some of it's functionality and have managed to hook it (hack) and use utilise the data from from hook (by using a pointer to the VM, which works fine from the games thread..) However there is obviously problems running LUA from my "own Thread" (pointing to the existing VM in the game's thread). eg: Buggering up it's stack if it's currently processing LUA whilst my Thread hijacks the VM and does some processing during the other threads slice, ouch... So my question is: does anyone know if it's possible to somehow "reference" the other LUA VM (or indeed copy it's entire state) from my Thread without messing up it's stack while it's processing. Would be read only data anyway, i'm not modifying it so I can see where the spaceships are. I can insert a hook from "it's intended thread" which works ok, but then I slow down the game. So would be nice to use the VM from my Thread as the game does not have any critical sections / lock threading implemented (as it obviously didn't expect to be hijacked and it solely runs lua onframe event in one thread) :) Thanks for any suggestions, if it's possible.