lua

lua 64-bit transitioning issue

Hi, I really hope there is some help to get on this subject. Has anyone ever used lua in an application that needs to have both 32-bit and 64-bit support? We are currently transitioning to 64-bit but are having trouble with client compiled lua scripts that we can't recompile ourselves using the 64-bit version. So in effect we need to be...

Lua in Visual Basic.net

I'm trying to just get a VB.net app to be able to execute a lua script in a external file, and be able to add some functions to lua too, To do this I have this code: Imports LuaInterface Public Class Form1 Public luascripting As New Lua() Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Butto...

Help locate C sample code to read lua command line arguments

I am looking for sample code in C which reads Lua command line arguments. Any help? ...

Torrent library with .net or Lua bindings

I'm looking for a way to download torrents in a C# application. Ideally I would like bindings for a popular torrent library to .net, are there any? Alternatively (this is a bit of a long shot) the application already has Lua built in, so if there are Lua bindings I can also work with that. ...

Creating Timers in C++ using Lua

I was wondering whether the following setup would work for a small game: Lets assume I have the following functions registered to Lua like so: lua_register(L, "createTimer", createTimer); lua_register(L, "getCondition", getCondition); lua_register(L, "setAction", setAction); Where: (leaving the type checking behind) int createTimer(...

Struct containing std::string being passed to lua

I have working C++ code using swig which creates a struct, passes it to lua (essentially by reference), and allows manipulation of the struct such that the changes made in the lua code remain once I've returned to the C++ function. This all works fine until I add a std::string to the struct, as shown here: struct stuff { int x; ...

Python vs Lua for embedded scripting/text processing engine

For a project I'm currently working on, I'm looking to embed a scripting engine into my C++ code to allow for some extensibility down the line. The application will require a fair amount of text processing and the use of regular expressions within these scripts. I know Lua is generally the industry darling when it comes to embedded scr...

Why can't I use Set:union() instead of Set.union ?

Hello, I am learning Lua and I would rather use the colon (:) for methods. Unfortunately, it's not working everywhere. See my code: Set= {} local mt= {} function Set:new(m) local set= {} setmetatable(set,mt) for a,b in pairs (m) do set[b]=true end return set end function Set.union(a,b) local res=Set:ne...

Accessing Type Metatables Lua

Its obviously that getmetatable can access the metatables of several types: getmetatable("") getmetatable({}) getmetatable(newproxy(true)) However it appears as though you cannot get the metatable of other types (functions aside). There appears to be no way to access the metatable of numbers, booleans, or nil. I was also wondering i...

Questions about compiling Lua files.

Hi, I want to compile my lua files to LuaC (myfile.luac). I'm using the Scite for compiling Lua. I haven't started until now, I heard, that I cannot compile my lua files to a 64 bit binary luaC file on a 32 bit system. So how can I compile lua to 32 bit and 64 bit luaC on a 32 bit system, windows xp? Btw, are there any tipps for using L...

How can I pass varargs to lua files?

In World of Warcraft addons, a table is passed as the second vararg: -- This is often at the top of WoW lua files local AddonTable = select(2, ...) Is there a way to do that with regular lua? I'm attempting to write some unit tests with minimal changes to my current code. So far when I just use require, I can use select(1, ...) to get...

Getting API info from C to Lua?

Hello, how can I get a list of all C API functions with Lua? For example, there are plenty C functions in a game(Crysis) which can be called with Lua: g_gameRules.game:FunctionInC() There are many functions I know but how can I get all available functions? ...

Recommendations on Lua Interpreter for Java

I have a gui application written in java that requires the use of the lua scripting language. I looked at LuaJava but it seems to be giving me problems. Can you recommend a good lua interpreter for java, preferably a pure java implementation. ...

A good tutorial on wxlua

Hello. I'm trying to teach myself wxlua. There are alot of examples for it online but not so many tutorials. Most documentation is for wxwidgets and it's pretty thick. Any recommendations for a tutorial? I still get a bit confused on what steps in order I'd need to take in order to be able to place where controls go. A form builder li...

How to discover what is available in lua environment?

Many games these days make available some lua scripting, but this is universally undocumented. So let's say I can get a game to run my lua script (it's lua 5.1) - and the script can write what it finds to text files on disk. How much can I discover about environment the script is executing in? For example it seems I can list keys in ta...

How can i use Scons to build SWIG lua example?

I am trying to write an SCons script to build lua/embed3 example distributed with swig. Build instructions by makefile as follows: swig -c++ -lua -external-runtime swigluarun.h swig -c++ -lua -module example -o example_wrap.cpp example.i g++ -o embed3 embed3.cpp example_wrap.cpp example.cpp \ -llua5.1 -I/usr/include/lua5.1 In Scon...

Lua: require() not working on iPhone

Hi guys, I am working on a shooting game on iPhone and I need lua for scripting levels, enemies, and etc. So I wrote a bullet script like this: -- circular_bullet.lua local time_between_bullets = 0.2; ... function InitializeCircularBullet(objectName) ... end and an enemy script: -- level1_D2.lua require("circular_bullet.lua"); ....

How to store binary data in a lua string

I needed to create a custom file format with embedded meta information. Instead of whipping up my own format I decide to just use Lua. texture { format=GL_LUMINANCE_ALPHA; type=GL_UNSIGNED_BYTE; width=256; height=128; pixels=[[ <binary-data-here>]]; } texture is a function that takes a table as it sole argument. It th...

How do I build a game in C with actors programmed in Lua?

I want to build a strategy game using C and Lua. C++ is also an option. I would like to create an environment where a player can move around. In the same environment, other actors (programmed in Lua) should be able to move around. Their Lua code should control how they move. It sounds simple enough, but I wonder what would be a good de...

Lua or Python binding with C++

I have used Lua.NET on .NET platform and I could call the .NET class/object from Lua and I could call the Lua from .NET Lua API interface. I did the same with the IronPython. I knew the how the .NET binding works. Now I have a C++ project and I want to use the dynamic capabilities. I want to call C++ object which may not be possible fr...