Version 14 (modified by jo, 14 years ago) (diff) |
---|
How to create Orxonox Levels
Create the basic file
- Go to the folder ../data/levels. The level files ending with .oxw are simple XML files and can be opened with any editor. Each level file stored in this folder can be selected later in Orxonox.
- Copy „empty_level.oxw“ and paste it again in the folder.
- Rename the copy. Try to use a name that sounds good. Avoid whitespace – use „_“ or CamelCase instead.
- Open your level with your favourite editor.
About XML
XML is a description language that looks similar to HTML. We use tags to describe objects:
<templates> <!-- Opening tag 1 --> <Template link=lodtemplate_default /> <!-- Opening and closing tag 2 at once --> </templates> <!-- Closing tag 1 -->
A tag can contain several attributes. An attribute is the place where a value is set.
<Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" /> <!-- Quite a lot attributes. -->
The syntax is attribute=“vaule(s)“. If only one value is set, the quotation marks are not necessary.
Tip: XML files do not have to be compiled. If you changed a level file (and didn't forget to save it), you simply have to reload the level to view the changes. In Linux you can switch between the game and the editor by pressing [alt] + [tab]. If you insert only a little error and try to load a level the game will „stuck“. By pressing [alt] + [tab] you can leave the game and view the error message on the terminal.
First steps
- Define the level's name in the menu. The "description" will be displayed, when a player hovers his mouse over your level's "name". This should be the first tag in the XML file.
<LevelInfo name = "Teambase Match" description = "Fight for the bases." tags = "" />
- Decide wether you create a level for a gametype or a single player mission. A gametype is set in the <level> tag.
<Level name = "Presentation" description = "A simple testlevel" gametype = TeamBaseMatch >
- Set the levels backgroud. The level's background is called skybox and is an image of what you can seen on the horizon. You can add an new skybox by changing the corresponding parameter:
<Scene ambientlight = "0.5, 0.5, 0.5" skybox = "Orxonox/Starbox" >
Possible values are:
"Orxonox/Starbox" | „Orxonox/skypanoramagen1“ | „Orxonox/skypanoramagen2“ | „Orxonox/skyBoxMoreNebula“ |