As a long time World of Warcraft player, and a passionate developer I have decided that I would like to combine the two and set about developing some addins. Not only to improve my gameplay experience but as a great opportunity to learn something new.
Does anyone have any advice on how to go about starting out?
Is there an IDE one can us...
Why is Lua considered a game language?
I have been learning about Lua in the past month and I'm absolutely in love with the language, but all I see around that is built with Lua are games. I mean, the syntax is very simple, there is no fuss, no special meaning characters that makes code look like regular expressions, has all the good th...
It looks like BREW 4.0 will have Lua included. But is it possible to use Lua on older BREW 3.0 (or even BREW 2.0)?
...
I am trying to build out a useful 3d game engine out of the Ogre3d rendering engine for mocking up some of the ideas i have come up with and have come to a bit of a crossroads. There are a number of scripting languages that are available and i was wondering if there were one or two that were vetted and had a proper following.
LUA and S...
This is a Tips & Tricks question with the purpose of letting people accumulate their patterns, tips and tricks for Lua.
Lua is a great scripting language, however there is a lack of documented patterns, and I'm sure everyone has their favorites, so newcomers and people wondering if they should use it or not can actually appreciate the ...
Do you use Luabind, toLua++, or some other library (if so, which one) or none at all?
For each approach, what are the pro's and con's?
...
I've got a Lua program that seems to be slower than it ought to be. I suspect the issue is that I'm adding values to an associative array one at a time and the table has to allocate new memory each time.
There did seem to be a table.setn function, but it fails under Lua 5.1.3:
stdin:1: 'setn' is obsolete
stack traceback:
[C]...
I'm writing a function to find triangle numbers and the natural way to write it is recursively:
function triangle (x)
if x == 0 then return 0 end
return x+triangle(x-1)
end
But attempting to calculate the first 100,000 triangle numbers fails with a stack overflow after a while. This is an ideal function to memoize, but I want a...
When I do an "os.execute" in Lua, a console quickly pops up, executes the command, then closes down. But is there some way of getting back the console output only using the standard Lua libraries?
...
Recently, Lee Baldwin showed how to write a generic, variable argument memoize function. I thought it would be better to return a simpler function where only one parameter is required. Here is my total bogus attempt:
local function memoize(f)
local cache = {}
if select('#', ...) == 1 then
return function (x)
...
In Lua, using the = operator without an l-value seems to be equivalent to a print(r-value), here are a few examples run in the Lua standalone interpreter:
> = a
nil
> a = 8
> = a
8
> = 'hello'
hello
> = print
function: 003657C8
And so on...
My question is : where can I find a detailed description of this use for the = operator? How d...
I am writing a graphics application in Java. Eventually I would like to build in a scripting language so things are programmable. Which language library do you recommend?
Likely suspects are:
Rhino (JavaScript)
JRuby (Ruby)
Jython (Python)
Less likely candidates are:
Whip up my own language using JavaCC
LuaJava (Lua)
Groovy
JavaFX...
I've got things minimally working in Scite... and a quick browse tells me that there is an Eclipse plugin and several other standalone editors, in addition to other general purpose editors with Lua capability.
Out of that, what do people recommend? Particularly, what do people who program primarily in Lua like to use?
Edit: Thanks for ...
Puzzled by the Lua 5.0 documentation references to things like _LOADED, LUA_PATH, _ALERT and so on (that I could not use in Lua 5.1), I discovered all of those have been removed and the functionality put elsewhere. Am I right in thinking that the only one global variable left in Lua 5.1 is _VERSION?
...
I asked a question about Lua perfromance, and on of the responses asked:
Have you studied general tips for keeping Lua performance high? i.e. know table creation and rather reuse a table than create a new one, use of 'local print=print' and such to avoid global accesses.
This is a slightly different question from Lua Patterns,Tips ...
I need to find a good Lua to JavaScript converter; lua2js on luaforge.org is out of date (3 or so years old and looks like it doesn't work on Lua 5.1) and I haven't yet found anything on Google.
Does anyone have any experience with any other converters out there? It should work on Lua 5.1 and preferably be .NET based, but .NET is not a ...
I have an single threaded, embedded application that allocates and deallocates lots and lots of small blocks (32-64b). The perfect scenario for a cache based allocator. And although I could TRY to write one it'll likely be a waste of time, and not as well tested and tuned as some solution that's already been on the front lines.
So what ...
Is there an easy way to create standalone .exe files from Lua scripts? Basically this would involve linking the Lua interpreter and the scripts.
I believe it is possible (PLT Scheme allows the creation of standalone executables in the same way), but how, exactly?
...
I am taking my first steps programming in Lua and get this error when I run my script:
attempt to index upvalue 'base' (a function value)
It's probably due to something very basic that I haven't grasped yet, but I can't find any good information about it when googling. Could someone explain to me what it means?
...
I've had success with LuaSocket's TCP facility, but I'm having trouble with its FTP module. I always get a timeout when trying to retrieve a (small) file. I can download the file just fine using Firefox or ftp in passive mode (on Ubuntu Dapper Linux).
I thought it might be that I need LuaSocket to use passive FTP, but then I found tha...