lua

Regex to match 2 different parts of a line

I'm working in lua, and i need to match 2 parts of a line that's taken in through file IO. I'm inexperienced with regexes and i'm told lua doesn't have full regex support built in (but i have a library that provides that if need be). Can someone help me with building regexes to match the parts necessary? "bor_adaptor_00.odf" 3.778 ...

Split string in lua?

I need to do a simple split of a string, but there doesnt seem to be a function for this, and the manual way i tested didn't seem to work. How would i do it? ...

How to get sponsorship from Microsoft research?

I have learned that Lua.NET was sponsored by Microsoft Research. How can one contact them and ask for sponsorship for research? Has anyone any experience in it? ...

Which ingame scripting language should I support?

The ingame script will control NPC/AI logic. If I were to implement ingame scripting feature which language should it support? JavaScript (builtin browser support) TCL (interpreter in java) Lua (popular) Squirrel CSI Other Keep in mind my implementation will run on multiple platforms like .net, flash, javascript and java. What...

Lua bindings: table vs userdata

When making Lua bindings for C++ classes, should I return tables or userdata objects? Does anyone know any of the pros and cons for each method? ...

Iterating through a Lua table from C++?

I'm trying to load tables from Lua to C++ but I'm having trouble getting it right. I'm getting through the first iteration just fine but then at the second call to lua_next it crashes. Any ideas? Lua file: level = { 1, 2, 3, } C++ file - First I did this: lua_getglobal( L, "level" ); for( lua_pushnil( L ); lua_next( L, 1 ); lua_...

Obtaining a pointer to Lua object instance in C++

I am using Luabind to expose a base class from C++ to Lua from which I can derive classes in Lua. This part works correctly and I am able to call C++ methods from my derived class in Lua. Now what I want to do is obtain a pointer to the Lua-based instance in my C++ program. C++ -> Binding class Enemy { private: std::string name; pu...

How can I share data between C++ and Lua?

I have been looking for tutorials demonstrating how to share a C++ object with Lua using the API. Most tutorials just show how to export a class. I would like to start very simple and expose a variable (say int myVar = 5) in such a way that a change in Lua will be reflected in the C++ application. Does anyone know any good tutorials ar...

Embedded Lua "print" not working in debug mode from Visual Studio

Hi, I am using Luainterface 2.0.3 to embed Lua in a c# application. Everything is working fine, except in visual Studio's debug mode, the Lua's print function does not get written to the console (nor to Output). using System; using LuaInterface; namespace Lua1 { class Program { static void Main(string[] args) { ...

Exposing C# objects to Lua scripting

Hi, I'm looking into adding scripting to my C# application. I've been debating between Lua and C# (through CSharpCodeProvider). Regardless of which language I use, I need the script to be able to access/manipulate objects/arrays in my main application. With C# I should be able to expose my objects and interface functions without too ...

Are there any working Lua plugins for Eclipse Galileo?

I do a lot of work in Lua and work primarily in Eclipse Galileo. Unfortunately, there doesn't appear to be a working plugin for syntax highlighting. I've tried pretty much all available versions of LuaEclipse and LunarEclipse (including beta previews) but has gotten me nowhere. In both cases I get errors while installing them, referrin...

Lua's bytecode specification

Can anyone tell me where to find Lua's bytecode specification? I've been searching for 15 minutes, and I can't find anything. ...

SWIG / Lua: Determine member field data type

SWIG graciously provides the swig_type() function to get a string representation of the data type of a passed userdata object. However, in the case of member fields, SWIG and Lua consider those to be simple "number" items and so prints only "number" instead of the data type's name. e.g. typedef num_years int; class Person { public...

Template casting issue

I seem to be getting an error in the below code when I attempt to cast to a template of class T, when T is of type float. I have realized already that a type of int functions correctly, because the following is valid syntax: char* str = "3"; int num = (int)str; The same is not true of float. I'm wondering if there is a way to stop th...

How can I load and execute a lua file from within another lua file.

I have a lua script which is run using the command line interpreter, the script needs to load a table from a file. The table is stored like this: create_object_action = { reflexive = true, which_base_type = 29, how_many_min = 1, how_many_range = 0, velocity_relative = false, direction_relative = true, random_...

How to use LuaInterface on Mono/Linux

When I try to use LuaInterface on Mono on Linux (using Mono 2.0 on Ubuntu 9.04) I get the following exception: ** (ParallelTasksSimulator.UI.exe:8599): WARNING **: Method ':.DoDllLanguageSupportValidation ()' in assembly '/home/ulrich/test/Debug/lua51.dll' contains native code that cannot be executed by Mono on this platform. The as...

Resource for learning Lua to use with C++?

So I have heard that Lua is a good scripting language that ties into C++. Does anyone know some good resources for picking it up, for someone with lots of C++ experience? ...

Passing 2d array to function in Lua

It is possible to pass 2d array to a function as a paramter ? I initialized an array like this : tab={} for i=1, 10 do tab[i]={} for z=1, 10 do tab[i][z]= 0 end end and i have function like this : function foo(data) ... x = data[i][z] -- here i got error ... end The gave the error message attempt to...

Using Lua for working with excel.

I am planning to learn Lua for my desktop scripting needs. I want to know if there is any documentation available and also if there are all the things needed in the Standard Lib. Thanks a lot in Advance, Animesh ...

How to include lua scripting language into C++ XCode?

I have successfully compiled lua in my mac. It works. It runs. Now, I want to mix it with C++ in XCode. So I looked up in the Linked Library, the usual place to add more libraries in XCode. But of course, lua isn't there. Now, how do I tell XCode the existence of lua so that the program can include lua.h correctly? ...