0

I am trying to create a database written in Lua that is separate from my methods that are written in c#. The answer I have found so far on how I can run Lua from c# has been "NLua" ( https://github.com/NLua/NLua ) but I have no idea where to start on integrating it into my project so that i can use it as a resource.

there is a README file that gives an example on how to go about "creating a Lua state" in c#:

using NLua;

Lua state = new Lua ()

From the NLua Files, Which of them are relevant to the use of NLua and how do i apply/install them into my project to do that within a c# class or am I going about this wrong?

So far I have tried placing the LuaRunner and Nlua folders and the whole NLua-Master folder in my project but there must be some extra step to allow me to get "using NLua;" to work.

DED
  • 391
  • 2
  • 12
  • 1
    This is new to me but there appear to be several NuGet packages available. Perhaps researching a few of these and choosing one to install would do the trick. – Mary Dec 21 '18 at 05:05
  • @Mary Thanks a ton, so that's how i can add more apps to .NET. – DED Dec 21 '18 at 20:59
  • I've updated the NLua nuget package, should work fine with most platforms https://www.nuget.org/packages/NLua/ – Vinicius Jarina Jan 28 '19 at 16:24

1 Answers1

0

Using Visual Studio 2022 here's how to add NLua to a solution:

  • Click Tools on main menu bar.

  • Click Nuget Package Manager.

  • Click Manage Nuget Packages for Solution.

  • In upper left corner of dialog type "NLua" in search box.

  • Click Browse above that search box (if not already selected)

  • Select NLua in List below the search box.

  • To the right of that List is a box where you select which projects you want to have use NLua.

  • Make sure "latest stable" version is selected.

  • Below that click Install button.

  • Add "using NLua;" to the top of your code where needed.

  • This link will get you started: http://nlua.org/

It works.

Jeremy Thompson
  • 61,933
  • 36
  • 195
  • 321