Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Scripting language, for game logic.

Reply
Thread Tools

Scripting language, for game logic.

 
 
Chrstfer
Guest
Posts: n/a
 
      04-10-2011
Im making a basic game, just to hone my skills and learn as much as i
can. Id like to add a scripting language for the NPC and map
generation stuff, to script AI for enemies, add new enemies, add new
map tiles, etc. Im thinking about Python, but boost:ython seems to
want me to use the python as the program, and call functions on a
library written in C++, instead of the C++ being the controller. Is
there a way to have python scripts define new enemies and their AI,
new tiles and their interactions, etc, and have the C++ be the
program? Id like to be able to expose functions, classes and objects
to Python. (Classes being those than can be derived from, objects
being actual objects of other classes). Is this possible?

If not, is there a C++ wrapper for Lua? the lua C API would probably
work, but id like to have some abstraction between the C API and my C+
+, mainly because i dont feel like id be up to using the C API, from
the cursory looks ive had of it as an option. I will look into that
and see if i was right or not.
 
Reply With Quote
 
 
 
 
Miles Bader
Guest
Posts: n/a
 
      04-11-2011
Chrstfer <(E-Mail Removed)> writes:
> If not, is there a C++ wrapper for Lua?


There are many...

I personally use SWIG, which has the advantage of being multi-lingual,
very powerful, able to expose many C++ features easily, and somewhat
simple to get started with -- but can be a bit bloated too (and it does
have a learning curve when you want to use more advanced features).

See: http://lua-users.org/wiki/BindingCodeToLua
(this page is kind of disorganized, but it has a lot of links ...)

-miles

--
Philosophy, n. A route of many roads leading from nowhere to nothing.
 
Reply With Quote
 
 
 
 
Chrstfer
Guest
Posts: n/a
 
      04-11-2011
On Apr 11, 1:21*am, Miles Bader <(E-Mail Removed)> wrote:
> Chrstfer <(E-Mail Removed)> writes:
> > If not, is there a C++ wrapper for Lua?

>
> There are many...
>
> I personally use SWIG, which has the advantage of being multi-lingual,
> very powerful, able to expose many C++ features easily, and somewhat
> simple to get started with -- but can be a bit bloated too (and it does
> have a learning curve when you want to use more advanced features).
>
> See: *http://lua-users.org/wiki/BindingCodeToLua
> (this page is kind of disorganized, but it has a lot of links ...)
>
> -miles
>
> --
> Philosophy, n. A route of many roads leading from nowhere to nothing.


Thank you. Does this mean that there are no Python wrappers, or just
none that you know of?
 
Reply With Quote
 
Chrstfer
Guest
Posts: n/a
 
      04-11-2011
On Apr 11, 7:31*pm, Chrstfer <(E-Mail Removed)> wrote:
> On Apr 11, 1:21*am, Miles Bader <(E-Mail Removed)> wrote:
>
>
>
> > Chrstfer <(E-Mail Removed)> writes:
> > > If not, is there a C++ wrapper for Lua?

>
> > There are many...

>
> > I personally use SWIG, which has the advantage of being multi-lingual,
> > very powerful, able to expose many C++ features easily, and somewhat
> > simple to get started with -- but can be a bit bloated too (and it does
> > have a learning curve when you want to use more advanced features).

>
> > See: *http://lua-users.org/wiki/BindingCodeToLua
> > (this page is kind of disorganized, but it has a lot of links ...)

>
> > -miles

>
> > --
> > Philosophy, n. A route of many roads leading from nowhere to nothing.

>
> Thank you. Does this mean that there are no Python wrappers, or just
> none that you know of?


Sorry, there does not appear to be an edit button.

I didnt understand what you meant by multilingual, when you mentioned
SWIG. I thought you meant it as a multilingual Lua wrapper. After
looking into it i realize you meant it was a wrapper for multiple
languages. Thanks you, sorry for my last post there.
 
Reply With Quote
 
Alf P. Steinbach /Usenet
Guest
Posts: n/a
 
      04-12-2011
* Chrstfer, on 12.04.2011 01:31:
>
> Thank you. Does this mean that there are no Python wrappers, or just
> none that you know of?


There are lots of C++ wrappers for Python.

Collectively they employ just about any technique you might think of, except of
course the particular detailed way that oneself would like to have it...

Anyway, you might start with the Boost Python interface.


Cheers & hth.,

- Alf

--
blog at <url: http://alfps.wordpress.com>
 
Reply With Quote
 
Miles Bader
Guest
Posts: n/a
 
      04-12-2011
Chrstfer <(E-Mail Removed)> writes:
> Thank you. Does this mean that there are no Python wrappers, or just
> none that you know of?


I just don't know (I don't use python); but I do know about Lua.

-Miles

--
Next to fried food, the South has suffered most from oratory.
-- Walter Hines Page
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a Scripting Language as Your Scripting Language DaveInSidney Python 0 05-09-2005 03:13 AM
Python is the best and most popular general purpose scripting language; the universal scripting language Ron Stephens Python 23 04-12-2004 05:32 PM
Java Game- Game can't find it's graphics jar file BlackHawke Java 12 01-26-2004 06:14 AM
Scripting C++ Game AI object using Python Generators The_Incubator Python 4 01-06-2004 12:17 AM
python scripting game The Temple Of Elemental Evil update O'Neal Computer Programmer Python 1 07-07-2003 04:13 AM



Advertisments