   Should I use scripting for this?
  Hey.I have a Level class that has a vector of Tiles for the background tiles and foreground tiles. These are non-interactive tiles that are drawn under and above the player respectively. There is also a vector of Object_Tiles which are tiles that the player can interact with.I've been reading up on scripting a bit and have also been intrigued as to where, when and how it would find itself being used in my game. I'm curious to know if the Object_Tile behaviour is a good candidate for outsourcing behaviour to a script? For example, I've recently finished positional sound in my game, and thought it would be cool to light and extinguish a fire by "using" the fire with the space key. I thought that instead of creating a new Tile_Object derivee each time I wanted some new kind of object behaviour, I could write a lua/python/etc. script in the xml file that the level is in. For example:Quote:<level>    <object_tiles>   <object_tile name="fire" on_use="<insert script here that lights a fire, perhaps even burning the player>" />etc...    </object_tiles></level>void Object_Tile::On_Use(Player& player){    do_script(on_use);}on_use is a string containing the script.I really like this idea and hope that I've discovered where scripting fits in to my game. What does everyone else think? Is this something that a script should do?Cheers.   
  72 views... no one knows anything about scripting? :\   ;  It certainly would be a good place for scripting if you are planning to use lots of custom tiles and allow other users to create their own levels. If it is only going to be a few, then you have consider if the time integrating the scripting language VM, writing the exposed API for the script and writing the scripts themselves is going to be less then writing it straight into the code base.   ;  I would agree with Yaustar, It's definitly a good idea only if it's going to save you more work than just doing it by hand.  If you're going to have a bunch of these tiles with custom behavior or will be tweaking them for a while (game testing/balance), then it may be worth while to make it scripted.  However, if this is for only a couple of tiles, then it may not be worth the effort.  Keep in mind that learning how to embed a scripting language may be a good reason.  The approach you presented looks like a fine way to go about it. cheers, Bob   ;  Hmm.. good point. Although, stuff like cut scenes would be scripted as well, right? So I'm gonna have to learn sometime. I think I will go crazy with different object behaviour once I get the scripting working haha.When I do get around to it, do you have any suggestions for a scripting language? I'm considering Lua because I've read that it's simpler to use than Python, although Python has a larger and more thorough library?   