scripting engine libraries

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
jvff

SWIG

Post by jvff »

As pointed out above, SWIG is a tool for scripting. What I can't understand is what it does. I read at the site that it translates C++ code into other languages code. I still don't see how I can use SWIG as an intermediate for executing scripts in my c++ program. Could anyone please give me a basic explanation? Thanks in advance,

JVFF

:)
stodge
Posts: 216
Joined: Fri Dec 05, 2003 5:57 pm

Post by stodge »

SWIG doesn't translate C++ into something else. It generates extra code (bindings) to allow scripting languages, such as Python, to access variables, types and enums (C/C++) and instances of classes (C++).

You should download SWIG and take a look at it.
nebukadnezzar
Posts: 25
Joined: Tue Dec 02, 2003 7:45 pm
Location: Germany - Bornheim

Post by nebukadnezzar »

I want to integrate a console in my game (like in q2, hl ..).
(means to input commands and then a c function is called)
(and is it possible to use if clauses??)
Should i write my own parser or is there an parser which is lightweight (fast) for doing this stuff??
stodge
Posts: 216
Joined: Fri Dec 05, 2003 5:57 pm

Post by stodge »

keless wrote:
stodge wrote:As I said before, look at the source here:

http://habitat3d.sf.net

The source is messy and the demo doesn't work, as the image files were created under Linux and don't seem to load under Windows. But the source for the ScriptManager is in the Core directory.

Oh and it only supports Lua 4 and toLua.
I dont see a source download on that page, or the 'project page'
Are you blind? The fourth line down has a link to the Sourceforge page. From there you can browse CVS or download using CVS.
buhatkj
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am
Contact:

wow...cool it...

Post by buhatkj »

hey dude...take it easy, maybe he just missed it...no need to get angry....
-ted
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
AngelCode

AngelScript

Post by AngelCode »

Please don't dismiss AngelScript so quickly. I'm the author of it, and I am working hard on making it as easy to use as possible. If there is something missing, just tell me and I'll do what I can to include it.

I believe that what buhatkj said earlier in this thread is not entirely true anymore, as he himself said that AngelScript has progressed a lot since he last looked at it. (ref http://irrlicht.sourceforge.net/phpBB2/ ... php?t=1390).

I, or AngelScript, doesn't force you to load the dll manually. It is just that I haven't distributed the lib file for doing it automatically. AngelScript can be linked statically as well (although as it currently is LGPL it would mean that you would have to make your source open as well, the license will be changed so that this will no longer be necessary). The project files for compiling AngelScript into both static library and dll is included with the SDK.

AngelScript is also supported on both Linux and Win32. Although I as the author can't give help with the Linux part if you need it as I don't have any experience with it. Other programmers have helped me make sure the library is working on that system.

As AngelScript is still a very young library it doesn't have any utilities for automatic binding, but I'm sure that you'll find that the binding is not that difficult to do. AngelScript can directly call both global functions and class methods, so you will not have to write any proxy functions. It obviously allows registration of classes as well, with attributes and members.

Please give AngelScript a chance, take a look at it, and if it doesn't suit your needs today, come back later on to see how it is developing. As I said before, tell me if there is anything you think is needed in AngelScript. Your feedback is the only way I have to make AngelScript the best it can be.

Regards,
Andreas Jonsson
Author of AngelScript
www.AngelCode.com[/url]
Jedive

Post by Jedive »

Hi AngelCode. I haven taken a look at AngelScript, and I like it a lot. Do you know if it is possible to port it to MacOSX? If it works on Linux, it would probably work on OsX too, unless you are using ASM code in AngelScript.
nebukadnezzar
Posts: 25
Joined: Tue Dec 02, 2003 7:45 pm
Location: Germany - Bornheim

Post by nebukadnezzar »

maybe i'm dumb but how get i angelscript to be compiled with MinGW as DLL?
AngelCode

Post by AngelCode »

Jedive:

It should be possible to port to MacOSX as well, even though I am using some assembler code. There is not very much asm code though, just a couple of minor functions, and these are already available in Intel syntax (MSVC) and AT&T syntax (GCC, DJGPP, Dev-C++/MinGW) so if any MacOSX compiler uses these syntaxes the port shouldn't be too hard. Of course I don't know how the PowerPC processor handles function calls, but I'm betting that it is quite similar to the Intel processor.

If anyone is willing to do a port for MacOSX I'm more than willing to include the necessary changes in the main project (with credits to the contributer, of course).

nebukadnezzar:

In the 1.6.1 beta 3 version of the SDK there are working project files for compiling AngelScript both as a static library and DLL with Dev-C++/MinGW. Perhaps you can use these?

Note that MinGW exports functions without the "_" so if you are planning on loading the DLL dynamically you'll have change the function name when calling GetProcAddress().

keless:

I'm sorry for hijacking your thread like this. Since AngelScript doesn't seem to suit your purposes (you seem to want a typeless scripting language) I guess it is not really appropriate of me to talk about AngelScript here.

everyone:

Please direct your questions on AngelScript to my e-mail ( andreas@angelcode.com ) instead of posting them here.

Regards,
Andreas Jonsson
Author of AngelScript
www.AngelCode.com
nebukadnezzar
Posts: 25
Joined: Tue Dec 02, 2003 7:45 pm
Location: Germany - Bornheim

Post by nebukadnezzar »

oh i did it with mingw yesterdy the devcpp makefile was very useful...
may be your going to put up a forum on angelcode? - (i hate these mail. lists, sorry)...
AngelCode

Post by AngelCode »

nebukadnezzar

Yes, I probably should set up some forum for AngelCode. I think I'll ask GameDev.net for one (they host my web site).

keless:

Hmm, I think I confused you with the author of the other thread I mentioned earlier. If you don't have any preference towards typeless scripting languages AngelScript should be a viable choice for you, as it have all that you asked for in your inicial post. I would also bet that AngelScript is faster than both Lua and Python (since it is strongly typed and doesn't have to convert variants into C++ types, and can call the C++ functions directly without proxy functions), but that is probably irrelevant since the processor heavy tasks ought to be written in C++ (or C) anyway.

Regards,
Andreas Jonsson
Author of AngelScript
www.AngelCode.com
Miwa
Posts: 28
Joined: Wed Feb 18, 2004 10:48 pm

Post by Miwa »

I would also bet that AngelScript is faster than both Lua and Python (since it is strongly typed and doesn't have to convert variants into C++ types, and can call the C++ functions directly without proxy functions), but that is probably irrelevant since the processor heavy tasks ought to be written in C++ (or C) anyway.
I'd code up the examples in the Great Script Shootout and see how you do against Lua before making such a statement. Lua has been pretty optimized for some pretty good execution times, it's faster than just about every other script language tested... (well, QSceme was darn fast on a few of their tests too, but I'd rather not deal with lisp).

I'm really going to be happy when Lua 5.1 comes out, as it's likely to have a generational garbage collector, so I can get deterministic behavior from the garbage collector. That's real nice, since I use Lua not only on host computers, but also on many different embedded targets and real-time systems. Also makes it easier to make sure the gc doesn't cause a hitch when writing a 3d game too. :)

http://dada.perl.it/shootout/
Guest

Re: AngelScript

Post by Guest »

AngelCode wrote:...although as it currently is LGPL it would mean that you would have to make your source open as well, the license will be changed so that this will no longer be necessary.........
Regards,
Andreas Jonsson
Author of AngelScript
www.AngelCode.com[/url]
LGPL allows commercial without exposing your source. However if some one changes angelcode it self he will need to post changings.
Post Reply