I am wondering, how would you implement in-game scripting for a game made in Defold? Since Defold is in Lua already I assume it should be easy?
My first thought was that my Defold project could ‘require’ a .lua script file that the user would provide in some outside directory location. But, it seems a defold project can only take scripts from within the project directory structure right? And even if you could do that, would building the project to windows/mac/linux break this?
I am thinking I would have created functions in my player.script that would provide game state info (e.g. distance to target, etc). But what I want is to expose those functions to the user via some kind of api - so that the user can add functionality and tell the player when to do things like fire weapons via scripting.
Any suggestions on how to do this? It seems like it should be easy, but my rudimentary efforts have failed.