View previous topic :: View next topic |
Author |
Message |
clayasaurus
Joined: 21 May 2004 Posts: 857
|
Posted: Fri Apr 08, 2005 1:23 am Post subject: lua! (updated dec 1th, 2005) |
|
|
I created some derelict compliant lua bindings!
http://svn.dsource.org/projects/warbots/trunk/derelict/lua/
http://svn.dsource.org/projects/warbots/trunk/derelict/lua/lua.d
http://svn.dsource.org/projects/warbots/trunk/derelict/lua/lauxlib.d
http://svn.dsource.org/projects/warbots/trunk/derelict/lua/lualib.d
http://svn.dsource.org/projects/warbots/trunk/derelict/lua/types.d
Tested on linux and windows, havn't had any problems yet.
As you can see I've kept the original #defines in comments because i'm not 100? sure they are converted right, though most are (evil macro functions).
but those macros saved a lot of getProc'ing.
I needed to create types.d to resolve circular dependencies between lua and lauxlib (they each had types each other needed). I used the lua 5.0.2 header files.
I'm sure the file needs touching up as I was just concerned as doing this as quickly as possible. i ran into 1 missing function that wasn't getProc'd and had a hell of a time finding it. there may be more.
anyway, should be a solid foundation for derelict lua!
edit: updated url locations, also forgot to mention that to load lua you use
DerelictLua_Load(); // using liblua.so
DerelictLualib_Load(); // these last two use liblualib.so
DerelictLauxlib_Load();
I'm not sure if it is best use one function, two, or three to load lua. I know I myself have forgotten to load that last two and then it takes a while for me to figure out what's wrong.
Also, a simple lua sample can be found here http://www.dsource.org/forums/viewtopic.php?t=678
edit: just wanted to say it works on windows too
Last edited by clayasaurus on Thu Dec 01, 2005 12:13 am; edited 5 times in total |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Sun Apr 10, 2005 4:20 am Post subject: |
|
|
Thanks, Clay! I've added this to the to-do list behind DevIL. |
|
Back to top |
|
|
dwlemon
Joined: 21 Jul 2006 Posts: 1
|
Posted: Fri Dec 01, 2006 1:51 am Post subject: |
|
|
I'm sorry to bump such an old thread, but I'd really like the Derelict version of these bindings but those links don't work.
clayasaurus, do you still have them? |
|
Back to top |
|
|
jcc7
Joined: 22 Feb 2004 Posts: 657 Location: Muskogee, OK, USA
|
Posted: Fri Dec 01, 2006 2:37 am Post subject: |
|
|
dwlemon wrote: | I'm sorry to bump such an old thread, but I'd really like the Derelict version of these bindings but those links don't work.
clayasaurus, do you still have them? |
Apparently, warbots was renamed to ArcGames, and the lua bindings were removed after revision 45. But through the magic of SVN, the files seem to be still available from dsource: |
|
Back to top |
|
|
clayasaurus
Joined: 21 May 2004 Posts: 857
|
Posted: Fri Dec 01, 2006 9:58 pm Post subject: |
|
|
Yea, I kind of gave up on them because I became disenfranchised with lua (stopped maintaining them a long time ago).
I'd recommend you'd save them somewhere yourself to make sure they don't get lost. They are probably using quite an ancient compiler version, and outdated version of lua.
There is also the dlua project on dsource.
When I'm ready to try scripting again, I'm going to give minid a chance. |
|
Back to top |
|
|
baxissimo
Joined: 23 Oct 2006 Posts: 241 Location: Tokyo, Japan
|
Posted: Wed Dec 06, 2006 6:16 pm Post subject: |
|
|
clayasaurus wrote: | Yea, I kind of gave up on them because I became disenfranchised with lua (stopped maintaining them a long time ago).
|
Lua deprived you of your right to vote? You should complain to your senator!
Or maybe you mean 'disenchanted'.
Heh heh. Gave me a chuckle, though.
But seriously, what soured you on Lua? |
|
Back to top |
|
|
clayasaurus
Joined: 21 May 2004 Posts: 857
|
Posted: Thu Dec 07, 2006 1:57 am Post subject: |
|
|
What I don't like about lua?
Just to get it to work, I had to have a weird system of globals set up and it seemed like a poor design. |
|
Back to top |
|
|
baxissimo
Joined: 23 Oct 2006 Posts: 241 Location: Tokyo, Japan
|
Posted: Thu Dec 07, 2006 2:20 am Post subject: |
|
|
clayasaurus wrote: |
What I don't like about lua?
Just to get it to work, I had to have a weird system of globals set up and it seemed like a poor design. |
Were you writing an app with it?
I used it to add a little bit of scripting functionality to an app, and it seemed decent for that.
It seemed to me to have a little of the Lisp problem though, where on the plus side it's this very flexible and general tool that can do most anything, but on the minus side you have to reinvent all the wheels you want to use yourself. Like when it comes to classes -- there isn't just a "Class" type. There's all kinds of ways to achieve something Class-like, but nothing predefined for you that just works. I seem to recall it was similar for supporting packages. |
|
Back to top |
|
|
|