For this thread I’ll talk about the Lua implementation but I think everything applies to AngelScript as well.
My idea is making multiple LuaScript subsystems at the same time possible. A very useful use case for this is allowing the programmer to create two separate script APIs, one for the Lua parts of the game code (This one would have all the Urho3D API available) and another one targeted to mod scripts, with a custom-defined API and no access to Urho3D whatsoever.
It’s not an option to use the current LuaScript subsystem to create a mod API for a game because having access to the context and the scene makes cheating incredibly easy, and unless that’s the intended behaviour, the mod API should be clearly a sandboxed environment.
My idea in order to implement this into Urho is to create a base class LuaScriptAbstract from which LuaScript would inherit its functionality, moving all the generic stuff in the base class, and leaving just the Urho API registration in LuaScript. After that, anyone can subclass LuaScriptAbstract and inherit functionality such as ExecuteFile or FindFunction, without having to worry about the lua_State having all the Urho3D types and classes already bound.
With this, the programmer can easily register LuaScript and ModLuaScript as two sepparate subsystems and use both as needed, so programming the game in Lua remains an option while being able to create a Lua mod API.
I’m going to implement this and submit a pull request if I manage to do it alright. Comments are welcome!