What is the best LUA interpreter for Unity ?

I’d like to add some modding capability to my resource management game.

I have different game variables each with different formulas.

ie.

foodHappiness = foodProduction / foodConsumption ;
foodVariety = meatCount / fruitCount;

I don’t want to hardcode these formulas in C#. And I also want modders to be able to add their own variables.

Did some research and I suppose using LUA interpreter or whatever it’s called is the way to go.

But which one is the best solution I discovered the following :

NLua

UniLua

MoonSharp : Latest update Feb 9, 2016

LuaInterface : Looks old

I tried MoonSharp but I didn’t understand how to access C# stuff from Lua string code.

I tried NLua I got it working. It does something like load C# Library and I can access C# stuff.

But I believe NLua is causing Unity to sometimes crash when I press play.

Not sure if this is the right place to post sorry in advance if it’s not.

There this addonLua Framework based in MooSharp, The think that is a pay asset but only cost 15bucks.

In my opinio i don’t used because to pay method for asset store yet.

Are you sure a Lua interpreter is the way to go? I was pretty smitten with Lua at first — even started writing a book about Lua development (in the Codea environment) for kids — but the deeper I got into it, the more it annoyed me. I’m afraid that romance turned sour rather quickly.

So I ended up developing MiniScript instead. See the discussion thread here, or try the demo. I believe the code is quite solid; I’m mostly working on fleshing out the docs before I submit it to the Asset Store, where it will be a paid asset. However, if you want to incorporate it into your game now, you can have it free as an early adopter (plus getting lots of personal support!). Just PM me if you’re interested.

1 Like

well, I’ve scorched google for days (I skipped this and work on other features in the mean time) and found LUA. I’m so new at this I don’t even know what this sort of functionality is called - what I’m supposed to google.

So, sure I’ll try !

https://github.com/topameng/tolua
provide a bridge from unity to lua