| 4 | |
| 5 | == Create the basic file == |
| 6 | 1. 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. |
| 7 | 2. Copy „empty_level.oxw“ and paste it again in the folder. |
| 8 | 3. Rename the copy. Try to use a name that sounds good. Avoid whitespace – use „_“ or CamelCase instead. |
| 9 | 4. Open your level with your favourite editor. |
| 10 | |
| 11 | |
| 12 | |
| 13 | == About XML == |
| 14 | |
| 15 | XML is a description language that looks similar to HTML. Like in HTML there are tags (in fact we are only using tags): |
| 16 | <templates> <!-- Opening tag --> |
| 17 | <Template link=lodtemplate_default /> <!-- Opening and closing at once --> |
| 18 | </templates> <!-- Closing tag --> |
| 19 | A template can contain several tags. A tag is the place where a value is set. |
| 20 | <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" /> |
| 21 | The syntax is tag=“vaule(s)“ if only one value is set the quotation marks are not necessary. |
| 22 | |
| 23 | Tip: Since your XML files do not have to be compiled you have to simply reload a 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. |
| 24 | |
| 25 | |