Questions tagged [nlua]

NLua is the bind between Lua world and the .NET world.

NLua provides the 'glue' that allows the usage of Lua from C# and other .NET languages. It supports Windows, Linux, Mac, iOS , Android, Windows Phone 7 and 8.

Project repository on Github.

64 questions
0
votes
1 answer

NLua: Unable to cast object of type 'Command[]' to type 'System.Object[]'

I have a game engine that uses NLua for scripting. However, I can't seem to access elements in my Command array: -- Basic direction detection. This allows forward and backward to cancel each other out if both are active. function…
tayoung
  • 411
  • 1
  • 4
  • 16
0
votes
0 answers

NLua console script in C# application : import statement is not working

I'm trying to embed a NLua console script running in a thread in my C# software. My code read the lines from the console and append those until ":quit" is read. It then executes the script. I then catch any exception and print it to the console.…
lucas92
  • 464
  • 2
  • 11
0
votes
0 answers

Restrict access to all .Net classes in Nlua

Yes, I'm well aware of the other questions like this, but the other (almost the same) question is for an older version of NLua. Making the question simple, how do I completely sandbox Nlua? I want a single class Foo to be the only class available to…
Obsyden
  • 1
  • 1
0
votes
2 answers

How to set C# SerialPort object using NLUA?

I'm initializing Lua in my app next way: lua = new Lua(); lua.LoadCLRPackage(); lua["SerialPort"] = new SerialPort(); lua.DoFile("script.lua"); And add to project System.IO.Port to create SerialPort objects. So,my sctript containing next: import…
infernalcucumber
  • 103
  • 1
  • 12
0
votes
1 answer

How to read from Lua arrays into c# using NLua?

I have seen a few other posts, but they are the opposite of what I want to do. I simply have an array of ints in my lua file, and I want to know how I change that into a c# array. Using lua ["ints[1]"] throws an exception. I think this would be very…
Osuology
  • 1
  • 1
0
votes
0 answers

User Input into NLUA script

I've recently added NLUA support to my application, with the goal of allowing easy editing of functionality. Perhaps a quick explanation. I'm making a simple game, in the style of DarkSigns and other "hacking" simulators. I wanted to allow for…
Ben
  • 1,291
  • 2
  • 15
  • 36
0
votes
1 answer

Handling LuaScriptException in NLua

So I've been working on a simple game engine using SFML.Net for the graphics and what not, and NLua for scripting of games. So I have this method in my BaseGame -class that is supposed to run a Lua script and add some objects and methods etc. to the…
Ricochet
  • 11
  • 3
0
votes
0 answers

How to change the lua version NLua uses?

I want to use Lua 4.0.1 instead of 5.2, because I have to parse 4.0.1 scripts. The syntax of the generic for loop has been changed since then (with no backwards compatibility). If this is not possible, are there any alternatives to NLua that…
PayDay
  • 1
  • 1
0
votes
0 answers

Can not pass values between NLua states

I set up the following method to reproduce a problem I am having where passing a table from one lua state through a function parameter in another results in the table being null. In this case the table seems to be being interpreted as a function. I…
Kelson Ball
  • 948
  • 1
  • 13
  • 30
0
votes
1 answer

Use C# class implemented in shared project with Nlua

I want to use Nlua in my Project. My project setup is: I have a shared project where I implemented my logic, and several platform specific projects that use this shared project. I now want to use classes defined in this shared project inside a lua…
shniqq
  • 33
  • 5
0
votes
1 answer

NLua - does the application shown on the webpage exist somewhere?

On the NLua web page there is an image of a live Lua interpreter (edit: for Windows) that uses the NLua bindings. Does this exist for download somewhere? I know Lua very well but I have a very limited understanding of C# and would strongly prefer…
0
votes
0 answers

how to deploy both x86 and x64 MSVCR120 to local application folder for C# project?

My ultimate purpose is to deploy my .NET application with clickonce and copy those runtime dlls (MSVCR, MSVCP) to my local application folder. This is needed for NLua integration into my .NET app. That way the user doesn't need to install using…
techhero
  • 1,074
  • 11
  • 11
0
votes
1 answer

Cannot call .Count() IEnumerable extensions from lua script using nula

So I have a little lua script where I want to call an extension method on IEnumerable collection. require ''CLRPackage'' import ''System.Collections.Generic'' import ''System.Linq'' import ''My.Namespace.Containing.AudioMarker'' local…
Francis P
  • 437
  • 1
  • 4
  • 13
0
votes
0 answers

NLua and generic methods

I am trying to run following lua code with DoFile() in NLua : import('TestStack.White'); src=luanet.import_type('TestStack.White.UIItems.Finders.SearchCriteria') application=Application.Launch('C:\\windows\\system32\\calc.exe') win =…
Nish26
  • 969
  • 8
  • 16
0
votes
1 answer

Iterating over JArray in NLua

I'm trying to iterate over a JArray in NLua, but can't somehow. JArray's are treaten as userdata (what is userdata?) and thus can't be iterated over. Converting the JArray to an JValue[] with a c# method doesn't work either. There are two possible…
blipman17
  • 523
  • 3
  • 23