= Scripting =
Orxonox uses [http://www.lua.org Lua] for its scripts. Scripts are code pieces which add another layer to the game logic. As a Gamer you know those events which happen, when you reached a certain level or entered a room or area with your character. Those events are most certainly produced with a script engine like ours.
Our script engine has access to all objects in the game and are therefore quite powerful and easy to use, as you may see in examples.
There are two applications for the Orxonox scripting engine.
== Level files ==
Our level files are pure XML-code. We add objects and ambient lights with XML tags and specify their parameters with attributes.
If your using the special lua tags '''' you can create levels easier. You could use loops to generate more objects and you can let a level depend on earlier accomplishments of the player. If you use random parameters you can even create a level which looks slightly different every time a player plays it. Here some examples how you could use Lua in our level files.
=== Asteroid field ===
As I write this wiki page we have a level with 226 asteroids in it. For each asteroid we need one line of XML code:
{{{
...
...
}}}
With the scripting engine we could generate those asteroids a lot easier:
{{{
... (has to be tested first)
}}}