Pike: Integration with C++?

I was looking the whole day, searching for something on how to integrate the pike scripting language with C++ to be used as a game script language. Found nothing (only sth about sth called CMOD, not really helpful), so any pointers (no pun intended) are appreciated.

Quote:Originally posted by OneSadCookie Both Lua and Ruby are very easy to integrate with C/C++, Ruby's easier to translate OO between the languages, but it just depends what you want to use the scripting language for.

Mail me if you need source/example projects.

We have also made Lua and Ruby final candidates, no success with contacting the Pike dudes.

Ruby seems to be working with SWIG nicely, though I have not tried it myself, but the other guy on the project got it to run.

As for Lua, it is still a pain. I got a Lua VM working, no problem executing script files, but I have yet to do the C++ integration. Tolua++ doesn't work, it seems to have no hang on namespaces. Even though it compiles, and I can load my lib to the Lua VM (in this case just a test Vector3D), and it seems like the namespace and class are there (the tables exist), but I cant create an object instance.

Today, I will see what luabind brings, though the compilation of that was already a little shaky.

Yeah, Lua isn't great for OO stuff... you probably don't want Vector3D to cross the language barrier anyway though

As I said before, it just depends what you want to use the language for. Ruby's a great language for writing large amounts of high-level code very quickly in. You could quite happily put all your game logic and higher-level event handling, object management, UI, &c code in Ruby and just leave C/C++ for the low-level performance-sensitive stuff.

Lua's good for being a small scripting language... simple responses to events, for example... but it's not great for high-level stuff where you really want good object orientation. It has the advantage though that you can easily make sure that scripts can't harm anything, and that you can have multiple interpreters simultaneously.

I really wish Pike had a better API / docs to become a sort of halfway house... but it looks like that'll be a wee way off yet.

You didn't happen to use luabind for your bindings, did you? I had no success with it, looked through all the examples, made a really simple test (just a constructor is bound), yet it doesn't compile (though, right now, not even vector<>::iterator compiles).

We want to use lua as a general scripting language, potentially ranging from game logic scripting to AI, possibly UI scripting, and more. Though, all of the UI will be contained with a single OpenGL view, so far. Thinking about it, since all graphics will be in a hierarchical tree, drawing themselves, it might be possible to script large parts of the UI.

So long, I have to get the whole Carbon OpenGL thingy working, can't do it in Cocoa this time