Working on my graduation project.
At this moment I am investigating whether I can use Lua scripts as components for entities, might be relevant for MCServer as well.
Apparently I have found/come up with a way to allow Lua scripts to keep references to entities across function calls. When the entity is deallocated in C++ the Lua reference is set to NULL (yes, not nil).
Also my approach would use a single lua_State for all scripts and therefore allows inter-script/component communication.
At this moment I am investigating whether I can use Lua scripts as components for entities, might be relevant for MCServer as well.
Apparently I have found/come up with a way to allow Lua scripts to keep references to entities across function calls. When the entity is deallocated in C++ the Lua reference is set to NULL (yes, not nil).
Also my approach would use a single lua_State for all scripts and therefore allows inter-script/component communication.