Scripting language help

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Joseph1337
Posts: 4
Joined: Sun Feb 03, 2008 10:06 am

Scripting language help

Post by Joseph1337 »

Hello

I recently started a small project with Irrlicht with no game programming experience. I created some code, almost all object based. Now I`m wondering - does Lua or Python can call c++ methods? If yes then could you say where I can find a decent tutorial on Lua/C++ or Python/C++(based on which can call C++ methods) tutorial.

Thanks
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

Last edited by MasterGod on Mon Feb 04, 2008 7:37 pm, edited 1 time in total.
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
Joseph1337
Posts: 4
Joined: Sun Feb 03, 2008 10:06 am

Post by Joseph1337 »

Does that mean that I can`t call methods with Lua or Python? (This angelascript isn`t so bad though)
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Calling C++ functions from Lua. I can't find anything on calling a method, nor can I figure out how you'd specify an object (so you'd have to call a class static method). Sorry.

I don't have much experience with either, but I have a mild leaning towards gamemonkey rather than lua.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

Well rogerborg, check AngelScript. It can handle objects and methods and functions and the syntax is C\C++'s..
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

That does look very impressive - from the intro text, anyway. ;)

Does it do what it says on the tin?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
shogun
Posts: 162
Joined: Wed Sep 05, 2007 11:02 am
Location: inside

Post by shogun »

If you want to call C++-methods from Lua, check out Luabind.
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

rogerborg wrote:That does look very impressive - from the intro text, anyway. ;)

Does it do what it says on the tin?
I've downloaded the examples and it works pretty nice. I haven't used it yet but I plan to integrate it with my project, unless I'll find a better one which I doubt I will..
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
buhatkj
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am
Contact:

cinvoke

Post by buhatkj »

i found a nifty thinger called C/Invoke, whose purpose is to work in a similar manner to P/Invoke, which was used for instance to do the Irrlicht CP wrapper for .NET. I got it working up to the point where my lua runtime can use it, and Im trying to adapt the IrrlichtW Wrapper from Irrlicht CP to DE-Object-Orient Irrlicht so I can use it this way. Yeh, I might be crazy, but i like a few things about lua a lot, and I like this method better than lua's native C calling support which involves a whole bunch of annoying stack-parameter-passing BS. I wants me some damn coroutines and lightweight threads....
heres a linky http://www.nongnu.org/cinvoke/lua.html
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
Post Reply