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
0 answers

LuaInterface error loading module(Lua for Windows is OK)

While I DoFile: Lua luaVM = new Lua(); luaVM.DoFile("test.lua"); This is the error I got. An unhandled exception of type 'LuaInterface.LuaException' occurred in LuaInterface.dll Additional information: error loading module 'mytestlib' from file…
Peng Zup
  • 1
  • 4
0
votes
2 answers

LuaInterface not calling a method

I'm trying to implement lua scripting in my C#.NET program, but when I execute the code, one of the methods is not been executed. Here is the class: namespace Program1 { public class LuaFunctions { Client Client { get; set; } …
Kyore
  • 388
  • 2
  • 7
  • 29
0
votes
2 answers

C# Luainterface two dots

Is there any way to change the access to my C# object methods in Lua by turning two dots into one? I want to change this: Object:DoSomething(); Into this: Object.DoSomething(); Without getting any errors. Any ideas? Thanks in advance.
0
votes
1 answer

Register functions without using them "Object reference not set to an instance of an object."

I have an IRC Bot in C# and I want to use Lua Scripting for the moment. On bot startup I want to register functions, and detect if a new file has been added then load it. I did the new file / reload scripts function already, but when I hit run I get…
Brandon Palmer
  • 313
  • 2
  • 11
0
votes
1 answer

LuaInterface: Call System.Encoding.UTF8.GetBytes from Lua Script

I am using LuaInterface to use .NET types in Lua. I wanted to showcase this ability by using the Cryptography classes from .NET. However, in order to pass a string to an RSACryptoProvider, I need to convert it to an array of bytes beforehand. This…
Henrik Ilgen
  • 1,879
  • 1
  • 17
  • 35
0
votes
1 answer

Instantiating C# Classes in Lua

I am writing a scripting engine for my game using the LuaInterface library. I am getting an error when attempting to instantiate the class in Lua. The error is: "./Scripts/sv_worldgen.lua:2: attempt to call global 'Campfire' (a string…
selkathguy
  • 1,171
  • 7
  • 17
0
votes
3 answers

Passing Arbitrary Arguments From C# to Lua Functions

I have discovered the cause of the issue. An answer has been posted below. EDIT: The problem has changed, please see "The problem" section. I am using LuaInterface. The generic call for lua functions using this library has this signature…
selkathguy
  • 1,171
  • 7
  • 17
0
votes
1 answer

luainterface problems

I have some problems with C# luainterface library: 1. So I load a script and extract its functions like that: LuaFunction function = lua.GetFunction("Update"); But what if I load two different scripts that contains functions with the same name.…
0
votes
1 answer

.Net LuaInterface Hook system / Events

Wondering if it where posible to create a hooking system in .Net with LuaInterface This system would be like Garry's Mod Hook.Add("HookName", "CustomName", Function() print("Called every time HookName is called) end I am dead in my tracks with…
0
votes
1 answer

C# LuaInterface How to get System.String from a Lua string

I recently started using LuaInterface in order to be able to run Lua scripts from a C# program. I wrote a test script which returns a string: teststring = "PRIVMSG #```` : SUCCESS!" return testring I then try and add it to a C# Queue by…
Zero One
  • 1
  • 2
0
votes
1 answer

Return a String with LuaInterface

So, I'm trying to implement Lua as a scripting language in C#. It's simple enough, really, if you use it as part of a console application. But I want to be able to create a game console within XNA. The problem is that Lua.DoString() seems to return…
bpunsky
  • 73
  • 8
0
votes
1 answer

Read returning parameters when calling a lua function using LuaInterface

I am trying to handle the parameters returned from lua when I call DoString: object[] retval = lua.DoString("some_lua_function()"); The luafunction returns nil, true or false as first parameter and a string as second parameter. What is the best way…
0
votes
1 answer

LuaInterface: How to dump a LuaFunction for serialization

I try to save/serialize a Lua state. I know, that I had to save/serialize all globals, which I find in _G, but didn't know how to save/serialize the LuaFunctions I find. I tried to use string.dump, but that delivers only a string with the Lua…
user1829325
  • 108
  • 6
0
votes
1 answer

Handle syntax errors in LuaInterface

I am trying to integrate a Lua Scripting interface into my C# project by using LuaInterface. It works as expected if I execute syntactically correct code, but as soon as a syntax error (or any other error as it seems) is introduced to the script an…
M.Stramm
  • 1,289
  • 15
  • 29
0
votes
2 answers

Lua No such type: loadassembly

am trying to script using Lua :- using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using LuaInterface; namespace Scripting { public class LuaParser { Lua lua; …
Abanoub
  • 3,623
  • 16
  • 66
  • 104