I am looking for a a runtime script interpreter that I can use and be compatible with Unity. I’m currently investigating Lua Interface and kopiLua, and they seem like solid options, but I am worried about whether Lua is a good language given my requirements. Are there any popular interpreters for object-oriented languages that are compatible with Unity?
Lua’s nasty. I’d rather subject my users to JavaScript than subject them to that. And C# might be even better than JavaScript (depending on your user base).
Either of these is quite possible with the built-in stuff. See this answer for example.
Dosn’t that involve the player having to install unity and only work in the editor and unbuilt?
Not sure if you’re open to Python, but I did spot this in the Unity Asset store:
I’m a bit biased towards Python for easy implementation of small script tasks, so that might do exactly what you’re after, and be easy to expand and maintain, I’m guessing.
No, that’s not it at all. The two techniques mentioned are for compiling code at runtime — loaded from a file, for example, or a GUI element.
Woah, I did not expect this much helpful feedback. Thanks JoeStrout and Kurt Dekker. I’m gonna compile the code from a GUI element.
Actually, scripting is something I’m thinking a lot about lately… I’m going to need it eventually for mod support in High Frontier, and I’m not particularly satisfied with any of the off-the-shelf options I’ve found.
I may end up rolling my own solution. But if anybody wants to collaborate on that, please PM me.
I done research into kopiLua. It works, but Lua as a language suffers for not being hard-typed, and I will need to do a lot of scripting to expose a basic set of functions to the user.
Thanks for your feedback everyone! If you are going to add mod support or anything, kopiLua was easy to implement. Looks confusing at first. Not at all once you begin work in it.
Sounds like a lot of fun. I’m not a big fan of Lua, but for a cool programming game, I’d muscle through it!