I need a way of compiling player made code and run it in game. I have looked at lua Interface and kopiLua and I have no idea how they work. Im using Unity free and developing for Windows PC.
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.
http://www.dannygoodayle.com/2013/05/31/integrating-unity-with-lua-in-two-minu
I used this but I don’t want to player to have to use a comma to connect with the script and looking at any of the script they don’t make ANY SENSE. I don’t know were to edit it too add my own functions.
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, it’s just… I don’t want the player to have to use a colon. I may add some script before the players code to add a ton of functions so the player doesn’t have to do them. Yes! Thats what I’ll do.
The reason I think I’m struggling so much with Eval is because I HATE JAVASCRIPT!!! ![]()
C# is a million times better. Well, if you good in it… Thanks for your feedback everyone! If you are going to add mod support or anything. KopiLua! Link: http://www.dannygoodayle.com/2013/05/31/integrating-unity-with-lua-in-two-minutes/
Easy to do. Looks confusing at first. Not at all once you begin work in it.
Woah, you made High Frontier? I saw that around but never looked into it. It looks like a Halo/Elysium (The movie) cross thing ![]()
Basically the game I’m working towards consist of a programming section, where you program a mech, and then connect online and battle with other peoples programming.
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!