Original Post
G'day! I am intending to implement my entity logic in Lua scripts, but I have come to a problem. Originally I was intending to have a separate lua_State for each entity, each with the script of the entity logic loaded; however, some entities may use my GUI (also written in Lua), but there can only be one instance of that, and if each entity is in a different VM, then they could not all access the same GUI, just their own local versions of it (which would not work). My next idea was to make each entity an object in a Lua Table, all in the same VM, which would allow them to use the GUI. Basically what I am asking is what would be a good way to do this? Is my latter option a good way, or are there other tips and tricks that I am not aware of? How would you do it?