🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Lua and C++

Started by
7 comments, last by Austrian Coder 21 years ago
Hi! I have here my own engine and want to use lua for scripting. Now i want to know if somebody could recommend a good solution. I want to use OOP fo C++ in Lua. Thanks, Christian
Advertisement
http://www.gamedev.net/reference/list.asp?categoryid=76#118


[My site|SGI STL|Bjarne FAQ|C++ FAQ Lite|MSDN|Jargon]
Ripped off from various people
[size=2]
The book "Game Scripting Mastery" by LaMothe is excellent.

-- Steve --
-- Steve --
Good suggestions above.

I''d also like to add that ToLua, or SwigLua work great for generating bindings automatically, even for classes. It could get you some visible results pretty quick, and still a pretty customizable solution.
I''d check out lua-users.org for some basic "how to bind C++ and Lua" stuff, as well as the Lua site (lua.org). Beyond that, if you''re feeling ambitious, read Scott Bilas''s article "A Generic Function Binding Interface" in one of the Game Gems books or on his website at http://www.drizzle.com/~scottb/publish/.

It might be overkill for your project, but for the one we''re working on now we''re using something similar that has been very useful.

If you want to go that route I can answer any questions you might have on the implementation of such a thing. You can mail me jpetrie at mac dot com.

-- Josh Petrie
Lead Engineer
Scientific Ninja Studios
DigiPen Institute of Technology
Lua in my opinion is the perfect solution to inbed a scripting language in an engine, in fact thats what i''ve done.

I actually looked into quite a few, I was even tempted to use python for a while but I favoured lua because of its simplicity and size compared to python.

You could always try create your own also or mess around with lex yacc crap but its a lot more hassle believe me.

All the links given above are very good, I also came across this one on my travels.

http://gamestudies.cdis.org/~amatheson/LUA-Part01/Part01-section01.html

Should show you enough for you to start running with it.
Have fun,
PantherBoy
By the way I want to add creating your own solution will probably be a bad idea.

I worked at place where they did just this, for the first year all was good but after that people started to complain about it all the time. It just got too difficult to maintain and extremly hard to upgrade\modify.

Unless your an excellent software designer or brave don''t do this imo.

ToLua seems to bee a good solution. I also have found luabind. http://www.drizzle.com/~scottb/publish/ is also a good link. I will try some stuff and then take teh easierst and best solution.
Is there already an updated toLua version for Lua 5 Final? When I first started looking for something like this, there wasnt, so I continued searching and finally found LuaPlus.

Now we work with LuaPlus and are pretty satisfied with what it offers (including a working remote debugger and VS.NET integration).

Have a look at http://www.workspacewhiz.com/LuaPlus



LightBrain website relaunched, BomberFUN only USD 9.99
visit http://www.lightbrain.de

This topic is closed to new replies.

Advertisement