luainterface

LuaInterface and 64Bit

丶灬走出姿态 提交于 2020-01-14 03:11:11
问题 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 point me to a 64bit Compiled LuaInterface.dll, or is there any alternative to the LuaInterface that can be used, because LuaInterface is extremely useful and i dont think i would be able to write a more extensive interface by myself using lua51. (I

How to implement a Lua container (virtual file system) module loader in C#

时光怂恿深爱的人放手 提交于 2020-01-01 03:41:28
问题 Sounds a little bit scary isn't it? Some background information, I want to load a tar archive which contains some lua modules into my C# application using LuaInterface. The easiest way would be to extract these files to a temp folder, modify the lua module search path and read them with require as usual. But I do not want to put these scripts somewhere on the file system. So I thought it should be possible to load the tar-archive with the #ziplib I know there are a lot of lua implementations

C# external library (Lua) call problem

我怕爱的太早我们不能终老 提交于 2019-12-29 01:01:27
问题 I'm new to programming in C# (VS2010) .Net (4.0) and I'm encountering I couldn't solve by myself since some days already. I'm using an external scripting language (Lua) in my C# code. To do so I use LuaInterpreter built for .Net 4.0 First try: The project is a console application -> the program works fine when I try to call a Lua class. Second try: The project is a class Librrary COM used from Excel -> The class library compile fine and my user defined functions work fine within Excel. But

Wait for Asynchronous Event in Lua

谁说我不能喝 提交于 2019-12-24 22:47:32
问题 I have a library in Lua that creates and parses data packets for a protocol. When I send a packet out, I'm expecting a reply back from the destination that is then parsed into a table. I'm trying to write a wrapper around this library so that I can make a function call like the following: result = SendUnicast(dest,packetData) and have the parsed response table returned to result. My problem is two fold: 1) The incoming message comes in asynchronously and on a different thread than the

Pass Object to Lua Script from C#

拟墨画扇 提交于 2019-12-24 12:18:43
问题 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 static void RunQuest(string LuaScriptPath, QPlayer Player) { QMain.lua.DoFile(LuaScriptPath); } But as you can see the script will not have access to the Player object. 回答1: I see two options. The first one is to make your player a global variable for

Passing Arbitrary Arguments From C# to Lua Functions

耗尽温柔 提交于 2019-12-13 04:59:27
问题 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 LuaFunction.Call(params object[] args) . I have created a wrapper function that catches exceptions from the library and formats them for display on the in-game console window. I am trying to call a lua function, but it is not receiving the arguments. This is

Return a String with LuaInterface

爷,独闯天下 提交于 2019-12-12 03:13:55
问题 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 a console line, rather than a string - which, as I said, is fine for console applications, but I want to add it to an output buffer as a string so I can display it in-game, rather than in a console window. I apologize if this is confusing -

LuaInterface: add a table to the script scope

可紊 提交于 2019-12-11 21:17:25
问题 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 pairs() in the script) //lua["test"] = new { A = 1, B = 2 }; /// another option /// but building this string is a PITA (actual string is nested and long). lua.DoString("test = { A = 1, B = 2 }"); // So I have to do this lua.NewTable("test"); ((LuaTable)

Read nested Lua table who key is a System.Double

主宰稳场 提交于 2019-12-11 08:54:57
问题 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, ["count"] = 20, }, [10021] = { ["row"] = 83, ["count"] = 3, }, [10075] = { ["row"] = 927, ["count"] = 15, }, } } I can successfully foreach the entries under inventory, by opening that table with: LuaTable tbl = lua.GetTable("DB.inventory"); foreach (DictionaryEntry de in tbl) ... What

Mapping C# classes to Lua functions via dll

一个人想着一个人 提交于 2019-12-11 03:06:34
问题 In my "LuaTest" namespace I have a class called "Planet". The C# code reads like this: using System; using System.Collections.Generic; using System.Linq; using System.Text; using LuaInterface; namespace LuaTest { public class Planet { public Planet(string name) { this.Name = name; } public Planet() : this("NoName") { } public string Name { get; private set; } public void printName() { Console.WriteLine("This planet's name is {0}", Name); } } } Then I built LuaTest.dll and copied this file to