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
3
votes
2 answers

How do you pass an object from c# to lua's function?

I'm using Lua interface on c# to pass an object I created to lua's function. It successfully calls the function, but lua is keep throwing an error: LuaInterface.LuaException: /hook.lua:32: attempt to index local 'objj' (a nil value) This is the c#…
Max Hunter
  • 33
  • 6
3
votes
2 answers

DllNotFoundException while trying to "fix" LuaInterface, but why?

Since my game, which I'd really like to be Mono-usable, does not seem to run under Linux because LuaInterface is being a jerk (see the the relevant SO thread for more on that), I've decided to do what's suggested there. I wrote my own Lua511.LuaDLL…
Kawa
  • 1,478
  • 1
  • 15
  • 20
3
votes
1 answer

LUA - Unexpected symbol near '・

I'm trying to load a Lua script into my project at runtime. However, whenever I try to do so, I receive the following error when loading the file: Items\food.lua:1: unexpected symbol near '・ The file itself is simple enough, but I can't see the…
Lyise
  • 1,110
  • 2
  • 12
  • 20
3
votes
3 answers

LuaInterface - a function which will return a LuaTable value

Has anyone an idea, how to write a C# function which will return a LuaTable value (for example {1 = "example1", 2 = 234, "foo" = "Foo Example"}? All types I've tested are returning LuaUserData values which are non pair/ipairable. Thanks in…
Charlie Hopperson
  • 415
  • 1
  • 9
  • 23
3
votes
1 answer

Waiting x seconds before continuing while continuing to respond to user input and render frames

Background I am currently creating an XNA application that utilizes LuaInterface so that I can control the application with Lua scripts. What I Want I've noticed that a lot of things will probably be 'time' based in my development. Such things may…
Freesnöw
  • 30,619
  • 30
  • 89
  • 138
2
votes
1 answer

Pass Object to Lua Script from C#

I am using LuaInterface with C#, and have got everything set up correctly. What I want to be able to do is that when the script is started using lua.DoFile(), that the script has access to a Player object that I can send... Current Code: public…
ZeunO8
  • 422
  • 6
  • 25
2
votes
2 answers

Use . in a method registered with LuaInterface

I'm integrating LuaInterface into a c# program using LuaInterface. I want to be able to write scripts that can access C# methods in the program. The methods that it is accessing are in separate "subsystems" and I wanted to have the Lua method define…
A Jackson
  • 2,776
  • 7
  • 34
  • 45
2
votes
2 answers

LuaInterface - Compiling under .Net 3.5 / .Net 4.0 FileLoadException

A project of mine utilizes LuaInterface. I've begun migrating it from XNA to OpenTX, as well as rewriting it under .Net 4.0. I started moving my Lua class over, to find that i get an exception when debugging (FileLoadException) Mixed mode assembly…
rvIceBreaker
  • 21
  • 1
  • 3
2
votes
1 answer

Embedding lua in my C# application : require "luainterface" fails

I downloaded the newest version of LuaInterface from their site, and referenced LuaInterface.dll and Lua51.dll. The interpreter itself works fine, but when I try to require("luainterface"), I get this exception : error loading module 'luainterface'…
fingerprint211b
  • 1,176
  • 12
  • 24
2
votes
2 answers

Passing a C# byte array to LuaInterface

I have a byte array in my C# code that I need to pass into a LuaInterface instance. I can use pack() in Lua, pass the resulting string to C# and convert it with System.Text.Encoding.UTF8.GetBytes(), but going the other way doesn't seem to work. Is…
kyork
  • 713
  • 5
  • 14
2
votes
2 answers

How to call Lua functions from .NET

I use the LuaInterface library to run the lua in .net and it works fine. I could access the CLR via lua. But how to call Lua function from C#?
user90150
2
votes
1 answer

NLua (LuaInterface) - Calling a function

How is it possible to call a function when running a lua script using NLua (A LuaInterface fork)? For example, right now I have: lua.LoadFile("C:\\test.lua") lua.Call(); However, that just runs the script. Inside the script I have a custom…
user3865229
  • 125
  • 2
  • 9
2
votes
2 answers

import_type attempt to call global

I'm using the latest lua interface and trying to run this code luanet.load_assembly("Phoenix") luanet.load_assembly("Phoenix.Structures") NpcDialog = luanet.import_type("Phoenix.Structures.NpcDialog") function npc(request, client) local dialog…
Atef Ramadan
  • 105
  • 8
2
votes
1 answer

How to send a c# event to the working lua script?

i'm using c# and LuaInterface and i need to send an event from my c# code to the working script. For example, it may be a button_click that interrupts working lua script or chanhes its logic. So, how can i do something like this?
2
votes
1 answer

Return a Lua table from C# method without adding it to the global stack

I want to do something like this: table1 = myFunc("Arg1") table2 = myFunc("Arg2") for key,value in pairs(table1) do print(key,value) end for key,value in pairs(table2) do print(key,value) end I'm able to add a table to the global scope of Lua…
Warrick FitzGerald
  • 2,455
  • 3
  • 23
  • 31