   Scripts, do you use em and what for?
  Does anyone here use a scripting engine for events and ai?if soWhat language do you use?What do you use it for?I'm thinking about adding a lua scripting engine to my game.thanks!   
  I'm using my home-mad scripting engine. But LUA is great. Use it if you plan to do complicated stuff, but for loading and simple scripting I use plan c++.   ;  I far prefer Lua to Python, and only 25% because I hate whitespace as syntax. I simply prefer Lua's syntax, features, and library over Python's.That's just me though.</opinion>I use Lua or my own Smalltalk-like language for scripting when I do. I've once used a Forth/PostScript-like language as a scripting tool simply because I didn't have a parser generator on the platform, or the time to hand-make an LR(1) parser.   ;  I use LUA in my current game.I use it for settings like Fullscreen or Windowed, Resolution and Color Depth. But as my game has strong RPG aspects I will also use it for events of any kind.   ;  Ok lua it is....thanks for the responses guys.My game is on its way....as soon as i complete some art ill post a screen...nothing spectacular but i think it will be fun.   ;  An embedded scripting language is useful for extending the data-driven paradigm of design, by implementing a sort of 'code as data' system that allows easy extension of behavior without forcing a hard recompile of the game base code. I use it for all sorts of things, from scripting behavioral callbacks for game entites (monster AI, NPC conversations, etc...) to generating random levels. And Lua all the way, baby. [grin]   ;  Awesome..thanks!   ;  I've been tossing around the idea to se LUA in my game. The game's in C#, so adding in LUA will be a piece of cake. But I'm not sure how I could use it for my AI.For example, if my enemy only shoots at the hero when he's < 30 pixels away, how do I get my hero object to the script?Also, do I call the script 60 times persecond like the Update() method is called? Doesn't the LUA VM have to compile it 60/s? Scripting wasn't a problem until I needed objects to communicate. Anybody have any links I could check out?   ;  The script gets called when it must be; either on events, or on some AI tick interval (similar, if you would, to a physics engine running at 20 updates per second, while the rendering and animation runs at full speed).Further, when used properly the lua VM (usually) compiles code only once; it then executes the virtual-machine bytecode when prompted.If you need your hero object to be accessed, then you make a cross-language binding; have the accessors and methods of the in-Lua object perform queries and updates on the real object in the wraparound system. Essentially, the hero object in the Lua runtime becomes an interface. Alternatively, you can use a true cross-language bridge, with the calls going directly out-of-Lua into the system without a manually-writ interface (and thus without certain slowdown aspects). This one is usually more dangerous and difficult to debug, however.   