Questions tagged [luainterface]

LuaInterface is a library for integration between the Lua language and Microsoft .NET platform's Common Language Runtime (CLR).

LuaInterface is a library for integration between the Lua language and Microsoft .NET platform's Common Language Runtime (CLR). Lua scripts can use it to instantiate CLR objects, access properties, call methods, and even handle events with Lua functions.

95 questions
1
vote
1 answer

Lua / LuaInterface - How to access C# Attributes?

I have been looking for a way so that in Lua script I can access custom attributes for a class. I know that I can implement a normal C# method and in that method access the Attribute using normal Reflection and then do a registerMethod on the…
Ted
  • 19,727
  • 35
  • 96
  • 154
1
vote
0 answers

Read .lua files in .net ( LuaInterface )

i have a Question : How can i parse / read .lua files with .net. Sample.lua : TestValues = { ["test1"] = { [1] = "value1", [2] = "value2", [3] = "value3", } } How i can get the data : value1, value2,…
rejka26
  • 33
  • 5
1
vote
0 answers

LuaInterface issue with vs 2015 RC project

I am using LuaInterface to allow lua to be on my C# console application. I orginally programmed it on vs2012, and didn't have any problems. I did have to add this chunk of code to the app.config file to run:
1
vote
0 answers

luaedit 3..0.10 will not show output from simple script

I am trying to get output from my first script in luaedit 3.0.10 and not having much success. I'm using the sample script from the online tutorial at http://lua.gts-stolberg.de/en/Mathe.php to wit: a = 2 + 1 print (a) I'm running luaedit under…
1
vote
3 answers

Read nested Lua table who key is a System.Double

Using C# and LuaInterface, I am trying to read a nested table, but am getting a null LuaTable when I try to open the key containing the table. The .lua file: DB = { ["inventory"] = { [10001] = { ["row"] = 140, …
Robert Kerr
  • 1,291
  • 2
  • 17
  • 34
1
vote
1 answer

LuaInterface - C# Import

I have registered a method for my lua script that requires an enum as the argument. I'm getting an error when I load the script. Do I need to import the namespace of the enum inside lua for it to run, or do I need to do something else? EDIT: I know…
user3865229
  • 125
  • 2
  • 9
1
vote
1 answer

LuaInterface error " '=' expected near '' "

I'm trying to learn lua and how lua can be used with C#. So I've created a lua script in which I declared a string variable called "x": local x = "String variable" Then I've tried to load the string from the c# program like this: LuaFunction vsa = …
VIclean
  • 155
  • 1
  • 2
  • 7
1
vote
2 answers

Iterate through LuaTable in c#

I am trying to iterate through LuaTable object in C#, but getting error. my lua file is: config = {} config.visibility = 0 and my C# code: LuaTable config = lua.GetTable("config"); Console.WriteLine(config["visibility"].ToString()); foreach…
Zbynek
  • 5,673
  • 6
  • 30
  • 52
1
vote
1 answer

Accessing userdata properties and methods in Lua

I have a question regarding accessing userdata types in LuaInterface. When I pass my C# Dictionary to Lua and try to iterate through it using ipairs I get an error since ipairs is expecting a table and not a userdata object. I suppose one solution…
Anoop Alex
  • 179
  • 1
  • 9
1
vote
4 answers

LuaInterface and 64Bit

Ok i'm currently using LuaScript v5.1 in a Game engine i'm using. and the handy LuaInterface that comes along with it. i've tested it on a range of systems running a range of OS's. LuaInterface seems to fail on 64bit Operating Systems. Could anyone…
Skintkingle
  • 1,579
  • 3
  • 16
  • 28
1
vote
0 answers

LuaInterface & .NET- LuaAPI Failure: L->top < L->ci->top

I am struggling with the below error when trying to set a global in a LuaInterface Lua VM instance from .NET. LuaAPI failure: L->top < L->ci->top, file 'h:\dev\vastpark\~repositories\public\trunk \components\luainterface\lua-5.1.2\src\lapi.c', line…
Drew R
  • 2,988
  • 3
  • 19
  • 27
1
vote
0 answers

LuaInterface/C# - Closures created with .NET objects never get cleaned up

I am using the latest version of LuaInterface (http://code.google.com/p/luainterface/) in a C# application. I'm running into a problem where the Lua class is failing to clean up internal references in the ObjectTranslator 'objects' and…
Eric
  • 21
  • 3
1
vote
1 answer

mapping C# classes to LUA functions using LuaInterface

Is there a way to map classes directly to C# functions by just loading the class? Instead of making 100+ RegisterFunctions and mapping them? EX: Something like this.lua = new…
Vans S
  • 1,743
  • 3
  • 21
  • 36
1
vote
1 answer

Is it possible to use LuaInterface in Mono/Mac OS?

LuaInterface uses two .dlls: lua51 and luanet. While being able to rebuild lua51 to liblua5.1.dylib (and code actually found all necessary entry points) im completely stuck with luanet.dll. Does anyone have an idea how to build it on Mac OS or if I…
Vlad Fedin
  • 498
  • 5
  • 8
1
vote
1 answer

Passing C# collection to back to Lua

I have a DLL written in C# that is used by Lua scripts. The scripts "require CLRPackage". So far I can load_assembly() and import_type() to get at the classes and methods in my DLL. I'm passing back simple values and strings, and that all…
halm
  • 104
  • 3
  • 10