Changes between Version 32 and Version 33 of content/LevelHowTo
- Timestamp:
- Feb 23, 2012, 5:03:11 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
content/LevelHowTo
v32 v33 9 9 10 10 == About XML == 11 XML is a description language that looks similar to HTML. We use tags to describe objects:11 XML is a description language that looks similar to HTML. We use '''tags to describe objects''': 12 12 {{{ 13 13 #!xml … … 17 17 }}} 18 18 19 A tag can contain several attributes. An attribute is the place where a value is set.19 A '''<tag>''' can contain several '''attributes'''. An attribute is the place where '''a value is set'''. 20 20 {{{ 21 21 #!xml … … 23 23 <!-- Quite a lot of attributes. --> 24 24 }}} 25 The syntax is attribute=“value(s)“. If only one value is set, the quotation marks are not necessary.25 The syntax is '''attribute=“value(s)“'''. If only one value is set, the quotation marks are not necessary. 26 26 27 27 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. If your level doesn't load have a look at the terminal by pressing [alt] + [tab]. 28 28 29 29 == What it's all about == 30 By describing a level via XML you actually add C++ objectsto the level. Each tag starting with a capital letter refers to a class that contains a XMLPort function. In order to understand better what a certain tag is doing it is recommended to read the corresponding source files.30 By describing a level via XML you actually '''add C++ objects''' to the level. Each tag starting with a capital letter refers to a class that contains a XMLPort function. In order to understand better what a certain tag is doing it is recommended to read the corresponding source files. 31 31 Example: The <Light> tag shown before refers to the [http://www.orxonox.net/browser/code/trunk/src/orxonox/graphics/Light.h light class]. 32 32 … … 49 49 > 50 50 }}} 51 3. Set the level s backgroud. The level's background is called skybox andis an image of what you can seen on the horizon. You can add an new skybox by changing the corresponding parameter:51 3. Set the level's backgroud (skybox). The skybox is an image of what you can seen on the horizon. You can add an new skybox by changing the corresponding parameter: 52 52 {{{ 53 53 #!xml … … 119 119 ||spaceshipassff||"templates/spaceshipAssff.oxt"||default spaceship - equipped with rockets|| 120 120 ||spaceshippirate||"templates/spaceshipPirate.oxt"|| || 121 ||spaceshipswallow||"templates/spaceshipSwallow.oxt"||fast ||121 ||spaceshipswallow||"templates/spaceshipSwallow.oxt"||fast, nice design|| 122 122 ||spaceshipHtwo||"templates/spaceshipH2.oxt"|| || 123 123 ||spaceshipghost||"templates/spaceshipGhost.oxt"||stealth aircraft || … … 138 138 139 139 == [http://www.orxonox.net/doxygen/classorxonox_1_1_pickup_spawner.html Pickups] == 140 Pickups give a player a t omporary bonus, if he is able to fly through the pickup. Bonuses are invisibility, health, boost, shield, a drone, ...140 Pickups give a player a temporary bonus when collecting it. Bonuses are invisibility, health, boost, shield, a drone, ... 141 141 1. Include the pickups. 142 142 {{{ … … 169 169 170 170 == Billboards == 171 Pickups are represented by billboards. Billboards are 2D images that are always facing the viewer. A 2D circle image seems to be a 3D sphere. Also the blinking lights on the assff wing are realized via billboards. Example of a static light sphere:171 Pickups are represented by billboards. Billboards are 2D images that are always facing the viewer. A 2D circle image seems to be a 3D sphere. E.g. The blinking lights on the assff wing are realized via billboards. Example of a static light sphere: 172 172 {{{ 173 173 #!xml … … 203 203 * load external skripts: for example the cuboid spacestation. 204 204 {{{ 205 <!-- First, the script has to be included. --> 205 206 #!xml <?lua 206 207 dofile("includes/CuboidSpaceStation.lua") 207 208 ?> 208 <!-- First, the skript has to be included. -->209 209 210 210 <!-- Usage: Creates a modular space station --> … … 218 218 }}} 219 219 220 * 220 * Create a bunch of objects (depending on the index i). Whatever is placed within those lua tags will be created several times. 221 221 {{{ 222 222 #!xml <?lua … … 228 228 }}} 229 229 230 * 230 * Insert randomized values. By doing so your level's appearance is slightly changing whenever it is loaded. 231 231 {{{ 232 232 #!xml