From: Chad A. <ae...@ae...> - 2001-10-11 18:48:28
|
Interfacing Python with C: http://python.org/doc/current/ext/ext.html Interfacing JavaScript with C: http://mozilla.org/js/spidermonkey/ It's really easy to use SpiderMonkey's API. Python's a little weirder, but not entirely bad. (Look in my audio library at http://sf.net/projects/audiere. I have bindings for XPCOM, Python, and Java. I'd also suggest looking at the way Sphere interfaces with SpiderMonkey, but it's ASS NASTY and you'd never want to do it like that. EVER.) It's really not hard to set up bindings for a specific language. However, I strongly recommend going with XPCOM. Via IDL and type libraries, it automates the cross-language communication process. XPCOM links: http://mozilla.org/projects/xpcom/ http://www-106.ibm.com/developerworks/components/library/co-xpcom.html http://www-106.ibm.com/developerworks/components/library/co-xpcom2.html http://www-106.ibm.com/developerworks/components/library/co-xpcom3.html http://www-106.ibm.com/developerworks/components/library/co-xpcom4/index.html http://www-106.ibm.com/developerworks/components/library/co-xpcom5.html > I think chad knows this one, but if anyone else has ideas, i'd be > interested. > > want to do a scripting interface to the tank game engine (in cvs)... > > how easy is it to do a perl or python binding? I'd like cross platform > (linux win32 irix mac). I envision that most objects would be prefab in > the game engine code (like particle systems that i can just setup in high > level fashion, or objects that i can drop in and they just collide.)... > so not much low level logic in the scripting, hopefully just game logic > (like click button triggers open of door, where the button and door are > both defined in c++ code and have a simple trigger mechanism that can be > hooked up in python...) > > anyway, pretty random thoughts. mainly wondering how fast I could have > this implemented (assuming i had the game engine written... :) > > and, what are the steps I should take? (pointers to documentation on how > to do this are fine too) -- Chad Austin http://aegisknight.org/ |