Jump to content
  • Advertisement
Sign in to follow this  
slynk

Scripting Idea... good or bad?

This topic is 2627 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I started a thread here:
http://www.gamedev.net/topic/611484-boostpython-help/

which still hasn't been responded to, so I was thinking of a work around. I think my issue is I'm trying to expose a class inherited from another class inherited from another class... so I was wondering if composing a iScript interface which has all the functions allowed to be called from a script. The interface would contain a pointer to the game state manger and work only with it. Ex:

iScript.LoadImage(PathToImage) would access the LoadImage function of the state on the top of the state manager's stack. Of course I'd do type verification to make sure the functions exist within a given state. Then I just need to expose this simple, but most likely large class of functions to python.

My question is, is this bad design? Is there a better approach? Please be specific as to what makes it bad design so I can learn. XD

Share this post


Link to post
Share on other sites
Advertisement
I'm not so familiar with Python, but I know that with the Lua bindings I've experimented with that exposing a derived clas requires exposing the base classes. What your suggesting above is essentially how the Lua C API works, and is more or less how one binds Lua with C++. All the binding libraries and tools simply ease the process of writing and exposing those functions. I assume the same approach would work for Python, but if you're writing interface functions and then exposing those with the binding library, you're essentially doing redundant work.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!