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
0
votes
1 answer

How to call from C# a Lua function in a Lua script that has a "require"?

I have a C# program executing Lua scripts using the LuaInterface. So far, it is working well, unless my Lua script requires a specific package, like LuaXML. I want to send an XML string from C# to a Lua function. This is the XML, saved in…
0
votes
1 answer

reading Lua file with c#

i have succesfully referenced luainterface in my visual studio 2008 c# project. here is my code: private void button1_Click(object sender, EventArgs e) { Lua lua = new Lua(); var result = lua.DoFile(@"C:\testing\regex\test-data.lua"); …
Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062
0
votes
1 answer

Luainterface 5.1 get all used globals for a script

Is there anyway to get a list of all the names of used globals? One way is to not load any globals, and then execute the script. let it crash and parse the exception for the name.. very ugly...
Anders
  • 17,306
  • 10
  • 76
  • 144
0
votes
2 answers

LuaInterface in C#

I am a complete "noob" to C#, however I do know some C, although that is a good start, it's not enough. I have downloaded the most recent version of LuaInterface, and the download in cluded two files: lua51.dll, and LuaInterface.dll. I cannot figure…
Sam H
  • 956
  • 4
  • 16
  • 24
0
votes
1 answer

Remove one event that may be exactly like the others in VB.net

I'm creating a system in VB.net that utilizes Lua via the LuaInterface. To associate an event in Lua with a function, I can simply do this: RegisterEvent("tick", function(nt) if not lcc then return end if nt>=tt then f() …
Freesnöw
  • 30,619
  • 30
  • 89
  • 138
0
votes
3 answers

LuaInterface - FileNotFoundException

I am trying to get a Lua system working in my .NET 4.0 application. I am using LuaInterface as the wrapper for Lua, which is compiled under .NET 4.0 The application runs perfectly fine when running Lua scripts on my development computer, which has…
ZeunO8
  • 422
  • 6
  • 25
0
votes
1 answer

How to evaluate a tables in Lua?

Hi guys I could really use some help. I'm not a programmer I'm just started out Im trying to store every resulting calculated value of two tables and somehow store it into another table for later use. Close = {1,2,6,2,2,...8} --livedata with a…
0
votes
2 answers

LuaInterface random exceptions

I'm using LuaInterface for scripting in a game I'm making. The scripting works quite nice, but somehow I'm getting a lot of random exceptions. I've narrowed the problem down to where I call lua functions from C# code, which are invoked from another…
Cpt. eMco
  • 565
  • 4
  • 13
0
votes
0 answers

C# reading LuaTable with LuaInterface that contains Russian letters

so I've been using the LuaInterface library for my C# application to read a LuaTable, one problem I caught upon is that the LuaInterface library doesn't translate russian very well, when I try to output the string into the console, the russian…
SmooK
  • 47
  • 6
0
votes
1 answer

NLua - How to add new functions to a userdata through Lua?

I'm trying to define a new function for my Player class which was defined in C#. The purpose of Lua in my project (a game engine) is to define custom behavior for entities such as players. However, when I do DoFile(fileName) on the Lua file, it…
tayoung
  • 411
  • 1
  • 4
  • 16
0
votes
1 answer

Loading LuaInterface in .net4

I have a C# application I'm working on with which I want to use the excellent LuaInterface. However when I run the application I get this exception when I try to do something with LuaInterface: Mixed mode assembly is built against version…
Martin
  • 12,469
  • 13
  • 64
  • 128
0
votes
1 answer

C# LuaInterface / NLua: Route around compiling Lua for multiple objects with same script?

My system consists of entities that may contain a unique name and Lua script which is compiled when the entity spawns, there may be multiple of the same entity spawned at any time. At the moment I'm instancing a new NLua.Lua() for each entity and…
Jake
  • 37
  • 5
0
votes
0 answers

How can I know which string chunk is executed in c# - luainterface?

I am running on C# - lua project. The project has all logic in lua part, and c# part holds the built-in console to display result and take input. So debugging is almost occurred in lua part. My lua codes looks like below: [lua] #region main 1 …
Jeong Jinmyeong
  • 208
  • 2
  • 10
0
votes
2 answers

LuaInterface: add a table to the script scope

Question: how can I insert a table from C# into 'LuaInterface' script scope using a C# object (preferably anonymous type)? /// I want to do this, but it does not work /// (complains that 'test' is userdata and not table /// when I pass it to…
THX-1138
  • 21,316
  • 26
  • 96
  • 160
0
votes
2 answers

LuaInterface - how to register overloaded methods?

I'm trying to integrate Lua to my C# app when I hit a little snag. I was hoping someone with more expertise could help point me to the right direction. Let's say I have the following C# methods: public void MyMethod(int foo) { ... } public void…