Version 1 (modified by bknecht, 17 years ago) (diff) |
---|
Scripting
Orxonox uses 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 <?lua and ?> 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.