Jump to content
  • Advertisement
Sign in to follow this  
ricekrispyw

LuaBind

This topic is 4872 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm wondering about using LuaBind in my current project, but I've never *gasp* used real scripting before. By real scripting, I mean anything but loading a set of actions that define something, an animation sequence for instance, and I was wondering just how much work it takes to use LuaBind in a project. Here's the meat of the post: Could someone post some sample code of what it takes to use LuaBind in a basic way. Say, create a class in C++, and call a member function in LuaBind. Or, define a class in C++ and extend it in LuaBind. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
LuaBind seems to be nice, I've never tried. However, toLua looks even nicer (less extra work to do), but I've never tried that either. I suggest you take a look at both and then decide which to use.

-Richardo

Share this post


Link to post
Share on other sites
Cool. Thanks. I've glanced at the docs for LuaBind, but I was wondering if there was something maybe they weren't telling. I'll take a closer look.

I've never heard of toLua. Is it also on SF? Well, I'll just [google] it.

Thanks, y'all.

Share this post


Link to post
Share on other sites
toLua does look nice, but I see nothing about deriving lua classes from C++ classes (or even creating lua classes in the first place...)

I can't find out how to build LuaBind. I'm on WinXP, with VC6. How do I do it? And how much of boost do I need? The entire monstrosity?

Help me, please.

Share this post


Link to post
Share on other sites
Classes in lua are only faked (using an additional hidden parameter), and deriving classes from C++ is not directly possible, you can however map functions to c-functions in Lua and thus using C++-classes in Lua.

And as far as I know, regular Lua was very easy to get up and running.

Share this post


Link to post
Share on other sites
Quote:
Original post by ricekrispyw
toLua does look nice, but I see nothing about deriving lua classes from C++ classes (or even creating lua classes in the first place...)

I can't find out how to build LuaBind. I'm on WinXP, with VC6. How do I do it? And how much of boost do I need? The entire monstrosity?

Help me, please.

Instead of building it, you can just include the cpp files in your main project.. Obviously, that's not as clean as compiling it into a lib but it works. I'm not sure how much of boost you need, but imo you should just get the whole package anyway, there are a lot of very useful things in there (and I think the headers are enough for luabind, so you don't need to build that either).

Share this post


Link to post
Share on other sites
Hmmm... OK. Hmmm.

I really don't want the tremendous beast that is boost right now. I realize it's really useful, but I'm not using it, and I would hate to have it just for LuaBind. I have seen nothing else that lets you derive Lua classes from C++ ones (which you can do in LuaBind), so I might not have a choice. Oh, well. Thanks.

Share this post


Link to post
Share on other sites
LuaBind is very nice, but it is black magic that works but most programmers do not understand how it works. Try to track down where the code that passes parameters between the interpreter and your code, try to understand it, and try to debug it. Very few people really understand what REALLY is going on on LuaBind (or Boost.Python), which means that if you ever need you debug something internally on the glue layer you need to find somebody that can help you out.

Share this post


Link to post
Share on other sites
Quote:
Original post by ricekrispyw
And how much of boost do I need? The entire monstrosity?


From the introduction:

Quote:

It requires boost 1.30.0 to be installed (only boost headers).


I'd hazard that you need only the headers.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!