axe.lua 1.24 (inofficial)

BlitzMax Forums/BlitzMax Module Tweaks/axe.lua 1.24 (inofficial)

Rozek(Posted 2007) [#1]
Hello!

I've just published a new version of axe.lua which corrects a bug associated with the "long" data type.

This version is inofficial and therefore not (yet) available on BRL's module server.

If you already have my previous version, you may just download the new BlitzMax source from http://www.Andreas-Rozek.de/BlitzMax/lua.bmx . Otherwise, you should grab the complete version (which includes Lua 5.1.2 itself) from http://www.Andreas-Rozek.de/BlitzMax/lua.mod.zip

lua.bmx should be copied to <blitzmax-installation-directory>/mod/axe.mod/lua.mod. The files within the ZIP archive should be extracted to the same directory. After unpacking, you should "Build Modules" and "Document Modules" from within your BlitzMax IDE.

Thanks to Gabriel who found and reported the bug.

Please, report any bugs you find to the author.


Gabriel(Posted 2007) [#2]
Great stuff, thanks Andreas. I'm surprised more people aren't using this module, as it's incredibly useful and the basics, at least, aren't nearly as difficult to pick up as I expected. It's going to be a huge help for my current project anyway, as I can already control the GUI with scripts, and I will probably script missions and levels with it too. Can't thank you enough.


Rozek(Posted 2007) [#3]
Thanks for the honour, Gabriel!

But I should mention, that the base for my (inofficial) version has been built by other people like Simon Armstrong, Thomas Mayer and Noel Cower.

My part was just to remove a few bugs and keep the module up-to-date (and as complete as possible).

I'm still a BlitzMax beginner (without even a single *real* - i.e. full-blown - BlitzMax application). And, presumably, I will keep that state as my primary intent is to use BlitzMax/MaxGUI as a (wonderful!) runtime environment for Lua.


Rozek(Posted 2007) [#4]
Hello!

I've just published a new version of axe.lua.

This release does not contain any source code modifications! Instead, the documentation has been extended and now also includes instructions on how to instantiate a Lua VM, run Lua scripts or access BlitzMax features from within Lua.

If you are already familiar with these concepts, there is no need to download and install this update.


Ratchet(Posted 2007) [#5]
I alwaly got a endless list of errors if I try to compile it:

D:/Anwendungen/BlitzMax/mod/axe.mod/lua.mod/lua-5.1.2/src/lstate.c:209: `NULL' u
ndeclared (first use in this function)
Build Error: failed to compile D:/Anwendungen/BlitzMax/mod/axe.mod/lua.mod/lua-5
.1.2/src/lstate.c

Thats just two of the many many many errors. What's wrong here?


Rozek(Posted 2007) [#6]
Sven,

NULL is a very basic C item - if your compiler complains about such basic items, it can't probably include "stddefs.h", which would mean that your compiler environment for BlitzMax is broken.

See the "sticky" threads about MingW at the top of this forum for instructions on how to set-up the compiler properly.


Gabriel(Posted 2007) [#7]
But I should mention, that the base for my (inofficial) version has been built by other people like Simon Armstrong, Thomas Mayer and Noel Cower.

Indeed, and I thank them for their excellent work too. Nevertheless, I couldn't understand word one of it until you started maintaining the module and explained the basics to me, so without your work on this, I definitely wouldn't be using it. And it's just so much fun being able to access your game engine from Lua.


Rozek(Posted 2007) [#8]
Gabriel,

thanks for the honour!

Let's agree on the fact, that the work of *all* participants was important (in fact, it's been *this* interface, that I've been come across during my research for a platform I could use for Lua application programming, which drew my attention to BlitzMax! Without this interface, I would not have been bought BlitzMax/MaxGUI at all!)

Additionally, it seems to turn out that a proper documentation is equally important to a proper implementation (a fact, I still have to take into account when working on BlitzLua)


Ratchet(Posted 2007) [#9]
Why is the declaration of luaL_error a comment?


Rozek(Posted 2007) [#10]
Sven,

luaL_error has a variable argument list - and I do not know how to describe such an argument list in BlitzMax.

There are several such API functions, none of them has been declared under BlitzMax.


Otus(Posted 2007) [#11]
Someone who knows more about this should explain the modules at http://en.wikibooks.org/w/index.php?title=BlitzMax/Modules/Axe/Lua and http://en.wikibooks.org/w/index.php?title=BlitzMax/Modules/Axe/LuaScript

Rozek, you could easily just copy&paste most of the documentation you have written.


Steffenk(Posted 2007) [#12]
Sorry for digging up such an old topic.
I've played around with LUA for some hours now and wanted to announce that i've written a little tutorial for it in the Blitzmax Wikibook, as requested.

http://en.wikibooks.org/w/index.php?title=BlitzMax/Modules/Axe/Lua

I've experienced axe.LUA to be quite hard to learn by using just the module help and the LUA documentation, so i hope this will be a help to some people. I'll try to expand it if i go deeper into LUA sometime.


nino(Posted 2007) [#13]
Big lua fan here. Your tutorial is solid although some of the more difficult tasks could use some light. These include pushing and consuming tables, error handling, debugging, adding or removing libraries from luaL_openlibs().

The last of these (removing libraries) can be a real concern if you are allowing users to mod your app/game via lua and share scripts with each other. The os library could inflict some serious and permanent damage to a users compute if it is used maliciously. You can remove it by commenting out this line
{LUA_OSLIBNAME, luaopen_os},

in file src/linit.c
I would also be weary of the io library if you don't need it.

Hope to see everyone at lua workshop 08...
http://www.lua.org/wshop08.html