Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #3394 > unrolled thread

Scripting language, for game logic.

Started byChrstfer <chrstfr@gmail.com>
First post2011-04-10 16:51 -0700
Last post2011-04-12 12:05 +0900
Articles 6 — 3 participants

Back to article view | Back to comp.lang.c++


Contents

  Scripting language, for game logic. Chrstfer <chrstfr@gmail.com> - 2011-04-10 16:51 -0700
    Re: Scripting language, for game logic. Miles Bader <miles@gnu.org> - 2011-04-11 14:21 +0900
      Re: Scripting language, for game logic. Chrstfer <chrstfr@gmail.com> - 2011-04-11 16:31 -0700
        Re: Scripting language, for game logic. Chrstfer <chrstfr@gmail.com> - 2011-04-11 16:43 -0700
        Re: Scripting language, for game logic. "Alf P. Steinbach /Usenet" <alf.p.steinbach+usenet@gmail.com> - 2011-04-12 02:23 +0200
        Re: Scripting language, for game logic. Miles Bader <miles@gnu.org> - 2011-04-12 12:05 +0900

#3394 — Scripting language, for game logic.

FromChrstfer <chrstfr@gmail.com>
Date2011-04-10 16:51 -0700
SubjectScripting language, for game logic.
Message-ID<a1b8e1d0-14bc-4064-8a6c-39e0f0c54a60@f18g2000yqd.googlegroups.com>
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::python 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.

[toc] | [next] | [standalone]


#3397

FromMiles Bader <miles@gnu.org>
Date2011-04-11 14:21 +0900
Message-ID<buoipulxt0b.fsf@dhlpc061.dev.necel.com>
In reply to#3394
Chrstfer <chrstfr@gmail.com> 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.

[toc] | [prev] | [next] | [standalone]


#3431

FromChrstfer <chrstfr@gmail.com>
Date2011-04-11 16:31 -0700
Message-ID<9497b049-1616-48fa-9026-500d23c1a61f@m7g2000vbq.googlegroups.com>
In reply to#3397
On Apr 11, 1:21 am, Miles Bader <mi...@gnu.org> wrote:
> Chrstfer <chrs...@gmail.com> 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?

[toc] | [prev] | [next] | [standalone]


#3434

FromChrstfer <chrstfr@gmail.com>
Date2011-04-11 16:43 -0700
Message-ID<94628b64-f587-465c-9fdc-b617bac73fa3@f11g2000vbx.googlegroups.com>
In reply to#3431
On Apr 11, 7:31 pm, Chrstfer <chrs...@gmail.com> wrote:
> On Apr 11, 1:21 am, Miles Bader <mi...@gnu.org> wrote:
>
>
>
> > Chrstfer <chrs...@gmail.com> 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.

[toc] | [prev] | [next] | [standalone]


#3437

From"Alf P. Steinbach /Usenet" <alf.p.steinbach+usenet@gmail.com>
Date2011-04-12 02:23 +0200
Message-ID<io0623$bqp$1@dont-email.me>
In reply to#3431
* 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>

[toc] | [prev] | [next] | [standalone]


#3444

FromMiles Bader <miles@gnu.org>
Date2011-04-12 12:05 +0900
Message-ID<buobp0cmaoc.fsf@dhlpc061.dev.necel.com>
In reply to#3431
Chrstfer <chrstfr@gmail.com> 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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.c++


csiph-web