Scripting C++ Game AI object using Python Generators

Samuel Walters swalters_usenet at yahoo.com
Mon Jan 5 13:31:50 EST 2004


|Thus Spake The_Incubator On the now historical date of Sun, 04 Jan 2004
03:32:11 -0800|
> Where I would like to go from there is to be able to associate a Python
> script with a C++ object, so that on every frame update I could run the
> Python script (which would have functionality implemented as a generator)
> until it yields, then move on to updating the next object, and on the next
> frame, have the generator continue from where it left off.
I have not dabbled with boost, but I like pyrex, and it allows you to
write c++ classes that can run python code.
http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/

You should at least dig in and skim over the c/python api.  You'll learn a
lot about what pyrex does.  I suggest "The Python Bible"
http://www.amazon.com/exec/obidos/tg/detail/-/0764548077/104-2573336-8032758?v=glance
Of all the documents I've scanned so far, it was the one that I understood
best. YMMV.  It has a kind of cookbook method:  "Here's how you do this,
Here's how you deal with that kind of data, etc"

Sam Walters

-- 
Never forget the halloween documents.
http://www.opensource.org/halloween/
""" Where will Microsoft try to drag you today?
    Do you really want to go there?"""




More information about the Python-list mailing list