Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / General Programming / accessing stl[list] with scripting language Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
fuzinavl

April 08, 2005, 01:55 PM

many scripting languages to choose from: ici, lua, pike, seer, small, ...

My game engine in C++ will pass a reference of an stl of visible objects to the AI script. The AIscript will also receive a reference to the bot which is using the AI.
The AI script will do it's thing and adjust botClass variables such as intended bot direction & bot firing direction. The script should also be able to invoke botClass actions like (call for help) or (tank alert).

scripting language requirements:
1. Be able to read from an stl
2. Be able to read/write from C++ public Class variables
3. Activate C++ class methods
4. File I/O
5. complex data structures
6. speed
7. ease of C++ integration
8. ease of writing scripts (for AI modders)
9. ways to lower it's thread priority to avoid "hanging" the game engine

another cool feature would be remote database access, so that some crazy dude out there could make an internationally accessable learning machine. (but that's overkill I think)

So, which scripting languages support requirements 1-9? (I'm using Windows.)
Out of those, which are most popular? Cross platform?

 
Chad Austin

April 08, 2005, 03:01 PM

Python and Boost Python satisfy all of those requirements, except perhaps the speed one. It would be worth using as your first scripting language, though.

 
Daemin

April 17, 2005, 06:53 PM

You should be able to make some wrapper functions or classes for the various scripting langauges that you have mentioned.

I've read a fair bit into Lua, and it would be fairly trivial to make some wrapper functions that wrap access to the list, and provide the interface as a "class" in Lua. The main benefit of using Lua would be the speed of its interpreter, I've been told that its among the fastest out there for a scripting language.

Though if you want something more powerful I would suggest something like Ruby, although I don't know how great it would be at being a scripting language for a game.

Though in the end I would have to say that Boost's Python integration code is a pretty neat - if you can get it to compile (I tried once but failed).

 
Dave

April 18, 2005, 05:39 AM

have a look at http://luabind.sourceforge.net/

 
chad

April 18, 2005, 08:02 AM

Another option would be the Simple Wrapper Interface Generator: http://www.swig.org

 
Sebastian Negomireanu

April 18, 2005, 08:57 AM

Try angelscript - should be fairly easy to do what you want with it.

 
This thread contains 6 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.