[Orxonox-commit 4345] r9016 - in code/trunk: . data/defaultConfig data/gui/layouts data/gui/scripts data/levels data/levels/includes data/levels/templates data/overlays src/libraries/core src/libraries/util src/modules/gametypes src/modules/objects/triggers src/modules/overlays/hud src/modules/pong src/modules/weapons/projectiles src/modules/weapons/weaponmodes src/orxonox src/orxonox/controllers src/orxonox/gametypes src/orxonox/infos src/orxonox/interfaces src/orxonox/worldentities src/orxonox/worldentities/pawns

jo at orxonox.net jo at orxonox.net
Wed Feb 15 23:51:59 CET 2012


Author: jo
Date: 2012-02-15 23:51:58 +0100 (Wed, 15 Feb 2012)
New Revision: 9016

Added:
   code/trunk/data/gui/layouts/SingleplayerConfigMenu.layout
   code/trunk/data/gui/scripts/SingleplayerConfigMenu.lua
   code/trunk/data/levels/Spacerace2.oxw
   code/trunk/data/levels/asteroidField.oxw
   code/trunk/data/levels/includes/asteroidField.lua
   code/trunk/data/levels/presentationHS11.oxw
   code/trunk/src/modules/gametypes/OldRaceCheckPoint.cc
   code/trunk/src/modules/gametypes/OldRaceCheckPoint.h
   code/trunk/src/modules/gametypes/OldSpaceRace.cc
   code/trunk/src/modules/gametypes/OldSpaceRace.h
   code/trunk/src/modules/gametypes/SpaceRaceManager.cc
   code/trunk/src/modules/gametypes/SpaceRaceManager.h
   code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.cc
   code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.h
   code/trunk/src/orxonox/controllers/FormationController.cc
   code/trunk/src/orxonox/controllers/FormationController.h
   code/trunk/src/orxonox/gametypes/Mission.cc
   code/trunk/src/orxonox/gametypes/Mission.h
   code/trunk/src/orxonox/gametypes/TeamGametype.cc
   code/trunk/src/orxonox/gametypes/TeamGametype.h
Modified:
   code/trunk/
   code/trunk/data/defaultConfig/keybindings.ini
   code/trunk/data/gui/layouts/CreditsMenu.layout
   code/trunk/data/gui/layouts/MiscConfigMenu.layout
   code/trunk/data/gui/layouts/SingleplayerMenu.layout
   code/trunk/data/gui/scripts/CreditsMenu.lua
   code/trunk/data/gui/scripts/InGameMenu.lua
   code/trunk/data/gui/scripts/MiscConfigMenu.lua
   code/trunk/data/gui/scripts/SingleplayerMenu.lua
   code/trunk/data/levels/FPSTest.oxw
   code/trunk/data/levels/asteroids.oxw
   code/trunk/data/levels/docking.oxw
   code/trunk/data/levels/dynamicMatch.oxw
   code/trunk/data/levels/earth.oxw
   code/trunk/data/levels/emptyLevel.oxw
   code/trunk/data/levels/events.oxw
   code/trunk/data/levels/fightInOurBack.oxw
   code/trunk/data/levels/includes/weaponSettingsSpacecruiser.oxi
   code/trunk/data/levels/lastManStanding.oxw
   code/trunk/data/levels/lastTeamStanding.oxw
   code/trunk/data/levels/lastTeamStandingII.oxw
   code/trunk/data/levels/missionOne.oxw
   code/trunk/data/levels/myTestLevel.oxw
   code/trunk/data/levels/notifications.oxw
   code/trunk/data/levels/pickups.oxw
   code/trunk/data/levels/pirateAttack.oxw
   code/trunk/data/levels/planets.oxw
   code/trunk/data/levels/pong.oxw
   code/trunk/data/levels/portals.oxw
   code/trunk/data/levels/presentation.oxw
   code/trunk/data/levels/presentation09.oxw
   code/trunk/data/levels/presentation09b.oxw
   code/trunk/data/levels/presentationDM.oxw
   code/trunk/data/levels/presentationFS10.oxw
   code/trunk/data/levels/presentationFS102.oxw
   code/trunk/data/levels/presentationFS10Ed.oxw
   code/trunk/data/levels/presentationFS11.oxw
   code/trunk/data/levels/presentationHS09.oxw
   code/trunk/data/levels/presentationHS09b.oxw
   code/trunk/data/levels/princessAeryn.oxw
   code/trunk/data/levels/quests.oxw
   code/trunk/data/levels/screenshot.oxw
   code/trunk/data/levels/shieldTest.oxw
   code/trunk/data/levels/sound.oxw
   code/trunk/data/levels/spaceRace.oxw
   code/trunk/data/levels/teamBaseMatch.oxw
   code/trunk/data/levels/teamDeathMatch.oxw
   code/trunk/data/levels/templates/spaceshipSpacecruiser.oxt
   code/trunk/data/levels/testStars.oxw
   code/trunk/data/levels/testSwallow.oxw
   code/trunk/data/levels/tetris.oxw
   code/trunk/data/levels/theTimeMachine.oxw
   code/trunk/data/levels/tutorial.oxw
   code/trunk/data/levels/underAttack.oxw
   code/trunk/data/levels/waypoints.oxw
   code/trunk/data/overlays/HUDTemplates3.oxo
   code/trunk/data/overlays/underAttackHUD.oxo
   code/trunk/src/libraries/core/GUIManager.cc
   code/trunk/src/libraries/util/SignalHandler.cc
   code/trunk/src/modules/gametypes/CMakeLists.txt
   code/trunk/src/modules/gametypes/GametypesPrereqs.h
   code/trunk/src/modules/gametypes/RaceCheckPoint.cc
   code/trunk/src/modules/gametypes/RaceCheckPoint.h
   code/trunk/src/modules/gametypes/SpaceRace.cc
   code/trunk/src/modules/gametypes/SpaceRace.h
   code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h
   code/trunk/src/modules/objects/triggers/MultiTrigger.h
   code/trunk/src/modules/overlays/hud/CMakeLists.txt
   code/trunk/src/modules/overlays/hud/HUDHealthBar.h
   code/trunk/src/modules/overlays/hud/HUDNavigation.cc
   code/trunk/src/modules/overlays/hud/HUDNavigation.h
   code/trunk/src/modules/pong/Pong.cc
   code/trunk/src/modules/pong/Pong.h
   code/trunk/src/modules/pong/PongAI.h
   code/trunk/src/modules/pong/PongScore.cc
   code/trunk/src/modules/pong/PongScore.h
   code/trunk/src/modules/weapons/projectiles/Rocket.cc
   code/trunk/src/modules/weapons/projectiles/Rocket.h
   code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc
   code/trunk/src/orxonox/Level.cc
   code/trunk/src/orxonox/Level.h
   code/trunk/src/orxonox/LevelInfo.cc
   code/trunk/src/orxonox/LevelInfo.h
   code/trunk/src/orxonox/controllers/AIController.cc
   code/trunk/src/orxonox/controllers/AIController.h
   code/trunk/src/orxonox/controllers/ArtificialController.cc
   code/trunk/src/orxonox/controllers/ArtificialController.h
   code/trunk/src/orxonox/controllers/CMakeLists.txt
   code/trunk/src/orxonox/controllers/HumanController.cc
   code/trunk/src/orxonox/controllers/HumanController.h
   code/trunk/src/orxonox/controllers/NewHumanController.cc
   code/trunk/src/orxonox/controllers/NewHumanController.h
   code/trunk/src/orxonox/controllers/WaypointPatrolController.cc
   code/trunk/src/orxonox/controllers/WaypointPatrolController.h
   code/trunk/src/orxonox/gametypes/CMakeLists.txt
   code/trunk/src/orxonox/gametypes/Gametype.cc
   code/trunk/src/orxonox/gametypes/Gametype.h
   code/trunk/src/orxonox/gametypes/TeamDeathmatch.h
   code/trunk/src/orxonox/gametypes/UnderAttack.cc
   code/trunk/src/orxonox/infos/GametypeInfo.cc
   code/trunk/src/orxonox/infos/GametypeInfo.h
   code/trunk/src/orxonox/infos/PlayerInfo.cc
   code/trunk/src/orxonox/interfaces/RadarViewable.cc
   code/trunk/src/orxonox/interfaces/RadarViewable.h
   code/trunk/src/orxonox/worldentities/ControllableEntity.cc
   code/trunk/src/orxonox/worldentities/ControllableEntity.h
   code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.cc
   code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.h
   code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
   code/trunk/src/orxonox/worldentities/pawns/Pawn.h
Log:
Merging presentation2011 branch to trunk. Please check for possible bugs.


Property changes on: code/trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - /code/branches/ai:6592-7033
/code/branches/ai2:8721-8880
/code/branches/bigships:8137-8588
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/data_cleanup:7537-7686
/code/branches/doc:7290-7400
/code/branches/dockingsystem:8101-8192
/code/branches/dockingsystem2:8196-8560
/code/branches/dynamicmatch:6584-7030
/code/branches/fps:6591-7072
/code/branches/gameimmersion:8102-8577
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/mac_osx:7789-8128,8135
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/masterserverfix:8933-8936
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/miniprojects:2754-2824
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network2:6434-6465
/code/branches/network3:7196-7344
/code/branches/network4:7497-7755
/code/branches/network5:7757-7781
/code/branches/network6:7823-8315
/code/branches/network64:2210-2355
/code/branches/notifications:7314-7401
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/ois_update:7506-7788
/code/branches/output:8739-8857
/code/branches/overlay:2117-2385
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup:8145-8555
/code/branches/pickup2:5942-6405
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/png2:7262-7263
/code/branches/portals:8087-8455
/code/branches/portals2:8460-8602
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786,8500-8705
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation3:6913-7162
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound3:5941-6102
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/steering:5949-6091,8140-8595
/code/branches/tetris:8100-8563
/code/branches/tutoriallevel:7827-8370
/code/branches/tutoriallevel2:8370-8452
/code/branches/tutoriallevel3:8453-8636
/code/branches/unity_build:8440-8716
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051,8143-8591
/code/branches/weaponsystem:2742-2890
   + /code/branches/ai:6592-7033
/code/branches/ai2:8721-8880
/code/branches/bigships:8137-8588
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/data_cleanup:7537-7686
/code/branches/doc:7290-7400
/code/branches/dockingsystem:8101-8192
/code/branches/dockingsystem2:8196-8560
/code/branches/dynamicmatch:6584-7030
/code/branches/environment3:8887-8975
/code/branches/formation:8885-8991
/code/branches/fps:6591-7072
/code/branches/gamecontent:8893-8968
/code/branches/gameimmersion:8102-8577
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hud:8883-8986
/code/branches/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/mac_osx:7789-8128,8135
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/masterserverfix:8933-8936
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/menue:8884-8976
/code/branches/miniprojects:2754-2824
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network2:6434-6465
/code/branches/network3:7196-7344
/code/branches/network4:7497-7755
/code/branches/network5:7757-7781
/code/branches/network6:7823-8315
/code/branches/network64:2210-2355
/code/branches/notifications:7314-7401
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/ois_update:7506-7788
/code/branches/output:8739-8857
/code/branches/overlay:2117-2385
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup:8145-8555
/code/branches/pickup2:5942-6405
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/png2:7262-7263
/code/branches/portals:8087-8455
/code/branches/portals2:8460-8602
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786,8500-8705
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation2011:8974-9015
/code/branches/presentation3:6913-7162
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound3:5941-6102
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/spaceraceTwo:8881-8996
/code/branches/steering:5949-6091,8140-8595
/code/branches/tetris:8100-8563
/code/branches/tutoriallevel:7827-8370
/code/branches/tutoriallevel2:8370-8452
/code/branches/tutoriallevel3:8453-8636
/code/branches/unity_build:8440-8716
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051,8143-8591
/code/branches/weaponsystem:2742-2890

Modified: code/trunk/data/defaultConfig/keybindings.ini
===================================================================
--- code/trunk/data/defaultConfig/keybindings.ini	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/defaultConfig/keybindings.ini	2012-02-15 22:51:58 UTC (rev 9016)
@@ -70,8 +70,8 @@
 KeyNoConvert=
 KeyNumLock=
 KeyNumRow0=
-KeyNumRow1=
-KeyNumRow2=
+KeyNumRow1="toggleFormationFlight"
+KeyNumRow2="FFChangeMode"
 KeyNumRow3=
 KeyNumRow4=
 KeyNumRow5=

Modified: code/trunk/data/gui/layouts/CreditsMenu.layout
===================================================================
--- code/trunk/data/gui/layouts/CreditsMenu.layout	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/gui/layouts/CreditsMenu.layout	2012-02-15 22:51:58 UTC (rev 9016)
@@ -6,7 +6,7 @@
         <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
         <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
         <Window Type="MenuWidgets/StaticText" Name="orxonox/CreditsWindow" >
-            <Property Name="Text" Value="Keybindings" />
+            <Property Name="Text" Value="Credits" />
             <Property Name="Alpha" Value="0.8" />
             <Property Name="InheritsAlpha" Value="False" />
             <Property Name="HorzFormatting" Value="HorzCentred" />
@@ -14,7 +14,6 @@
             <Property Name="VertFormatting" Value="TopAligned" />
             <Property Name="UnifiedAreaRect" Value="{{0.15,0},{0.2125,0},{0.85,0},{0.6375,0}}" />
             <Window Type="MenuWidgets/StaticText" Name="orxonox/CreditsMenuWrapper" >
-                <Property Name="TextColours" Value="FF4444FF" />
                 <Property Name="InheritsAlpha" Value="False" />
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                 <Property Name="HorzFormatting" Value="HorzCentred" />
@@ -26,7 +25,7 @@
                     <Property Name="VertStepSize" Value="0.005" />
                     <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                     <Property Name="HorzOverlapSize" Value="0.01" />
-                    <Property Name="UnifiedAreaRect" Value="{{0.005,0},{0.01,0},{0.995,0},{0.99,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{0.997,0},{0.997,0}}" />
                     <Property Name="VertOverlapSize" Value="0.01" />
                     <Property Name="HorzScrollPosition" Value="0" />
                     <Property Name="VertScrollPosition" Value="0" />
@@ -37,16 +36,15 @@
                         <Property Name="HorzFormatting" Value="HorzCentred" />
                         <Property Name="VertFormatting" Value="TopAligned" />
                         <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
-                        <Property Name="Text">wird sowieso nicht gelesen
-Orxonox version 0.0.3
-
-Programming Language:  C++ - lua - tcl
-Environment:  OpenAL - Ogre - OIS - CEGUI - enet - ODE
-Licence:  GNU General Public Licence - Creative Commons
-
-das ist mein text höhö
-
-http://www.orxonox.net
+                        <Property Name="Text">Orxonox version 0.0.3
+    
+    Programming Language:  C++ - lua - tcl
+    Environment:  OpenAL - Ogre - OIS - CEGUI - enet - ODE
+    Licence:  GNU General Public Licence - Creative Commons
+    
+    http://www.orxonox.net
+    
+    Credits:
                       </Property>
                     </Window>
                 </Window>
@@ -60,8 +58,3 @@
         </Window>
     </Window>
 </GUILayout>
-
-
-
-
-

Modified: code/trunk/data/gui/layouts/MiscConfigMenu.layout
===================================================================
--- code/trunk/data/gui/layouts/MiscConfigMenu.layout	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/gui/layouts/MiscConfigMenu.layout	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,10 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 <GUILayout >
-    <Window Type="DefaultWindow" Name="orxonox/MiscConfigMenu/Background" >
+    <Window Type="MenuWidgets/StaticImage" Name="orxonox/MiscConfigMenu/Background" >
+        <Property Name="FrameEnabled" Value="False" />
         <Property Name="InheritsAlpha" Value="False" />
         <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
         <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+        <Property Name="BackgroundEnabled" Value="False" />
         <Window Type="MenuWidgets/StaticText" Name="orxonox/MicsConfigMenu/ConfigWindow" >
             <Property Name="Text" Value="Miscellaneous" />
             <Property Name="Alpha" Value="0.8" />
@@ -33,11 +35,17 @@
                 </Window>
             </Window>
         </Window>
-        <Window Type="MenuWidgets/Button" Name="orxonox/MiscConfigMenu/MiscConfigBackButton" >
-            <Property Name="Text" Value="Back" />
+        <Window Type="MenuWidgets/Button" Name="orxonox/MiscConfigMenu/CancelButton" >
+            <Property Name="Text" Value="Cancel" />
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.6625,0},{0.6,0},{0.7125,0}}" />
-            <Event Name="Clicked" Function="MiscConfigMenu.MiscConfigBackButton_clicked"/>
+            <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.725,0},{0.4,0},{0.775,0}}" />
+            <Event Name="Clicked" Function="MiscConfigMenu.MiscConfigCancelButton_clicked"/>
         </Window>
+        <Window Type="MenuWidgets/Button" Name="orxonox/MiscConfigMenu/OKButton" >
+            <Property Name="Text" Value="OK" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.6,0},{0.725,0},{0.75,0},{0.775,0}}" />
+            <Event Name="Clicked" Function="MiscConfigMenu.MiscConfigOKButton_clicked"/>
+        </Window>
     </Window>
 </GUILayout>

Copied: code/trunk/data/gui/layouts/SingleplayerConfigMenu.layout (from rev 9015, code/branches/presentation2011/data/gui/layouts/SingleplayerConfigMenu.layout)
===================================================================
--- code/trunk/data/gui/layouts/SingleplayerConfigMenu.layout	                        (rev 0)
+++ code/trunk/data/gui/layouts/SingleplayerConfigMenu.layout	2012-02-15 22:51:58 UTC (rev 9016)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<GUILayout >
+    <Window Type="MenuWidgets/StaticImage" Name="orxonox/SingleplayerConfigMenu/Background" >
+        <Property Name="FrameEnabled" Value="False" />
+        <Property Name="InheritsAlpha" Value="False" />
+        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+        <Property Name="BackgroundEnabled" Value="False" />
+        <Window Type="MenuWidgets/StaticText" Name="orxonox/SingleplayerConfigMenu/ConfigWindow" >
+            <Property Name="Text" Value="Config" />
+            <Property Name="Alpha" Value="0.8" />
+            <Property Name="InheritsAlpha" Value="False" />
+            <Property Name="HorzFormatting" Value="HorzCentred" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="VertFormatting" Value="TopAligned" />
+            <Property Name="UnifiedAreaRect" Value="{{0.15,0},{0.2125,0},{0.85,0},{0.6375,0}}" />
+            <Window Type="MenuWidgets/StaticText" Name="orxonox/SingleplayerConfigMenu/Wrapper" >
+                <Property Name="TextColours" Value="FF4444FF" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="HorzFormatting" Value="HorzCentred" />
+                <Property Name="VertFormatting" Value="TopAligned" />
+                <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.92,0}}" />
+                <Window Type="MenuWidgets/ScrollablePane" Name="orxonox/SingleplayerConfigMenu/MiscConfigPane" >
+                    <Property Name="ContentArea" Value="l:0 t:0 r:0 b:0" />
+                    <Property Name="HorzStepSize" Value="0.005" />
+                    <Property Name="VertStepSize" Value="0.005" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="HorzOverlapSize" Value="0.01" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.005,0},{0.01,0},{0.995,0},{0.99,0}}" />
+                    <Property Name="VertOverlapSize" Value="0.01" />
+                    <Property Name="HorzScrollPosition" Value="0" />
+                    <Property Name="VertScrollPosition" Value="0" />
+                </Window>
+            </Window>
+        </Window>
+        <Window Type="MenuWidgets/Button" Name="orxonox/SingleplayerConfigMenu/CancelButton" >
+            <Property Name="Text" Value="Cancel" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.725,0},{0.4,0},{0.775,0}}" />
+            <Event Name="Clicked" Function="SingleplayerConfigMenu.SingleplayerConfigCancelButton_clicked"/>
+        </Window>
+        <Window Type="MenuWidgets/Button" Name="orxonox/SingleplayerConfigMenu/OKButton" >
+            <Property Name="Text" Value="OK" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.6,0},{0.725,0},{0.75,0},{0.775,0}}" />
+            <Event Name="Clicked" Function="SingleplayerConfigMenu.SingleplayerConfigOKButton_clicked"/>
+        </Window>
+    </Window>
+</GUILayout>

Modified: code/trunk/data/gui/layouts/SingleplayerMenu.layout
===================================================================
--- code/trunk/data/gui/layouts/SingleplayerMenu.layout	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/gui/layouts/SingleplayerMenu.layout	2012-02-15 22:51:58 UTC (rev 9016)
@@ -14,28 +14,43 @@
             <Property Name="HorzFormatting" Value="HorzCentred" />
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
             <Property Name="VertFormatting" Value="TopAligned" />
-            <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.2875,0},{0.75,0},{0.7,0}}" />
-            <Window Type="MenuWidgets/Listbox" Name="orxonox/SingleplayerLevelListbox" >
+            <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.15,0},{0.8,0},{0.7,0}}" />
+            <Window Type="MenuWidgets/TabControl" Name="orxonox/SingleplayerTabControl" >
+                <Property Name="TabHeight" Value="{0,26.4388}" />
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-                <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.85,0}}" />
+                <Property Name="TabPanePosition" Value="Top" />
+                <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.1,0},{0.95,0},{0.925,0}}" />
             </Window>
-            <Window Type="MenuWidgets/Checkbox" Name="orxonox/SingleplayerShowAllCheckbox" >
-                <Property Name="Text" Value="show all" />
+            <Window Type="MenuWidgets/StaticImage" Name="orxonox/SingleplayerLevelImage" >
+                <Property Name="AlwaysOnTop" Value="True" />
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-                <Property Name="UnifiedAreaRect" Value="{{0.65,0},{0.87,0},{0.8,0},{.97,0}}" />
-                <Event Name="CheckStateChanged" Function="SingleplayerMenu.SingleplayerShowAll_clicked"/>
+                <Property Name="UnifiedAreaRect" Value="{{0.55,0},{0.25,0},{0.9,0},{0.675,0}}" />
             </Window>
+            <Window Type="MenuWidgets/StaticText" Name="orxonox/SingleplayerLevelDescription" >
+                <Property Name="AlwaysOnTop" Value="True" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="VertScrollbar" Value="True" />
+                <Property Name="HorzScrollbar" Value="True" />
+                <Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.725,0},{0.9,0},{0.875,0}}" />
+            </Window>
         </Window>
         <Window Type="MenuWidgets/Button" Name="orxonox/SingleplayerStartButton" >
             <Property Name="Text" Value="Start" />
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-            <Property Name="UnifiedAreaRect" Value="{{0.2875,0},{0.725,0},{0.4875,0},{0.775,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.725,0},{0.4,0},{0.775,0}}" />
             <Event Name="Clicked" Function="SingleplayerMenu.SingleplayerStartButton_clicked"/>
         </Window>
+        <Window Type="MenuWidgets/Button" Name="orxonox/SingleplayerConfigButton" >
+            <Property Name="Text" Value="Configure" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.425,0},{0.725,0},{0.575,0},{0.775,0}}" />
+            <Property Name="Disabled" Value="True" />
+            <Event Name="Clicked" Function="SingleplayerMenu.SingleplayerConfigButton_clicked"/>
+        </Window>
         <Window Type="MenuWidgets/Button" Name="orxonox/SingleplayerBackButton" >
             <Property Name="Text" Value="Back" />
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-            <Property Name="UnifiedAreaRect" Value="{{0.5125,0},{0.725,0},{0.7125,0},{0.775,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.6,0},{0.725,0},{0.75,0},{0.775,0}}" />
             <Event Name="Clicked" Function="SingleplayerMenu.SingleplayerBackButton_clicked"/>
         </Window>
     </Window>

Modified: code/trunk/data/gui/scripts/CreditsMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/CreditsMenu.lua	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/gui/scripts/CreditsMenu.lua	2012-02-15 22:51:58 UTC (rev 9016)
@@ -13,18 +13,9 @@
 
 function P.onShow()
     local description = winMgr:getWindow("orxonox/CreditsText")
-    description:setProperty("HorzFormatting", "WordWrapLeftAligned")
-    description:setProperty("VertFormatting", "TopAligned")
-    description:setText("                                   Orxonox version 0.0.3 \n \
-      Programming Language:  C++ - lua - tcl  \
-      Environment:  OpenAL - Ogre - OIS - CEGUI - enet - ODE  \
-      Licence:  GNU General Public Licence - Creative Commons \n  \
-      http://www.orxonox.net \n \
-      Credits:")
 
-    description:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
     height = getStaticTextWindowHeight(description)
-    description:setHeight(CEGUI.UDim(0, height))
+    description:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(0.0, height)))
 end
 
 function P.CreditsBackButton_clicked(e)

Modified: code/trunk/data/gui/scripts/InGameMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/InGameMenu.lua	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/gui/scripts/InGameMenu.lua	2012-02-15 22:51:58 UTC (rev 9016)
@@ -42,12 +42,11 @@
 
 -- events for ingamemenu
 function P.button_quit_clicked(e)
-    openDecisionPopup( "Do you really want to quit the game?", InGameMenu.callback )
+    openDecisionPopup( "Do you really want to quit the game?", InGameMenu.exitCallback )
 end
 
 function P.button_mainmenu_clicked(e)
-    orxonox.execute("startMainMenu")
-    hideMenuSheet("InGameMenu")
+    openDecisionPopup( "Do you really want to return to the main menu?", InGameMenu.mainMenuCallback )
 end
 
 function P.button_settings_clicked(e)
@@ -58,9 +57,18 @@
     hideMenuSheet("InGameMenu")
 end
 
-function P.callback(doExit)
+function P.mainMenuCallback(doExit)
     if doExit then
+        orxonox.execute("startMainMenu")
         hideMenuSheet("InGameMenu")
+    else
+        P.onShow()
+    end
+end
+
+function P.exitCallback(doExit)
+    if doExit then
+        hideMenuSheet("InGameMenu")
         orxonox.execute("exit")
     else
         P.onShow()

Modified: code/trunk/data/gui/scripts/MiscConfigMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/MiscConfigMenu.lua	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/gui/scripts/MiscConfigMenu.lua	2012-02-15 22:51:58 UTC (rev 9016)
@@ -10,7 +10,7 @@
 
 P.lineHeight = 0
 P.commandWidth = 0
-P.configWidth = 0
+P.editboxWidth = 0
 P.resetWidth = 0
 P.spaceWidth = 0
 
@@ -35,6 +35,8 @@
     table.insert(P.commandList, "HumanPlayer nick_")
     table.insert(P.commandList, "ChatOverlay displayTime_")
     table.insert(P.commandList, "Core bDevMode_")
+    table.insert(P.commandList, "HUDNavigation MarkerLimit_")
+    table.insert(P.commandList, "HUDNavigation showDistance")
 
     P.nameList = {}
     table.insert(P.nameList, "Mouse sensitivity")
@@ -55,6 +57,8 @@
     table.insert(P.nameList, "Playername")
     table.insert(P.nameList, "Chat: display time")
     table.insert(P.nameList, "Developer's Mode")
+    table.insert(P.nameList, "Marker Limit")
+    table.insert(P.nameList, "Show Distance next to cursor")
 
     P.linesList = {}
 
@@ -74,30 +78,37 @@
         end
     end
 
-    P.sampleWindow:setText("configure")
-    size = getMinTextSize(P.sampleWindow)
-    P.configWidth = size[2]+20
-
     P.sampleWindow:setText("reset")
     size = getMinTextSize(P.sampleWindow)
     P.resetWidth = size[2]+20
 
-    P.spaceWidth = math.floor(1/8*P.configWidth)
+    P.spaceWidth = 10
+    
+    local pane = tolua.cast(winMgr:getWindow("orxonox/MiscConfigMenu/MiscConfigPane"), "CEGUI::ScrollablePane")
+    size = pane:getViewableArea()
+    P.editboxWidth = size:getWidth() - P.commandWidth - P.resetWidth - 5*P.spaceWidth
 
     P.createLines()
 
     P:setButton(1, 1, {
-            ["button"] = winMgr:getWindow("orxonox/MiscConfigMenu/MiscConfigBackButton"),
-            ["callback"]  = P.MiscConfigBackButton_clicked
+            ["button"] = winMgr:getWindow("orxonox/MiscConfigMenu/CancelButton"),
+            ["callback"]  = P.MiscConfigCancelButton_clicked
     })
+    
+    P:setButton(1, 2, {
+            ["button"] = winMgr:getWindow("orxonox/MiscConfigMenu/OKButton"),
+            ["callback"]  = P.MiscConfigOKButton_clicked
+    })
 end
 
 function P.createLine(k)
     local offset = 0
+    -- content window for the entire line
     local line = winMgr:createWindow("DefaultWindow", "orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. k)
     line:setHeight(CEGUI.UDim(0, P.lineHeight))
     line:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, P.lineHeight*(k-1))))
 
+    -- config name
     local command = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. k .. "/Command")
     command:setText(P.nameList[k])
     command:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.commandWidth), CEGUI.UDim(1, 0)))
@@ -105,31 +116,24 @@
     line:addChildWindow(command)
     offset = offset + P.commandWidth + P.spaceWidth
 
+    -- config value (editable)
     local configvalue = winMgr:createWindow("MenuWidgets/Editbox", "orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. k .. "/Configvalue")
     configvalue:setProperty("ReadOnly", "set:False")
     local value = orxonox.CommandExecutor:query("getConfig " .. P.commandList[k])
     configvalue:setText(value)
-    P.sampleWindow:setText(value)
-    local size = getMinTextSize(P.sampleWindow)
-    local configvalueWidth = 2*size[2]
-    configvalue:setSize(CEGUI.UVector2(CEGUI.UDim(0, configvalueWidth), CEGUI.UDim(0.9, 0)))
+    configvalue:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.editboxWidth), CEGUI.UDim(0.9, 0)))
     configvalue:setPosition(CEGUI.UVector2(CEGUI.UDim(0, offset), CEGUI.UDim(0.05, 0)))
+    -- enable the reset button if the value changed
+    orxonox.GUIManager:subscribeEventHelper(configvalue, "TextAccepted", P.name .. ".MiscConfigEditbox_textAccepted")
     line:addChildWindow(configvalue)
-    offset = offset + configvalueWidth + P.spaceWidth
+    offset = offset + P.editboxWidth + P.spaceWidth
 
-    local config = winMgr:createWindow("MenuWidgets/Button", "orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. k .. "/Config")
-    config:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.configWidth), CEGUI.UDim(0.9, 0)))
-    config:setPosition(CEGUI.UVector2(CEGUI.UDim(0, offset), CEGUI.UDim(0.05, 0)))
-    config:setText("configure")
-    orxonox.GUIManager:subscribeEventHelper(config, "Clicked", P.name .. ".MiscConfigConfigure_clicked")
-    line:addChildWindow(config)
-    offset = offset + P.configWidth + P.spaceWidth
-
+    -- reset button (only available when value changed)
     local reset = winMgr:createWindow("MenuWidgets/Button", "orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. k .. "/Reset")
     reset:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.resetWidth), CEGUI.UDim(0.9, 0)))
     reset:setPosition(CEGUI.UVector2(CEGUI.UDim(0, offset), CEGUI.UDim(0.05, 0)))
     reset:setText("reset")
-    orxonox.GUIManager:subscribeEventHelper(reset, "Clicked", P.name .. ".MiscConfigReset_clicked")
+    orxonox.GUIManager:subscribeEventHelper(reset, "Clicked", P.name .. ".MiscConfigResetButton_clicked")
     line:addChildWindow(reset)
     reset:setEnabled(false)
     offset = offset + P.resetWidth + P.spaceWidth
@@ -152,32 +156,46 @@
     pane:setVerticalStepSize(getScrollingStepSize(window))
 end
 
-function P.MiscConfigReset_clicked(e)
+function P.MiscConfigOKButton_clicked(e)
+    for k,v in pairs(P.commandList) do
+        -- save the changes
+        local editbox = winMgr:getWindow("orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. k .. "/Configvalue")
+        orxonox.CommandExecutor:execute("config " .. P.commandList[k] .. " " .. editbox:getText())
+        local resetButton = winMgr:getWindow("orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. k .. "/Reset")
+        resetButton:setEnabled(false)
+    end
+    
+    hideMenuSheet("MiscConfigMenu")
+end
+
+function P.MiscConfigCancelButton_clicked(e)
+    hideMenuSheet("MiscConfigMenu")
+end
+
+function P.MiscConfigEditbox_textAccepted(e)
     local we = CEGUI.toWindowEventArgs(e)
     local name = we.window:getName()
 
     local match = string.gmatch(name, "%d+")
     local commandNr = tonumber(match())
 
-    -- TODO: Implement reset.
+    local resetButton = winMgr:getWindow("orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. commandNr .. "/Reset")
+    resetButton:setEnabled(true)
 end
 
-function P.MiscConfigConfigure_clicked(e)
+function P.MiscConfigResetButton_clicked(e)
     local we = CEGUI.toWindowEventArgs(e)
     local name = we.window:getName()
 
     local match = string.gmatch(name, "%d+")
     local commandNr = tonumber(match())
 
-    local window = winMgr:getWindow("orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. commandNr .. "/Configvalue")
-
-    orxonox.CommandExecutor:execute("config " .. P.commandList[commandNr] .. " " .. window:getText())
+    -- reload the old value
+    local editbox = winMgr:getWindow("orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. commandNr .. "/Configvalue")
     local value = orxonox.CommandExecutor:query("getConfig " .. P.commandList[commandNr])
-    window:setText(value)
+    editbox:setText(value)
+    
+    we.window:setEnabled(false)
 end
 
-function P.MiscConfigBackButton_clicked(e)
-    hideMenuSheet("MiscConfigMenu")
-end
-
 return P

Copied: code/trunk/data/gui/scripts/SingleplayerConfigMenu.lua (from rev 9015, code/branches/presentation2011/data/gui/scripts/SingleplayerConfigMenu.lua)
===================================================================
--- code/trunk/data/gui/scripts/SingleplayerConfigMenu.lua	                        (rev 0)
+++ code/trunk/data/gui/scripts/SingleplayerConfigMenu.lua	2012-02-15 22:51:58 UTC (rev 9016)
@@ -0,0 +1,198 @@
+-- SingleplayerMenu.lua
+
+local P = createMenuSheet("SingleplayerConfigMenu")
+
+P.commandList = {}
+P.nameList = {}
+P.linesList = {}
+
+P.sampleWindow = nil
+
+P.lineHeight = 0
+P.commandWidth = 0
+P.editboxWidth = 0
+P.resetWidth = 0
+P.spaceWidth = 0
+
+function P.onLoad()
+    P.sampleWindow = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/SingleplayerConfigMenu/MiscConfigPane/SampleWindow")
+    P.sampleWindow:setText("SampleText")
+
+    P:setButton(1, 1, {
+            ["button"] = winMgr:getWindow("orxonox/SingleplayerConfigMenu/CancelButton"),
+            ["callback"]  = P.SingleplayerConfigCancelButton_clicked
+    })
+    
+    P:setButton(1, 2, {
+            ["button"] = winMgr:getWindow("orxonox/SingleplayerConfigMenu/OKButton"),
+            ["callback"]  = P.SingleplayerConfigOKButton_clicked
+    })
+end
+
+function P.loadConfig(level)
+    P.commandList = {}
+    table.insert(P.commandList, "Gametype initialStartCountdown_")
+    table.insert(P.commandList, "Gametype bAutoStart_")
+    table.insert(P.commandList, "Gametype numberOfBots_")
+    table.insert(P.commandList, "Dynamicmatch gameTime_")
+    table.insert(P.commandList, "Dynamicmatch friendlyfire")
+    table.insert(P.commandList, "Dynamicmatch tutorial")
+    table.insert(P.commandList, "LastManStanding lives")
+    table.insert(P.commandList, "LastManStanding respawnDelay")
+    table.insert(P.commandList, "LastManStanding bNoPunishment")
+    table.insert(P.commandList, "LastManStanding bHardPunishment")
+    table.insert(P.commandList, "LastTeamStanding lives")
+    table.insert(P.commandList, "LastTeamStanding respawnDelay")
+    table.insert(P.commandList, "LastTeamStanding bNoPunishment")
+    table.insert(P.commandList, "LastTeamStanding bHardPunishment")
+    table.insert(P.commandList, "TeamDeathmatch teams_")
+    table.insert(P.commandList, "UnderAttack gameTime_")
+
+    P.nameList = {}
+    table.insert(P.nameList, "Start countdown")
+    table.insert(P.nameList, "Autostart")
+    table.insert(P.nameList, "Number of Bots")
+    table.insert(P.nameList, "Dynamicmatch: game time")
+    table.insert(P.nameList, "Dynamicmatch: friendly fire")
+    table.insert(P.nameList, "Dynamicmatch: tutorial")
+    table.insert(P.nameList, "LastManStanding: lives")
+    table.insert(P.nameList, "LastManStanding: respawn delay")
+    table.insert(P.nameList, "LastManStanding: no punishment")
+    table.insert(P.nameList, "LastManStanding: hard punishment")
+    table.insert(P.nameList, "LastTeamStanding: lives")
+    table.insert(P.nameList, "LastTeamStanding: respawn delay")
+    table.insert(P.nameList, "LastTeamStanding: no punishment")
+    table.insert(P.nameList, "LastTeamStanding: hard punishment")
+    table.insert(P.nameList, "TeamDeathmatch: Number of teams")
+    table.insert(P.nameList, "UnderAttack: game time")
+
+    P.linesList = {}
+    
+    --Calculate design parameters:
+    local size = getMinTextSize(P.sampleWindow)
+    P.lineHeight = size[1]
+
+    P.commandWidth = 0
+    for k,v in pairs(P.commandList) do
+        P.sampleWindow:setText(P.nameList[k])
+        size = getMinTextSize(P.sampleWindow)
+        if size[2] > P.commandWidth then
+            P.commandWidth = size[2]
+        end
+    end
+
+    P.sampleWindow:setText("reset")
+    size = getMinTextSize(P.sampleWindow)
+    P.resetWidth = size[2]+20
+
+    P.spaceWidth = 10
+    
+    local pane = tolua.cast(winMgr:getWindow("orxonox/SingleplayerConfigMenu/MiscConfigPane"), "CEGUI::ScrollablePane")
+    size = pane:getViewableArea()
+    P.editboxWidth = size:getWidth() - P.commandWidth - P.resetWidth - 5*P.spaceWidth
+
+    P.createLines()
+end
+
+function P.createLine(k)
+    local offset = 0
+    -- destroy config line, if it already exists (otherwise would cause an error)
+    if winMgr:isWindowPresent("orxonox/SingleplayerConfigMenu/MiscConfigPane/ConfigCommand" .. k) then
+        winMgr:destroyWindow("orxonox/SingleplayerConfigMenu/MiscConfigPane/ConfigCommand" .. k)
+    end
+    -- content window for the entire line
+    local line = winMgr:createWindow("DefaultWindow", "orxonox/SingleplayerConfigMenu/MiscConfigPane/ConfigCommand" .. k)
+    line:setHeight(CEGUI.UDim(0, P.lineHeight))
+    line:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, P.lineHeight*(k-1))))
+
+    -- config name
+    local command = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/SingleplayerConfigMenu/MiscConfigPane/ConfigCommand" .. k .. "/Command")
+    command:setText(P.nameList[k])
+    command:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.commandWidth), CEGUI.UDim(1, 0)))
+    command:setPosition(CEGUI.UVector2(CEGUI.UDim(0, offset), CEGUI.UDim(0, 0)))
+    line:addChildWindow(command)
+    offset = offset + P.commandWidth + P.spaceWidth
+
+    -- config value (editable)
+    local configvalue = winMgr:createWindow("MenuWidgets/Editbox", "orxonox/SingleplayerConfigMenu/MiscConfigPane/ConfigCommand" .. k .. "/Configvalue")
+    configvalue:setProperty("ReadOnly", "set:False")
+    local value = orxonox.CommandExecutor:query("getConfig " .. P.commandList[k])
+    configvalue:setText(value)
+    configvalue:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.editboxWidth), CEGUI.UDim(0.9, 0)))
+    configvalue:setPosition(CEGUI.UVector2(CEGUI.UDim(0, offset), CEGUI.UDim(0.05, 0)))
+    -- enable the reset button if the value changed
+    orxonox.GUIManager:subscribeEventHelper(configvalue, "TextAccepted", P.name .. ".SingleplayerConfigEditbox_textAccepted")
+    line:addChildWindow(configvalue)
+    offset = offset + P.editboxWidth + P.spaceWidth
+
+    -- reset button (only available when value changed)
+    local reset = winMgr:createWindow("MenuWidgets/Button", "orxonox/SingleplayerConfigMenu/MiscConfigPane/ConfigCommand" .. k .. "/Reset")
+    reset:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.resetWidth), CEGUI.UDim(0.9, 0)))
+    reset:setPosition(CEGUI.UVector2(CEGUI.UDim(0, offset), CEGUI.UDim(0.05, 0)))
+    reset:setText("reset")
+    orxonox.GUIManager:subscribeEventHelper(reset, "Clicked", P.name .. ".SingleplayerConfigResetButton_clicked")
+    line:addChildWindow(reset)
+    reset:setEnabled(false)
+    offset = offset + P.resetWidth + P.spaceWidth
+
+    line:setWidth(CEGUI.UDim(0, offset))
+
+    return line
+end
+
+function P.createLines()
+    local window = winMgr:getWindow("orxonox/SingleplayerConfigMenu/MiscConfigPane")
+
+    for k,v in pairs(P.commandList) do
+        local line = P.createLine(k)
+        table.insert(P.linesList, line)
+        window:addChildWindow(line)
+    end
+
+    local pane = tolua.cast(window, "CEGUI::ScrollablePane")
+    pane:setVerticalStepSize(getScrollingStepSize(window))
+end
+
+function P.SingleplayerConfigOKButton_clicked(e)
+    for k,v in pairs(P.commandList) do
+        -- save the changes
+        local editbox = winMgr:getWindow("orxonox/SingleplayerConfigMenu/MiscConfigPane/ConfigCommand" .. k .. "/Configvalue")
+        orxonox.CommandExecutor:execute("config " .. P.commandList[k] .. " " .. editbox:getText())
+        local resetButton = winMgr:getWindow("orxonox/SingleplayerConfigMenu/MiscConfigPane/ConfigCommand" .. k .. "/Reset")
+        resetButton:setEnabled(false)
+    end
+    
+    hideMenuSheet("SingleplayerConfigMenu")
+end
+
+function P.SingleplayerConfigCancelButton_clicked(e)
+    hideMenuSheet("SingleplayerConfigMenu")
+end
+
+function P.SingleplayerConfigEditbox_textAccepted(e)
+    local we = CEGUI.toWindowEventArgs(e)
+    local name = we.window:getName()
+
+    local match = string.gmatch(name, "%d+")
+    local commandNr = tonumber(match())
+
+    local resetButton = winMgr:getWindow("orxonox/SingleplayerConfigMenu/MiscConfigPane/ConfigCommand" .. commandNr .. "/Reset")
+    resetButton:setEnabled(true)
+end
+
+function P.SingleplayerConfigResetButton_clicked(e)
+    local we = CEGUI.toWindowEventArgs(e)
+    local name = we.window:getName()
+
+    local match = string.gmatch(name, "%d+")
+    local commandNr = tonumber(match())
+
+    -- reload the old value
+    local editbox = winMgr:getWindow("orxonox/SingleplayerConfigMenu/MiscConfigPane/ConfigCommand" .. commandNr .. "/Configvalue")
+    local value = orxonox.CommandExecutor:query("getConfig " .. P.commandList[commandNr])
+    editbox:setText(value)
+    
+    we.window:setEnabled(false)
+end
+
+return P

Modified: code/trunk/data/gui/scripts/SingleplayerMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/SingleplayerMenu.lua	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/gui/scripts/SingleplayerMenu.lua	2012-02-15 22:51:58 UTC (rev 9016)
@@ -3,94 +3,160 @@
 local P = createMenuSheet("SingleplayerMenu")
 
 P.levelList = {}
-P.itemList = {}
-P.showAll = false
+P.activeTabIndexes = {}
+P.scrollbarWidth = 13
 
 function P.onLoad()
-    local window = winMgr:getWindow("orxonox/SingleplayerShowAllCheckbox")
-    local button = tolua.cast(window,"CEGUI::Checkbox")
-    button:setSelected(false)
     P.createLevelList()
-
-    --buttons are arranged in a 1x2 matrix
+    
+    -- create tabs with desired tab as argument (nil for all)
+    P.createFilterTab("Gametypes", "gametype")
+    P.createFilterTab("Missions", "mission")
+    P.createFilterTab("Minigames", "minigame")
+    P.createFilterTab("Showcases", "showcase")
+    P.createFilterTab("Presentations", "presentation")
+    P.createFilterTab("Tests", "test")
+    P.createFilterTab("Show All", nil)
+    
+    -- update description and screenshot boxes
+    P.SingleplayerSelectionChanged()
+    
+    --buttons are arranged in a 1x3 matrix
     P:setButton(1, 1, {
             ["button"] = winMgr:getWindow("orxonox/SingleplayerStartButton"),
             ["callback"]  = P.SingleplayerStartButton_clicked
     })
 
     P:setButton(1, 2, {
+            ["button"] = winMgr:getWindow("orxonox/SingleplayerConfigButton"),
+            ["callback"]  = P.SingleplayerConfigButton_clicked
+    })
+
+    P:setButton(1, 3, {
             ["button"] = winMgr:getWindow("orxonox/SingleplayerBackButton"),
             ["callback"]  = P.SingleplayerBackButton_clicked
     })
 end
 
-function P.onShow()
-    if P.showAll ~= orxonox.GUIManager:inDevMode() then
-        local window = winMgr:getWindow("orxonox/SingleplayerShowAllCheckbox")
-        local button = tolua.cast(window,"CEGUI::Checkbox")
-        P.showAll = not P.showAll
-        button:setSelected(P.showAll)
-        P.createLevelList()
-    end
-end
-
 function P.createLevelList()
     P.levelList = {}
-    P.itemList = {}
-    local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/SingleplayerLevelListbox"))
-    listbox:resetList()
-    orxonox.GUIManager:setItemTooltipsEnabledHelper(listbox, true)
-    local preselect = orxonox.LevelManager:getInstance():getDefaultLevel()
     local size = orxonox.LevelManager:getInstance():getNumberOfLevels()
     local index = 0
     local level = nil
     while index < size do
         level = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index)
         if level ~= nil then
-            if P.showAll or not level:hasTag("test") then
-                table.insert(P.levelList, level)
+            local levelXMLFilename = level:getXMLFilename()
+            -- create an imageset for each screenshot
+            local imageName = level:getScreenshot()
+            if imageName ~= "" then
+                CEGUI.ImagesetManager:getSingleton():createImagesetFromImageFile(levelXMLFilename..imageName, imageName)
+            else
+                CEGUI.ImagesetManager:getSingleton():createImagesetFromImageFile(levelXMLFilename..imageName, "noscreenshot.png")
             end
+            table.insert(P.levelList, level)
         end
         index = index + 1
     end
+end
 
+function P.createFilterTab(name, tag)
+    -- create unique tab window name
+    local tabName = "orxonox/SingleplayerLevelTab"
+    if tag ~= nil then
+        tabName = tabName..tag
+    end
+    -- create new tab window with desired name
+    local listbox = CEGUI.toListbox(winMgr:createWindow("MenuWidgets/Listbox", tabName))
+    listbox:setText(name)
+    listbox:setProperty("UnifiedMaxSize", "{{1,0},{1,0}}")
+    listbox:setProperty("UnifiedAreaRect", "{{0.05,0},{0.1,0},{0.5,0},{0.675,0}}")
+    -- fill listbox with items
+    listbox:resetList()
+    orxonox.GUIManager:setItemTooltipsEnabledHelper(listbox, true)
+    local preselect = orxonox.LevelManager:getInstance():getDefaultLevel()
+    local tabIndexes = {}
     for k,v in pairs(P.levelList) do
-        local item = CEGUI.createListboxTextItem(v:getName())
-        item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
-        listbox:addItem(item)
-        if v:getXMLFilename() == preselect then
-            listbox:setItemSelectState(item, true)
+        -- only add level if it has desired tag
+        if tag == nil or v:hasTag(tag) then
+            local item = CEGUI.createListboxTextItem(v:getName())
+            item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
+            listbox:addItem(item)
+            table.insert(tabIndexes, k)
+            if v:getXMLFilename() == preselect then
+                listbox:setItemSelectState(item, true)
+            end
+            orxonox.GUIManager:setTooltipTextHelper(item, v:getDescription())
         end
-        P.itemList[k] = listbox:getListboxItemFromIndex(k-1)
-        orxonox.GUIManager:setTooltipTextHelper(P.itemList[k], v:getDescription())
     end
+    table.insert(P.activeTabIndexes, tabIndexes)
+    -- listen to selection changes
+    orxonox.GUIManager:subscribeEventHelper(listbox, "ItemSelectionChanged", P.name..".SingleplayerSelectionChanged")
+    local tabControl = winMgr:getWindow("orxonox/SingleplayerTabControl")
+    orxonox.GUIManager:subscribeEventHelper(tabControl, "TabSelectionChanged", P.name..".SingleplayerSelectionChanged")
+    if listbox:getItemCount() > 0 then
+        tabControl:addChildWindow(tabName)
+    end
 end
 
-function P.SingleplayerStartButton_clicked(e)
-    local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/SingleplayerLevelListbox"))
+function P.SingleplayerGetSelectedLevel()
+    -- choose the active listbox
+    local tabControl = CEGUI.toTabControl(winMgr:getWindow("orxonox/SingleplayerTabControl"))
+    local listbox = CEGUI.toListbox(tabControl:getTabContentsAtIndex(tabControl:getSelectedTabIndex()))
     local choice = listbox:getFirstSelectedItem()
     if choice ~= nil then
-        local index = listbox:getItemIndex(choice)
-        local level = P.levelList[index+1]
-        if level ~= nil then
-            orxonox.execute("startGame " .. level:getXMLFilename())
-            hideAllMenuSheets()
+        -- get the right tab and the right index
+        local tabIndexes = P.activeTabIndexes[tabControl:getSelectedTabIndex()+1]
+        local index = tabIndexes[listbox:getItemIndex(choice)+1]
+        return P.levelList[index]
+    else
+        return nil
+    end
+end
+
+function P.SingleplayerSelectionChanged(e)
+    local levelImage = winMgr:getWindow("orxonox/SingleplayerLevelImage")
+    local levelDescription = winMgr:getWindow("orxonox/SingleplayerLevelDescription")
+    local configButton = winMgr:getWindow("orxonox/SingleplayerConfigButton")
+    local level = P.SingleplayerGetSelectedLevel()
+    if level ~= nil then
+        local levelXMLFilename = level:getXMLFilename()
+        local imageName = level:getScreenshot()
+        -- set the screenshot and the description for the selected level
+        levelImage:setProperty("Image", "set:"..levelXMLFilename..imageName.." image:full_image")
+        levelDescription:setText(level:getDescription())
+        -- only enable config button for "gametype" levels
+        if level:hasTag("gametype") then
+            configButton:setProperty("Disabled", "False")
+        else
+            configButton:setProperty("Disabled", "True")
         end
+    else
+        -- also take care of "no level selected"
+        levelImage:setProperty("Image", nil)
+        levelDescription:setText("")
+        configButton:setProperty("Disabled", "True")
     end
 end
 
-function P.SingleplayerShowAll_clicked(e)
-    local checkbox = tolua.cast(winMgr:getWindow("orxonox/SingleplayerShowAllCheckbox"), "CEGUI::Checkbox")
-    local show = checkbox:isSelected()
-    if show ~= P.showAll then
-        P.showAll = show
-        P.createLevelList()
-   end
+function P.SingleplayerStartButton_clicked(e)
+    local level = P.SingleplayerGetSelectedLevel()
+    if level ~= nil then
+        orxonox.execute("startGame " .. level:getXMLFilename())
+        hideAllMenuSheets()
+    end
 end
 
+function P.SingleplayerConfigButton_clicked(e)
+    local level = P.SingleplayerGetSelectedLevel()
+    if level ~= nil then
+        local configMenu = showMenuSheet("SingleplayerConfigMenu")
+        configMenu:loadConfig(level)
+    end
+end
+
 function P.SingleplayerBackButton_clicked(e)
     hideMenuSheet(P.name)
 end
 
 return P
-

Modified: code/trunk/data/levels/FPSTest.oxw
===================================================================
--- code/trunk/data/levels/FPSTest.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/FPSTest.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "FPS testlevel"
  description = "Level to test First Person Shooter"
  tags = "test"
+ screenshot = "fpstestlevel.png"
 />
 
 <?lua
@@ -13,10 +14,7 @@
   include("templates/lodInformation.oxt")
 ?>
 
-<Level
- name         = "fps"
- description  = "tests"
->
+<Level>
   <templates>
     <Template link=lodtemplate_default />
   </templates>

Copied: code/trunk/data/levels/Spacerace2.oxw (from rev 9015, code/branches/presentation2011/data/levels/Spacerace2.oxw)
===================================================================
--- code/trunk/data/levels/Spacerace2.oxw	                        (rev 0)
+++ code/trunk/data/levels/Spacerace2.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -0,0 +1,207 @@
+<LevelInfo
+ name = "Spacerace 2"
+ description = "New Spacerace with Multiple Paths."
+ tags = "gametype"
+ screenshot = "spacerace2.png"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+
+  include("templates/spaceshipAssff.oxt")
+ 
+?>
+
+<?lua
+  include("templates/spaceshipAssff2.oxt")
+  include("templates/spaceshipPirate.oxt")
+?>
+
+<Level
+ name         = "Spacerace2"
+ description  = "Just a few tests"
+gametype = SpaceRace
+>
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+
+  <Scene
+    ambientlight = "0.8, 0.8, 0.8"
+    skybox       = "Orxonox/Starbox"
+  >
+
+    <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"/>
+
+	
+	<SpaceRaceManager>
+<checkpoints>	
+	<RaceCheckPoint name="checkpoint1" position="0,-2000,1000" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="0" islast="false" nextcheckpoints="1,2,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
+            <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
+            <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
+            <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+<RaceCheckPoint name="checkpoint2" position="0,2100,2300" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="1" islast="false" nextcheckpoints="3,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
+            <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
+            <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
+            <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+<RaceCheckPoint name="checkpoint3" position="0,700,2700" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="2" islast="false" nextcheckpoints="3,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
+            <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
+            <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
+            <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+<RaceCheckPoint name="checkpoint4" position="0,-400,300" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="3" islast="true">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
+            <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
+            <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
+            <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
+        </collisionShapes>
+    </RaceCheckPoint>
+</checkpoints>
+</SpaceRaceManager>
+
+ 
+<SpaceShip position="0,0,200" lookat="0,0,0">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=0 team=10>
+          <waypoints>
+            <Model mesh="cube.mesh" scale=0 position="0,-2000,1000" />
+            <Model mesh="cube.mesh" scale=0 position="0,2100,2300" />
+            <Model mesh="cube.mesh" scale=0 position="0,-400,300" />
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
+
+
+    <!-- ------------------Planet----------------- -->
+    <Planet position="0,0,0" scale=300 pitch=-90 mesh="iceplanet.mesh" atmosphere="atmosphere1" rotationaxis="8,1,0" rotationrate="1" atmospheresize=224.0f imagesize=1024.0f />
+    <StaticEntity position="0,0,0" collisionType=static>
+        <collisionShapes>
+            <SphereCollisionShape radius="399" />
+        </collisionShapes>
+    </StaticEntity>
+
+    <!-- ---------------asteroid ellipse----------------- -->
+    <?lua
+    max = 20
+    for i = 0, max, 1
+    do
+    y = math.sin(i/max*6)*2000
+    z = math.cos(i/max*6)*2500
+    x = 0
+    ?>
+    <?lua
+    for k = 1, 15, 1
+    do
+    j = math.random()
+    ?>
+
+    <MovableEntity
+      position = "<?lua print(x + math.random() * 500) ?>,<?lua print(y + math.random() * 500) ?>,<?lua print(z + math.random() * 1000) ?>"
+      collisionType = "dynamic"
+      linearDamping = "0.5"
+      angularDamping = "0.01"
+      collisiondamage = "0.01"
+      enablecollisiondamage = "true"
+      scale="<?lua print(j * 5) ?>" >
+      <attached>
+        <Model position="0,0,0" scale="<?lua print(j * 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh">
+      <?lua if k == 5 then ?><attached><!-- ---------asteroid fog----- -->
+            <ParticleEmitter position="0,0,0" source="Orxonox/Steam" />
+          </attached> <?lua end ?>
+        </Model>
+      </attached>
+      <collisionShapes>
+        <SphereCollisionShape radius="<?lua print(j * 80) ?>" />
+      </collisionShapes>
+    </MovableEntity>
+    <?lua
+    end
+    ?>
+    <?lua end ?>
+
+    <!-- ---------------ForceFields----------------- -->
+    <ForceField position="0,-700,2700" direction="0,1,0" diameter=500 velocity=2000 length=600 />
+        <MovableEntity position="0,-400,2700">
+            <attached>
+                <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.5,0,0" scale=2/>
+                <?lua for i=0,15,1 do ?>
+                    <Billboard position="-200,<?lua print(i*40) ?>,0" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+                    <Billboard position="200,<?lua print(i*40) ?>,0" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+                <?lua end ?>
+                </attached>
+        </MovableEntity>
+
+     <ForceField position="0,2500,2000" direction="0,0,-1" diameter=250 velocity=2000 length=600 />
+        <MovableEntity position="0,2500,2000">
+            <attached>
+                <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.5,0,0" scale=2/>
+                <?lua for i=0,15,1 do ?>
+                    <Billboard position="-100,0,-<?lua print(i*40) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+                    <Billboard position="100,0,-<?lua print(i*40) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+                <?lua end ?>
+                </attached>
+        </MovableEntity>
+
+    <ForceField position="0,1300,-800" direction="0,-1,-1" diameter=250 velocity=2000 length=800 />
+        <MovableEntity position="0,1300,-800">
+            <attached>
+                <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.5,0,0" scale=2/>
+                <?lua for i=0,20,1 do ?>
+                    <Billboard position="-100,<?lua print(-i*40*0.7071) ?>,<?lua print(-i*40*0.7071) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+                    <Billboard position="100,<?lua print(-i*40*0.7071) ?>,<?lua print(-i*40*0.7071) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+                <?lua end ?>
+                </attached>
+        </MovableEntity>
+
+    <ForceField position="0,-1400,-700" direction="0,-1,1" diameter=250 velocity=2000 length=600 />
+        <MovableEntity position="0,-1400,-700">
+            <attached>
+                <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.5,0,0" scale=2/>
+                <?lua for i=0,15,1 do ?>
+                    <Billboard position="-100,<?lua print(-i*40*0.7071) ?>,<?lua print(i*40*0.7071) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+                    <Billboard position="100,<?lua print(-i*40*0.7071) ?>,<?lua print(i*40*0.7071) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+                <?lua end ?>
+                </attached>
+        </MovableEntity>
+
+
+    
+  </Scene>
+</Level>
+

Copied: code/trunk/data/levels/asteroidField.oxw (from rev 9015, code/branches/presentation2011/data/levels/asteroidField.oxw)
===================================================================
--- code/trunk/data/levels/asteroidField.oxw	                        (rev 0)
+++ code/trunk/data/levels/asteroidField.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -0,0 +1,100 @@
+<LevelInfo
+ name = "asteroidFieldTest"
+ description = "Test of the asteroidField generator."
+  screenshot = "asteroidFieldTest.png"
+ tags = "test, showcase"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+?>
+
+<?lua
+  include("templates/spaceshipAssff.oxt")
+  include("templates/spaceshipPirate.oxt")
+?>
+
+<Level
+ name         = "Sample"
+ description  = "Just a few tests"
+>
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+
+  <Scene
+    ambientlight = "0.8, 0.8, 0.8"
+    skybox       = "Orxonox/Starbox"
+    hasPhysics   = true
+  >
+
+    <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"/>
+    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
+
+
+
+
+    <!-- Belt that's far away  *** TURNED OFF FOR PERFORMANCE REASONS *** -->
+    <!-- Generate asteroid field and asteroid belt -->    
+    <!--
+    <?lua
+    	dofile("includes/asteroidField.lua")
+    	asteroidBelt(0, 0, 0, -48, -34, 70, 100, 200, 219900, 210000, 900, 1)
+    ?>
+    -->
+
+
+    <!-- triple large belt around the planet  -->
+    <?lua
+    	dofile("includes/asteroidField.lua")
+    	asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 7190, 7800, 250, 1)
+    ?>
+    <?lua
+    	dofile("includes/asteroidField.lua")
+    	asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 10000, 11000, 300, 1)
+    ?>
+    <?lua
+    	dofile("includes/asteroidField.lua")
+    	asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 14000, 15000, 350, 1)
+    ?>
+
+
+
+    <!-- Planet close to spawn point -->
+    <Planet
+      position="15000,0,0"
+      scale="5000"
+      collisionType="dynamic"
+      linearDamping="0.8"
+      angularDamping="0"
+      mass="10000000"
+      pitch="0"
+      mesh="planets/muunilinst.mesh"
+      atmosphere="atmosphere1"
+      rotationaxis="1,0,0"
+      rotationrate="1.0"
+      atmospheresize="80.0f"
+      imagesize="1024.0f"
+      collisiondamage = 2
+      enablecollisiondamage = true
+    >
+      <attached>
+        <ForceField position="5000,0,0" mode="sphere" diameter="10000" velocity="-50" />
+      </attached>
+      <collisionShapes>
+        <SphereCollisionShape radius="5000" position="0,0,0" />
+      </collisionShapes>
+    </Planet>
+
+
+
+
+
+
+    
+  </Scene>
+</Level>
+

Modified: code/trunk/data/levels/asteroids.oxw
===================================================================
--- code/trunk/data/levels/asteroids.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/asteroids.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,3 +1,10 @@
+<LevelInfo
+ name = "Asteroids Race"
+ description = "Reach the checkpoints and avoid asteroids."
+ tags = "gametype"
+ screenshot = "asteroids.png"
+/>
+
 <?lua
   include("HUDTemplates3.oxo")
   include("stats.oxo")
@@ -6,9 +13,7 @@
 ?>
 
 <Level
- name         = "Asteroids Race"
- description  = "testmap for gametype asteroid race"
- gametype     =  Asteroids
+ gametype = "Asteroids"
 >
   <templates>
     <Template link=lodtemplate_default />

Modified: code/trunk/data/levels/docking.oxw
===================================================================
--- code/trunk/data/levels/docking.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/docking.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,7 +1,8 @@
 <LevelInfo
  name = "Transporter"
  description = "Level with a Transporter. Demonstrates the docking system."
- tags = ""
+ tags = "showcase"
+ screenshot = "transporter.png"
 />
 
 <?lua
@@ -11,10 +12,7 @@
   include("templates/lodInformation.oxt")
 ?>
 
-<Level
- name         = "Transporter"
- description  = "Docking example level"
->
+<Level>
   <templates>
     <Template link="lodtemplate_default" />
   </templates>

Modified: code/trunk/data/levels/dynamicMatch.oxw
===================================================================
--- code/trunk/data/levels/dynamicMatch.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/dynamicMatch.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,3 +1,10 @@
+<LevelInfo
+ name = "Dynamic Match"
+ description = "Dynamicmatch: Take care of what you're shooting at."
+ tags = "gametype"
+ screenshot = "dynamicMatch.png"
+/>
+
 <?lua
   include("HUDTemplates3.oxo")
   include("stats.oxo")
@@ -8,9 +15,7 @@
 ?>
 
 <Level
- name         = "Dynamic Match"
- description  = "In progress -level for dynamicmatch"
- gametype     = "Dynamicmatch"
+ gametype = "Dynamicmatch"
 >
   <templates>
     <Template link=lodtemplate_default />
@@ -32,6 +37,7 @@
     </StaticEntity>
 
 <!-- -----------12-Spawnpoints around the planet------------- -->
+<!-- inner Spawnpoints -->
 <TeamSpawnPoint team=0 position="1000,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
 <TeamSpawnPoint team=0 position="-1000,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
 <TeamSpawnPoint team=0 position="0,1000,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>

Modified: code/trunk/data/levels/earth.oxw
===================================================================
--- code/trunk/data/levels/earth.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/earth.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "Earth Demonstration"
  description = "1:100 Scale Model of Earth with Gravity"
  tags = "showcase"
+ screenshot = "earthdemonstration.png"
 />
 
 <?lua
@@ -11,10 +12,7 @@
   include("templates/spaceshipHXY.oxt")
 ?>
 
-<Level
- name         = "Planet Earth"
- description  = "1:100 Scale Model of Earth with Gravity"
->
+<Level>
   <templates>
     <Template link="lodtemplate_default" />
   </templates>

Modified: code/trunk/data/levels/emptyLevel.oxw
===================================================================
--- code/trunk/data/levels/emptyLevel.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/emptyLevel.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "Empty level"
  description = "A level with absolutely nothing in it."
  tags = "test"
+ screenshot = "emptylevel.png"
 />
 
 <?lua
@@ -15,10 +16,7 @@
   include("templates/spaceshipPirate.oxt")
 ?>
 
-<Level
- name         = "Sample"
- description  = "Just a few tests"
->
+<Level>
   <templates>
     <Template link=lodtemplate_default />
   </templates>

Modified: code/trunk/data/levels/events.oxw
===================================================================
--- code/trunk/data/levels/events.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/events.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,7 +1,8 @@
 <LevelInfo
   name = "Events showcase"
   description = "Level to test and showcase events."
-  tags = "test, showcase" 
+  tags = "test, showcase"
+  screenshot = "eventsshowcase.png"
 />
 
 <?lua
@@ -12,10 +13,7 @@
   include("templates/lodInformation.oxt")
 ?>
 
-<Level
- name         = "Event testing"
- description  = "A simple level to test the event-system (with comments)"
->
+<Level>
   <templates>
     <Template link=lodtemplate_default />
   </templates>

Modified: code/trunk/data/levels/fightInOurBack.oxw
===================================================================
--- code/trunk/data/levels/fightInOurBack.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/fightInOurBack.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,7 +1,8 @@
 <LevelInfo
   name = "Fight in our Back"
   description = "Our fleet is far ahead of us. We need to get rid of all the enemies in its back, because we do not want our enemies to attack from everywhere. So let us clear this Sector!"
-  tags = "singleplayer" 
+  screenshot = "fightinourback.png"  
+  tags = "mission" 
 />
 
 <?lua
@@ -109,7 +110,7 @@
 <Level
   name="Fight in our back"
   description="Our fleet is far ahead of us. We need to get rid of all the enemies in its back, because we do not want our enemies to attack from everywhere. So let us clear this Sector!"
-  gametype=TeamDeathmatch
+  gametype=Mission
 >
   <templates>
     <Template link=lodtemplate_default />
@@ -213,7 +214,7 @@
 
 <?lua for i=0,0,1 do
 x=800
-health=2050
+health=1500
 ?>
     <!--Transporter 1-->
     <EventTrigger name="activateTeam1No1" acitvations=1 stayactive="true">
@@ -238,7 +239,7 @@
 
 
 <?lua for j=0,1,1 do
-health=1600
+health=1300
 x=800
 z=j*300
 ?>

Copied: code/trunk/data/levels/includes/asteroidField.lua (from rev 9015, code/branches/presentation2011/data/levels/includes/asteroidField.lua)
===================================================================
--- code/trunk/data/levels/includes/asteroidField.lua	                        (rev 0)
+++ code/trunk/data/levels/includes/asteroidField.lua	2012-02-15 22:51:58 UTC (rev 9016)
@@ -0,0 +1,103 @@
+--[[ fog generator
+generates fog
+	posX, posY, posZ - position in space
+	size - size of billboard
+	brightness - [0,1] fog brightness
+--]]
+function generateFog(posX, posY, posZ, size, brightness)
+		print("<Billboard ")
+			print("position = \"") 
+				print(posX) print(",") 
+				print(posY) print(",") 
+				print(posZ) print("\" ") 
+			print("colour=\"")
+				print(brightness) print(",") 
+				print(brightness) print(",") 
+				print(brightness) print("\" ") 
+			print("material=\"Smoke/Smoke\" scale=")
+			print(size)
+			print(" />")
+end
+
+--[[ asteroid field generator
+generates asteroid field
+	posX, posY, posZ - position in space
+	minSize, maxSize - size boundaries of each asteroid
+	radius - size of the cube around position in space
+	count - number of asteroids
+	fog - enable fog 0/1
+--]]
+function asteroidField(posX, posY, posZ, minSize, maxSize, radius, count, fog)
+	for i = 1, count, 1
+	do
+		size = (math.random() * (maxSize - minSize)) + minSize
+		pX = (2 * math.random() * radius) - radius + posX
+		pY = (2 * math.random() * radius) - radius + posY
+		pZ = (2 * math.random() * radius) - radius + posZ
+		print("<StaticEntity ")
+		
+		print("position = \"") 
+		print(pX) print(",") 
+		print(pY) print(",") 
+		print(pZ) print("\" ")
+		
+		print("scale = \"") print(size) print("\" ")
+		
+		print("collisionType = static linearDamping = 0.8 angularDamping = 1 ") 
+		print("collisiondamage = 1000 enablecollisiondamage = true>")
+		
+		print("<attached>")
+			print("<Model mass=\"") print(size * 10) print("\" ")
+			print("mesh=\"ast") print(math.mod(i,6) + 1) print(".mesh\" />")
+		print("</attached>")
+		
+		print("<collisionShapes> ")
+			print("<SphereCollisionShape radius=\"") 
+			print(size * 2.5) print("\" />")
+		print("</collisionShapes>")
+		
+		print("</StaticEntity>")
+		
+		if fog == 1 and i % 5 == 0 then
+			generateFog(pX, pY, pZ, radius*0.04, 0.2)
+		end
+	end
+end
+
+
+--[[ asteroid belt generator
+generates asteroid belt
+	posX, posY, posZ - position in space
+	yaw, pitch - rotation
+	minSize, maxSize - size boundaries of each asteroid
+	radius0, radius1 - inner/outer radius
+	count - number of asteroids
+	fog - enable fog 0/1
+--]]
+function asteroidBelt(centerX, centerY, centerZ, yaw, pitch, segments, minSize, maxSize, radius0, radius1, count, fog)
+	dPhi = (2 * math.pi) / segments
+	width = math.abs(radius1 - radius0)
+	radius = (radius1 + radius0) / 2
+	segmentCount = count / segments
+	
+	print("<StaticEntity collisionType=static yaw=") print(yaw) 
+	print(" pitch=") print(pitch)
+	
+	print(" position = \"") 
+		print(centerX) print(",") 
+		print(centerY) print(",") 
+		print(centerZ) print("\"") 
+	print(">")
+	
+	print("<attached>")
+	
+	for i = 0, segments - 1, 1
+	do
+		asteroidField((radius * math.cos(i * dPhi)),
+					(radius * math.sin(i * dPhi)),
+					0, minSize, maxSize, width, segmentCount, fog)
+	end
+	
+	print("</attached>")
+	print("</StaticEntity>")
+end

Modified: code/trunk/data/levels/includes/weaponSettingsSpacecruiser.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsSpacecruiser.oxi	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/includes/weaponSettingsSpacecruiser.oxi	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,12 +1,11 @@
     <weaponslots>
-      <WeaponSlot position="-20,-15,-108" />
-      <WeaponSlot position=" 20,-15,-108" />
-      <WeaponSlot position="  0, -7,-110" />
-      <WeaponSlot position="-14,-31,-184" />
-      <WeaponSlot position=" 14,-31,-184" />
-      <WeaponSlot position="-34,-30,-169" />
-      <WeaponSlot position=" 34,-30,-169" />
-
+      <WeaponSlot position="-20,10,2" />
+      <WeaponSlot position=" 20,10,2" />
+      <WeaponSlot position="  0,18,0" />
+      <WeaponSlot position="-14,-6,-74" />
+      <WeaponSlot position=" 14,-6,-74" />
+      <WeaponSlot position="-34,-5,-59" />
+      <WeaponSlot position=" 34,-5,-59" />
     </weaponslots>
     <weaponsets>
       <WeaponSet firemode=0 />

Modified: code/trunk/data/levels/lastManStanding.oxw
===================================================================
--- code/trunk/data/levels/lastManStanding.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/lastManStanding.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,7 +1,8 @@
 <LevelInfo
  name = "Last Man Standing"
  description = "Be the sole survivor."
- tags = ""
+ tags = "gametype"
+ screenshot = "lastmanstanding.png"
 />
 
 <?lua
@@ -15,9 +16,7 @@
 ?>
 
 <Level
- name         = "Last Man Standing"
- description  = "testmap for gametype last man standing"
- gametype     =  "LastManStanding"
+ gametype = "LastManStanding"
 >
   <templates>
     <Template link=lodtemplate_default />
@@ -50,7 +49,7 @@
                 <attached>
                     <Model position="0,0,0" scale=140 mesh="asteroid_UV.mesh" shadow=true />
                     <Model position="-160,40,28.4" scale=1 mesh="sphere.mesh" /><!--EasterEgg indicator-->
-                    <PickupSpawner position="-160,40,17" triggerDistance="20" respawnTime="5" maxSpawnedItems="15"><!--EasterEgg-->
+                    <PickupSpawner position="-160,40,17" triggerDistance="20" respawnTime="5" maxSpawnedItems="15"><!--EasterEgg : invisible pickup is hidden inside the asteroid -->
                         <pickup>
                             <InvisiblePickup template=hugeinvisiblepickup />
                         </pickup>

Modified: code/trunk/data/levels/lastTeamStanding.oxw
===================================================================
--- code/trunk/data/levels/lastTeamStanding.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/lastTeamStanding.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,7 +1,8 @@
 <LevelInfo
  name = "Last Team Standing"
  description = "Survive as a team."
- tags = "singleplayer"
+ tags = "gametype"
+ screenshot = "lastteamstanding.png"
 />
 <?lua
   include("stats.oxo")
@@ -16,7 +17,7 @@
 <Level
  name         = "Last Team Standing"
  description  = "testmap for gametype last team standing"
- gametype     =  "LastTeamStanding"
+ gametype     =  "TeamGametype"
 >
   <templates>
     <Template link=lodtemplate_default />

Modified: code/trunk/data/levels/lastTeamStandingII.oxw
===================================================================
--- code/trunk/data/levels/lastTeamStandingII.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/lastTeamStandingII.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,7 +1,8 @@
 <LevelInfo
- name = "On the fly"
- description = "Survive as a team."
- tags = ""
+ name = "Last Team Standing II"
+ description = "Last Team Standing in an abstract level."
+ screenshot = "onthefly.png"
+ tags = "gametype"
 />
 <?lua
   include("stats.oxo")
@@ -14,8 +15,6 @@
 ?>
 
 <Level
- name         = "On the fly"
- description  = "testmap for gametype last team standing"
  gametype     = "LastTeamStanding"
 >
   <templates>
@@ -94,6 +93,7 @@
        </collisionShapes>
    </StaticEntity>
 <!-- END of CUBE-->
+
 <!-------------- Centered Thin Gate -------------->
 
    <StaticEntity position="0,0,0" direction="0,0,0" collisionType=static mass=100000 >
@@ -411,7 +411,7 @@
     <TeamSpawnPoint team=3 position="835,-300,845" direction="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
     <TeamSpawnPoint team=3 position="845,350,835" direction="0,0,-1" spawnclass=SpaceShip pawndesign=spaceshipassff />
     <TeamSpawnPoint team=3 position="845,-300,835" direction="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
-<Bot />
+<Bot /><!-- at least one bot is needed to stat the game properly. Else the game finishes. This could be avoided, if the menue allows a preselection of the number of players. --> 
 
   </Scene>
 </Level>

Modified: code/trunk/data/levels/missionOne.oxw
===================================================================
--- code/trunk/data/levels/missionOne.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/missionOne.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,7 +1,8 @@
 <LevelInfo
  name = "Mission One"
- description = "First guided steps in the orxonoxian universe."
- tags = "singleplayer"
+ description = "First Guided Steps in the Orxonoxian Universe."
+ screenshot = "missionOne.png"
+ tags = "mission"
 />
 
 <?lua
@@ -19,8 +20,7 @@
 ?>
 
 <Level
- name         = "Mission One"
- description  = "How to steer a spaceship."
+ gametype     = "Mission"
 >
   <templates>
     <Template link=lodtemplate_default />
@@ -46,110 +46,329 @@
       include("includes/pickups.oxi")
     ?>
 
-    <WorldAmbientSound source="Mars.ogg" looping="true" playOnLoad="true" /> <!-- AlphaCentauri.ogg-->
+    <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" /> <!-- AlphaCentauri.ogg, Mars.ogg-->
 
     <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"/>
-    <TeamSpawnPoint team=0 position="800,700,600" direction="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
+<!-- END OF INCLUDES & NECESSARITIES -->
 
+<!-- SPAWNPOINT & START OF QUESTS via spawntrigger -->
+    <EventMultiTrigger name=spawntrigger>
+        <events>
+            <trigger>
+                <TeamSpawnPoint team=0 position="800,700,600" direction="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff>
+                  <EventTrigger invert=true>
+                    <events>
+                      <trigger>
+                        <EventListener event="attack" />
+                      </trigger>
+                    </events>
+                  </EventTrigger>
+                </TeamSpawnPoint>
+            </trigger>
+        </events>
+    </EventMultiTrigger>
 
-<!-- END OF INCLUDES & NECESSARITIES -->
+        <QuestEffectBeacon times=1>
+            <effects>
+                <AddQuest questId="missionOne.basicFlying" />
+                <!--AddQuestHint hintId ="quest1hint3" /-->
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event=spawntrigger />
+                </execute>
+            </events>
+        </QuestEffectBeacon>
 
+        <QuestEffectBeacon times=1>
+            <effects>
+                <CompleteQuest questId="missionOne.basicFlying" />
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event="flying4" />
+                </execute>
+            </events>
+        </QuestEffectBeacon>
+
+        <QuestEffectBeacon times=1>
+            <effects>
+                <CompleteQuest questId="missionOne.navigation" />
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event="navigationend" />
+                </execute>
+            </events>
+        </QuestEffectBeacon>
+
+<!--helper trigger to end the weaponsystemI quest -->
+    <DistanceTrigger name="boxend" position="0,0,0" distance=950 target="SpaceShip" stayActive="false" delay=0.1>
+              <EventTrigger>
+                <events>
+                  <trigger>
+                    <EventListener event="boxtrigger4" />
+                  </trigger>
+                </events>
+              </EventTrigger>
+    </DistanceTrigger>
+
+        <QuestEffectBeacon times=1>
+            <effects>
+                <CompleteQuest questId="missionOne.weaponsystemI" />
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event="boxend" />
+                </execute>
+            </events>
+        </QuestEffectBeacon>
+
+<!--helper trigger to end the weaponsystemII quest -->
+    <DistanceTrigger name="piratesend" position="0,0,0" distance=2000 target="SpaceShip" stayActive="false" delay=0.1>
+              <EventTrigger>
+                <events>
+                  <trigger>
+                    <EventListener event="movingpirates2" />
+                  </trigger>
+                </events>
+              </EventTrigger>
+    </DistanceTrigger>
+
+        <QuestEffectBeacon times=1>
+            <effects>
+                <CompleteQuest questId="missionOne.weaponsystemII" />
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event=piratesend />
+                </execute>
+            </events>
+        </QuestEffectBeacon>
+
+<!--helper trigger to end the DuBallStation quest -->
+    <DistanceTrigger name="duballend" position="-1000,-300,700" distance=2000 target="SpaceShip" stayActive="false" delay=0.1>
+              <EventTrigger>
+                <events>
+                  <trigger>
+                    <EventListener event="duball3" />
+                  </trigger>
+                </events>
+              </EventTrigger>
+    </DistanceTrigger>
+
+
+        <QuestEffectBeacon times=1>
+            <effects>
+                <CompleteQuest questId="missionOne.DuballStation" />
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event=duballend />
+                </execute>
+            </events>
+        </QuestEffectBeacon>
+
+        <QuestEffectBeacon times=1> <!--  alternative quest end  -->
+            <effects>
+                <CompleteQuest questId="missionOne.DuballStation" />
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event=toHydroFarmer />
+                </execute>
+            </events>
+        </QuestEffectBeacon>
+
+<!--helper trigger to end the getHelp quest -->
+    <DistanceTrigger name="getHelpEnd" position="-47000,-1000,1300" distance=1400 target="SpaceShip" stayActive="false" delay=0.1>
+              <EventTrigger>
+                <events>
+                  <trigger>
+                    <EventListener event="ondock" />
+                  </trigger>
+                </events>
+              </EventTrigger>
+    </DistanceTrigger>
+
+        <QuestEffectBeacon times=1>
+            <effects>
+                <CompleteQuest questId="missionOne.getHelp" />
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event=getHelpEnd />
+                </execute>
+            </events>
+        </QuestEffectBeacon>
+
+<!--helper trigger to end the getHome quest -->
+    <DistanceTrigger name="getHomeEnd" position="0,0,0" distance=4000 target="SpaceShip" stayActive="false" delay=0.1>
+              <EventTrigger>
+                <events>
+                  <trigger>
+                    <EventListener event="attack" />
+                  </trigger>
+                </events>
+              </EventTrigger>
+    </DistanceTrigger>
+
+        <QuestEffectBeacon times=1>
+            <effects>
+                <CompleteQuest questId="missionOne.getHome" />
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event=getHomeEnd />
+                </execute>
+            </events>
+        </QuestEffectBeacon>
+
+<!--helper trigger to end the defence quest -->
+    <DistanceTrigger name="defenceEnd" position="0,0,0" distance=4000 target="SpaceShip" stayActive="false" delay=0.1>
+              <EventTrigger>
+                <events>
+                  <trigger>
+                    <EventListener event="attacktrigger6" />
+                  </trigger>
+                </events>
+              </EventTrigger>
+    </DistanceTrigger>
+
+        <QuestEffectBeacon times=1>
+            <effects>
+                <CompleteQuest questId="missionOne.defence" />
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event=defenceEnd />
+                </execute>
+            </events>
+        </QuestEffectBeacon>
+
+<!-- End the quest after own destruction of spacecruiser -->
+        <QuestEffectBeacon position="-100,0,0" times=1>
+            <effects>
+                <FailQuest questId="missionOne.getHelp" />
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event="failQuest" />
+                </execute>
+            </events>
+            <attached>
+                <DistanceTrigger name="failQuest" position="-47000,-1000,1300" distance=2300 target="SpaceShip">
+                  <EventTrigger>
+                    <events>
+                      <trigger>
+                        <EventListener event="gameEnd" />
+                      </trigger>
+                    </events>
+                  </EventTrigger>
+                </DistanceTrigger>
+            </attached>
+        </QuestEffectBeacon>
+
+
+
+
     <LocalQuest id="missionOne.basicFlying">
-        <QuestDescription title="Flying" description="INSERT STORY HERE. The first thing you have to learn is flying. Use 'W' to accelerate and steer with your mouse. In order to know where to fly there are two detection systems. The navigation markers highlite important objects directly in the level. If you can't directly see those objects, there are arrows which indicate how you have to steer. The second device is the radar. There you get an overview of all objects near you. In order to find an object that you spotted on radar, you have to steer in a way that the corresponding dot is in the center of the radar. Now you can find the corresponding object straight ahead. Your goal is to fly to the first waypoint. It's that orange dot on the radar." failmessage="" completeMessage="Well done." />
+        <QuestDescription title="Flying" description="Can you see the blinking light straight ahead? Your goal is to fly through it.
+Use (W) to accelerate and steer with your mouse.
+
+Further flying moves:
+break (S)
+roll     (Q) and (E)
+boost (Space)
+
+Whenever a new quest is added you can view it by pressing (F3). Quit this menu via (Esc)." failmessage="" completeMessage="" />
         <complete-effects>
-            <AddQuest questId="missionOne.weaponsystem" />
+            <AddQuest questId="missionOne.navigation" />
         </complete-effects>
     </LocalQuest>
 
-    <LocalQuest id="missionOne.weaponsystem">
-        <QuestDescription title="Weaponsystem" description="INSERT STORY HERE." failmessage="" completeMessage="All right." />
-        <subquests>
+    <LocalQuest id="missionOne.navigation">
+        <QuestDescription title="Navigation" description="The next goal is to find and move towards the test targets for your weaponsystem. The three arrows that just appeared down in the right corner of your screen indicate in which direction you have to turn your spacefighter to find your next targets.
+
+Alternative navigation: There's a green circle in the left corner - the radar. The red dots on the radar represent your targets. If you manage to move your spaceship in a way such that a dot is at the center of the radar, you will be able to see the concerning object straight ahead." failmessage="" completeMessage="" />
+        <complete-effects>
+            <AddQuest questId="missionOne.weaponsystemI" />
+        </complete-effects>
+    </LocalQuest>
+
             <LocalQuest id ="missionOne.weaponsystemI">
-                <QuestDescription title="Destroy Boxes" description="Test your four different weapons on the four boxes. The four weapons are laser (left click), plasma (right click), self targeting rockets (middle click) and manual rockets (press 'T'). Attention if you use manual rockets: Press 'T' only once to start the rocket. If you miss your target you can get out of the rocket, by clicking or pressing 'T' once more." failmessage="" completeMessage="" />
+                <QuestDescription title="Destroy the Boxes" description="Test your four different weapons on the four boxes:
+1. laser (left click)
+2. plasma (right click)
+3. target seeking rockets (middle click)
+4. manual rockets (T)
+
+Attention if you use manual rockets: Press (T) only once to start the rocket. If you miss your target you can get out of the rocket, by clicking or pressing (T) once more." failmessage="" completeMessage="" />
+                    <hints>
+                        <QuestHint id="missionOne.weaponsystem.laser">
+                            <QuestDescription title="Laser" description="The laser is a standard weapon. It is fast and precise but does not deal much damage." />
+                        </QuestHint>
+                        <QuestHint id="missionOne.weaponsystem.lightningGun">
+                            <QuestDescription title="Lightninggun" description="That was the lightning gun. Its plasma munition is quite slow, but a normal spaceship can't take more than three hits of such a strong weapon. That could be your favourite weapon for close range combat or if you want to hit a really slow enemy." />
+                        </QuestHint>
+                        <QuestHint id="missionOne.weaponsystem.targetSeekingRocket">
+                            <QuestDescription title="Target Seeking Rocket" description="The target seeking rockets follow slow targets on their own." />
+                        </QuestHint>
+                        <QuestHint id="missionOne.weaponsystem.manualrocket">
+                            <QuestDescription title="Manual Rocket" description="Manual rockets are your most powerful weapon. But since you have to steer it to your target yourself, you will leave your spaceship unprotected for a while. The total amount of both manual and target seeking rockets is limited to 10." />
+                        </QuestHint>
+                    </hints>
                 <complete-effects>
                     <AddQuest questId="missionOne.weaponsystemII" />
                 </complete-effects>
             </LocalQuest>
+
             <LocalQuest id="missionOne.weaponsystemII">
-                <QuestDescription title="" description="" failmessage="" completeMessage="" />
+                <QuestDescription title="Kill the pirates" description="Get rid of the patrolling pirates.
+Find out which weapon is best to tackle moving targets. Get close enough." failmessage="" completeMessage="" />
                 <complete-effects>
                     <AddQuest questId="missionOne.DuballStation" />
                 </complete-effects>
             </LocalQuest>
-        </subquests>
-        <hints>
-            <QuestHint id="missionOne.weaponsystem.laser">
-              <QuestDescription title="Laser" description="The laser is a standard weapon. It is fast and precise but does not deal much damage." />
-            </QuestHint>
-            <QuestHint id="missionOne.weaponsystem.lightningGun">
-              <QuestDescription title="Lightninggun" description="That was the lightning gun. Its plasma munition is quite slow, but a normal spaceship can't take more than three hits of such a strong weapon. That could be your favourite weapon for close range combat or if you want to hit a really slow enemy." />
-            </QuestHint>
-            <QuestHint id="missionOne.weaponsystem.targetSeekingRocket">
-              <QuestDescription title="Target Seeking Rocket" description="The target seeking rockets follow slow targets on their own." />
-            </QuestHint>
-            <QuestHint id="missionOne.weaponsystem.manualrocket">
-              <QuestDescription title="Manual Rocket" description="Manual rockets are your most powerful weapon. But since you have to steer it to your target yourself, you will leave your spaceship unprotected for a while. The total amount of both manual and target seeking rockets is limited to 10." />
-            </QuestHint>
-        </hints>
-        <complete-effects>
-        </complete-effects>
-    </LocalQuest>
 
     <LocalQuest id="missionOne.DuballStation">
-        <QuestDescription title="Duball Space Station" description="Fly towards the Duball Space Station. The grey radar marker will lead you to its position." failmessage="" completeMessage="Well done." />
+        <QuestDescription title="Duball Space Station" description="Fly towards the Duball Space Station. The grey radar marker will lead you to its position." failmessage="" completeMessage="" />
         <complete-effects>
             <AddQuest questId="missionOne.getHelp" />
         </complete-effects>
     </LocalQuest>
 
     <LocalQuest id="missionOne.getHelp">
-        <QuestDescription title="Get Help" description="There are enemies approaching. You can't handle it on your own. Fortunately there's a shortcut to the next friendly unit. Use the portal (grey dot) to get near the Hydrogen Farmer. There you might get help - as far as we know there should be a stronger spaceship docked to the Hydrogen Farmer. In order to be able to use that stronger spaceship you have to dock to the Hydrogen Farmer. Simply fly to the center of the Hydrogen Farmer, which is between its three legs." failmessage="" completeMessage="Well done." />
+        <QuestDescription title="Get Help" description="There are several enemies approaching. You can't handle it on your own. Fortunately there's a shortcut to the next friendly unit. Use the portal (grey dot) to get near the Hydrogen Farmer.
+The Hydrogen Farmer is a large spaceship with three legs.
+There you might get help - as far as we know there should be a strong spaceruiser docked to the Hydrogen Farmer. In order to be able to use that stronger spaceship, you have to dock to the Hydrogen Farmer.
+Simply fly to the center of the Hydrogen Farmer, which is between its three legs.
+
+How to dock: Accept the dialogue, take your hands off the keyboard and watch." failmessage="" completeMessage="" />
         <complete-effects>
             <AddQuest questId="missionOne.getHome" />
         </complete-effects>
     </LocalQuest>
 
     <LocalQuest id="missionOne.getHome">
-        <QuestDescription title="Return ASAP" description="" failmessage="" completeMessage="Well done." />
+        <QuestDescription title="Return ASAP" description="So you managed to get the spacecruiser. Use the portal to return to the DuBall Space Station.
+Hurry! Your help is desperately needed." failmessage="" completeMessage="" />
         <complete-effects>
             <AddQuest questId="missionOne.defence" />
         </complete-effects>
     </LocalQuest>
 
     <LocalQuest id="missionOne.defence">
-        <QuestDescription title="Defence" description="" failmessage="" completeMessage="Well done." />
+        <QuestDescription title="Defence" description="Seven enemies were detected that seem to launch a coordinated attack.
+Do not hesitate to fight or you will be the target.
+
+Always take care of the enemy that is the closest to you." failmessage="" completeMessage="Yeah! You did it." />
     </LocalQuest>
+<!-- --------------------- END OF QUESTS -------------------------- -->
 
 
-        <QuestEffectBeacon position="800,700,600" times="1">
-            <effects>
-                <AddQuest questId="missionOne.basicFlying" />
-            </effects>
-            <events>
-                <execute>
-                    <EventListener event="questStart"/>
-                </execute>
-            </events>
-            <attached>
-                <DistanceTrigger name="questStart" position="0,0,0" distance="50" target="Pawn" beaconMode="identify" targetname="PlayerDistanceTrigger" delay="2" />
-            </attached>
-        </QuestEffectBeacon>
-
-
-<!-- TUTORIAL-TODO: -->
-<!-- 1. Flying & manoeuvring (basic flying, using pickups, forcefields, docks & portals) --> <!-- "W","S","SPACE"-->
-<!-- 2. Aiming & Weapons (static targets, moving targets, dangerous targets)--> <!-- 3 Mouse buttons + "T"-->
-<!-- 3. Game handling (quests, knowing when a game is over :-), pausing, chat, ... ) --> <!--"F3", "F2", "ESC" -->
-<!-- 4. Extras (other things to discover) --> <!-- "Q","E","A","D","C", "CTRL", "", ... -->
-
-<!--
-
-"Lets start flying. Use W to accelerate and S to brake. The goal is to reach the spacestation which is displayed on the radar. If you want to be faster you can temporarily boost by hitting additionally the space button. If you use too much boost your engine heats up and you won't be able to use boost for a while. By the way boost could be useful during combat .."
-
--->
-
-    <DistanceTrigger name="spawndelaytrigger0" position="800,700,600" target="Pawn" distance=10 stayActive="true"/>
-    <SimpleNotification message="Welcome to the Orxonox Tutorial.">
+    <DistanceTrigger name="spawndelaytrigger0" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=2/>
+    <SimpleNotification message="Press (F3) to see your mission briefing.">
         <events>
             <trigger>
                 <EventListener event="spawndelaytrigger0" />
@@ -157,7 +376,8 @@
         </events>
     </SimpleNotification>
 
-<BlinkingBillboard position="-900,640,600" frequency=0.4 amplitude=2 material="Flares/lensflare" colour="1,1,0">
+<!-- Blinking Billboard should be replaced with WAYPOINT -->
+<BlinkingBillboard position="-900,640,600" frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,1,0.05">
           <events>
             <visibility>
               <EventTrigger invert=true>
@@ -183,8 +403,10 @@
             </visibility>
           </events>
 </Billboard>
+
 <!-------------------------------------- PART ZERO: How to fly --------------------------------------->
-    <DistanceTrigger name="flying1" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=4/>
+
+    <DistanceTrigger name="flying1" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=6/>
     <SimpleNotification message="Let's fly to the blinking light.">
         <events>
             <trigger>
@@ -193,8 +415,8 @@
         </events>
     </SimpleNotification>
 
-    <DistanceTrigger name="flying2" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=8/>
-    <SimpleNotification message="Use 'W' to accelerate and the mouse to steer.">
+    <DistanceTrigger name="flying2" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=10/>
+    <SimpleNotification message="Use (W) to accelerate and the mouse to steer.">
         <events>
             <trigger>
                 <EventListener event="flying2" />
@@ -202,17 +424,13 @@
         </events>
     </SimpleNotification>
 
-    <!--DistanceTrigger name="flying3" position="800,700,600" target="Pawn" distance=20 stayActive="true" delay=12/>
-    <SimpleNotification message="Point with the mouse to the blinking light.">
-        <events>
-            <trigger>
-                <EventListener event="flying3" />
-            </trigger>
-        </events>
-    </SimpleNotification-->
+<!-- QUEST-Trigger && Message Trigger: navigationend is activated after flying4 was triggered -->
+    <DistanceTrigger name="navigationend" position="0,0,0" distance=950 target="SpaceShip" stayActive="false" delay=1.1>
+        <DistanceTrigger name="flying4" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=1/>
+    </DistanceTrigger>
 
-    <DistanceTrigger name="flying4" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=1/>
-    <SimpleNotification message="Three red arrows just appeared.">
+
+    <SimpleNotification message="Three arrows just appeared.">
         <events>
             <trigger>
                 <EventListener event="flying4" />
@@ -221,7 +439,7 @@
     </SimpleNotification>
 
     <DistanceTrigger name="flying5" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=5/>
-    <SimpleNotification message="Follow those red arrows.">
+    <SimpleNotification message="Follow those arrows.">
         <events>
             <trigger>
                 <EventListener event="flying5" />
@@ -229,11 +447,43 @@
         </events>
     </SimpleNotification>
 
+<!-------------------------------------- PART ONE : Destroy boxes --------------------------------------->
+<!-- @ triggers: spawndelaytriggerX: textoutput only if no box was destroyed -->
+    <Trigger name="spawndelaytrigger1" mode="and" stayActive="true">
+        <DistanceTrigger position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=9 />
+        <EventTrigger activations="1" invert="true">
+          <events>
+            <trigger>
+              <EventListener event="boxtrigger1" />
+            </trigger>
+          </events>
+        </EventTrigger>
+    </Trigger>
 
+    <Trigger name="spawndelaytrigger2" mode="and" stayActive="true">
+        <DistanceTrigger position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=13 />
+        <EventTrigger activations="1" invert="true">
+          <events>
+            <trigger>
+              <EventListener event="boxtrigger1" />
+            </trigger>
+          </events>
+        </EventTrigger>
+    </Trigger>
 
-<!-------------------------------------- PART ONE : Destroy boxes --------------------------------------->
-    <DistanceTrigger name="spawndelaytrigger1" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=9 />
-    <SimpleNotification message="Destroy the four boxes.">
+    <Trigger name="spawndelaytrigger3" mode="and" stayActive="true">
+        <DistanceTrigger position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=17 />
+        <EventTrigger activations="1" invert="true">
+          <events>
+            <trigger>
+              <EventListener event="boxtrigger1" />
+            </trigger>
+          </events>
+        </EventTrigger>
+    </Trigger>
+
+<!-- @Text: How to shoot-->
+    <SimpleNotification message="Destroy the four boxes." broadcast="true">
         <events>
             <trigger>
                 <EventListener event="spawndelaytrigger1" />
@@ -241,8 +491,7 @@
         </events>
     </SimpleNotification>
 
-    <DistanceTrigger name="spawndelaytrigger2" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=13 />
-    <SimpleNotification message=" 1. Aim the a red cycle.">
+    <SimpleNotification message=" 1. Aim the a red cycle." broadcast="true">
         <events>
             <trigger>
                 <EventListener event="spawndelaytrigger2" />
@@ -250,8 +499,7 @@
         </events>
     </SimpleNotification>
 
-    <DistanceTrigger name="spawndelaytrigger3" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=17 />
-    <SimpleNotification message="2. Click! (hold the left mouse button)">
+    <SimpleNotification message="2. Click! (hold the left mouse button)" broadcast="true">
         <events>
             <trigger>
                 <EventListener event="spawndelaytrigger3" />
@@ -260,60 +508,62 @@
     </SimpleNotification>
 
 <!-- @Objects: 4 boxes (uncontrolled pawns) -->
-                <Pawn health=30 position="0,0,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box >
-                    <events>
-                      <visibility>
-                        <EventListener event="flying4" />
-                      </visibility>
-                    </events>
-                    <attached>
-                        <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
-                    </attached>
-                    <collisionShapes>
-                        <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
-                    </collisionShapes>
-                </Pawn>
+    <Pawn team=1 health=30 position="0,0,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 4" >
+        <events>
+          <visibility>
+            <EventListener event="flying4" />
+          </visibility>
+        </events>
+        <attached>
+            <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+        </collisionShapes>
+    </Pawn>
 
-                <Pawn health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box visible="true">
-                    <events>
-                      <visibility>
-                        <EventListener event="flying4" />
-                      </visibility>
-                    </events>
-                    <attached>
-                        <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
-                    </attached>
-                    <collisionShapes>
-                        <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
-                    </collisionShapes>
-                </Pawn>
-                <Pawn health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box >
-                    <events>
-                      <visibility>
-                        <EventListener event="flying4" />
-                      </visibility>
-                    </events>
-                    <attached>
-                        <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
-                    </attached>
-                    <collisionShapes>
-                        <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
-                    </collisionShapes>
-                </Pawn>
-                <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box >
-                    <events>
-                      <visibility>
-                        <EventListener event="flying4" />
-                      </visibility>
-                    </events>
-                    <attached>
-                        <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
-                    </attached>
-                    <collisionShapes>
-                        <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
-                    </collisionShapes>
-                </Pawn>
+    <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 3">
+        <events>
+          <visibility>
+            <EventListener event="flying4" />
+          </visibility>
+        </events>
+        <attached>
+           <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+        </collisionShapes>
+    </Pawn>
 
+    <Pawn health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 2">
+        <events>
+          <visibility>
+            <EventListener event="flying4" />
+          </visibility>
+        </events>
+        <attached>
+           <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+        </collisionShapes>
+    </Pawn>
+
+    <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 1">
+        <events>
+          <visibility>
+            <EventListener event="flying4" />
+          </visibility>
+        </events>
+        <attached>
+            <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+        </attached>
+        <collisionShapes>
+           <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+        </collisionShapes>
+    </Pawn>
+
 <!-- @Triggers: boxtrigger1 <-> one   box   destroyed
                 boxtrigger2 <-> two   boxes destroyed
                 boxtrigger3 <-> three boxes destroyed
@@ -364,8 +614,7 @@
         </events>
     </SimpleNotification>
 
-
-  <SimpleNotification message="Aim at the last target and press 'T'." broadcast="true">
+  <SimpleNotification message="Aim at the last target and press (T)." broadcast="true">
         <events>
             <trigger>
                 <EventListener event="boxtrigger3" />
@@ -385,7 +634,7 @@
 <!--------------------------------------PART TWO: Moving targets --------------------------------------->
 
 <!-- @Objects: 2 pirates moving in squares, nonlethal -->
-                <SpaceShip position="0,2000,200" lookat="0,0,0" name="movingtarget" >
+                <SpaceShip position="0,2000,200" lookat="0,0,0" name="movingtarget" RVName="Pirate">
                             <events>
                                 <visibility>
                                     <EventListener event="boxtrigger4" />
@@ -395,7 +644,7 @@
                       <Template link=spaceshippirate />
                     </templates>
                     <controller>
-                      <WaypointController>
+                      <WaypointController team=1>
                          <waypoints>
                           <Model mesh="cube.mesh" scale=8 position="  0,1700,-200" />
                           <Model mesh="cube.mesh" scale=8 position="  0,1700,-700" />
@@ -406,7 +655,7 @@
                   </controller>
                 </SpaceShip>
 
-                <SpaceShip position="0,2000,400" lookat="0,0,0" name="movingtarget">
+                <SpaceShip position="0,2000,400" lookat="0,0,0" name="movingtarget" RVName="Pirate">
                             <events>
                                 <visibility>
                                     <EventListener event="boxtrigger4" />
@@ -416,7 +665,7 @@
                     <Template link=spaceshippirate />
                   </templates>
                   <controller>
-                    <WaypointController>
+                    <WaypointController team=1>
                       <waypoints>
                         <Model mesh="cube.mesh" scale=8 position="  0,2400,1000" />
                         <Model mesh="cube.mesh" scale=8 position="  0,2400, 500" />
@@ -472,22 +721,41 @@
       </events>
     </DistanceTrigger>
 
-    <EventTrigger name="duball2" activations="1" stayactive="true" delay=4 >
-      <events>
-        <trigger>
-          <EventListener event="duball1" />
-        </trigger>
-      </events>
-    </EventTrigger>
+    <Trigger name="duball2" mode="and" stayActive="true">
+        <EventTrigger activations="1" stayactive="true" delay=4 >
+           <events>
+              <trigger>
+                 <EventListener event="duball1" />
+              </trigger>
+           </events>
+        </EventTrigger>
+        <EventTrigger activations="1" invert="true">
+          <events>
+            <trigger>
+              <EventListener event="toHydroFarmer" />
+            </trigger>
+          </events>
+        </EventTrigger>
+    </Trigger>
 
-    <EventTrigger name="duball3" activations="1" stayactive="true" delay=4 >
-      <events>
-        <trigger>
-          <EventListener event="duball2" />
-        </trigger>
-      </events>
-    </EventTrigger>
+    <Trigger name="duball3" mode="and" stayActive="true">
+        <EventTrigger activations="1" stayactive="true" delay=4 >
+           <events>
+              <trigger>
+                 <EventListener event="duball2" />
+              </trigger>
+           </events>
+        </EventTrigger>
+        <EventTrigger activations="1" invert="true">
+          <events>
+            <trigger>
+              <EventListener event="toHydroFarmer" />
+            </trigger>
+          </events>
+        </EventTrigger>
+    </Trigger>
 
+
     <SimpleNotification message="Welcome to the Duball Space Station!">
         <events>
             <trigger>
@@ -519,7 +787,7 @@
         <Model scale=13 mesh="DuBall1.mesh" position = "-100,0,0"/>
         <Model scale=13 mesh="DuBall2.mesh" position = "100,0,0"/>
         <Billboard scale=7 material="Examples/Flare" colour="0.5,0.5,0.5" position = "-100,0,0"/>
-        <Billboard scale=7 material="Examples/Flare" colour="0.5,0.5,0.5" position = "100,0,0"/>        
+        <Billboard scale=7 material="Examples/Flare" colour="0.5,0.5,0.5" position = "100,0,0"/>
       </attached>
       <collisionShapes>
         <SphereCollisionShape radius="80"            position = "-100,0,0" />
@@ -656,7 +924,7 @@
 <!-- PORTALS END-->
 
 
-    <SimpleNotification message="Dock to the Hydrogen Farmer.">
+    <SimpleNotification message="Dock to the Hydrogen Farmer." broadcast="true">
         <events>
             <trigger>
                 <EventListener event=toHydroFarmer />
@@ -664,9 +932,31 @@
         </events>
     </SimpleNotification>
 
-<!-------------------------------------- PART FOUR : Get Help --------------------------------------->   
-    <DistanceTrigger name="famer1" position="-48200,100,0" target="Pawn" distance=650 stayActive="true" delay=0 />
-    <SimpleNotification message="We just received a message from DuBall.">
+<!-------------------------------------- PART FOUR : Get Help --------------------------------------->
+
+    <Trigger name="famer1" mode="and" stayActive="true">
+        <DistanceTrigger position="-48200,100,0" target="Pawn" distance=650 stayActive="true" delay=0 />
+        <EventTrigger name="notGameEnd" activations="1" invert="true">
+          <events>
+            <trigger>
+              <EventListener event="gameEnd" />
+            </trigger>
+          </events>
+        </EventTrigger>
+    </Trigger>
+
+    <Trigger name="famer2" mode="and" stayActive="true">
+        <DistanceTrigger position="-48200,100,0" target="Pawn" distance=650 stayActive="true" delay=4 />
+        <EventTrigger activations="1" invert="true">
+          <events>
+            <trigger>
+              <EventListener event="gameEnd" />
+            </trigger>
+          </events>
+        </EventTrigger>
+    </Trigger>
+
+    <SimpleNotification message="We just received a message from DuBall." broadcast="true">
         <events>
             <trigger>
                 <EventListener event=famer1 />
@@ -674,8 +964,8 @@
         </events>
     </SimpleNotification>
 
-    <DistanceTrigger name="famer2" position="-48200,100,0" target="Pawn" distance=650 stayActive="true" delay=4 />
-    <SimpleNotification message="We will lend you our strongest ship.">
+
+    <SimpleNotification message="We will lend you our strongest ship." broadcast="true">
         <events>
             <trigger>
                 <EventListener event=famer2 />
@@ -685,7 +975,14 @@
 
 
 <!-- @Objects: HYDROGEN FARMER & DOCKING -->
-    <SpaceShip position="-48900,100,0" roll=90 yaw=0 pitch=20 mass=10000 health=100000 name="HydroFarmer">
+    <SpaceShip
+        team     = 0
+        position = "-48900,100,0"
+        roll     = 90   yaw=0  pitch=20
+        mass     = 10000
+        health   = 100000 initialhealth=100000 maxhealth="100000"
+        name     = "HydroFarmer"
+        RVName   = "Hydrogen Farmer" >
       <attached>
         <!-- Docking -->
         <DistanceTriggerBeacon name="bcnDestroyer" />
@@ -729,7 +1026,6 @@
       </collisionShapes>
     </SpaceShip>
 
-    <Billboard position="-48900,0,0" material="Examples/Flare" colour="0.6,0,0" scale=3/>
     <Dock position="-48900,0,0" roll=90 yaw=180 >
         <animations>
             <MoveToDockingTarget target="destroyer" />
@@ -741,24 +1037,42 @@
             <execute>
                 <EventListener event="dockMe" />
             </execute>
+            <activity>
+                <EventListener event=notGameEnd />
+            </activity>
         </events>
         <attached>
             <DistanceTrigger position="10,-202, -42" distance="800" target="Pawn"
                 beaconMode="exclude" targetname="bcnDestroyer" name="dockMe"
             />
         </attached>
+
     </Dock>
 
-    <SpaceShip template="spaceshipspacecruiser" position="-48900,800,0" orientation="-0.14, 0.68, 0.68, 0.223" health="300" maxhealth="400" initialhealth="300" name="cruiser" >
+<!-- at Objects: SpaceCruiser as docking target -->
+    <SpaceShip
+        template            = "spaceshipspacecruiser"
+        team                = "0"
+        position            = "-48900,800,0"
+        orientation         = "-0.14, 0.68, 0.68, 0.223"
+        health              = "400"
+        initialhealth       = "400"
+        maxhealth           = "500"
+        shieldhealth        = "80"
+        initialshieldhealth = "80"
+        maxshieldhealth     = "120"
+        shieldabsorption    = "0.8"
+        reloadrate          = "1"
+        reloadwaittime      = "1"
+        name                = "cruiser"
+        RVName              = "Spacecruiser" >
       <attached>
         <DockingTarget name="spaceShip" />
       </attached>
     </SpaceShip>
 
-<!-- TESTBOX-->
 
-<!-- TESTBOX-->
-
+<!-- cruiserKilled: if cuiser is killed & player hasn't taken control of spacecrusier -->
           <Trigger name="cruiserKilled" mode="and" stayActive="true">
             <EventTrigger  stayActive="true">
               <events>
@@ -777,23 +1091,29 @@
           </Trigger>
 
 
-            <EventTrigger delay=4 name="earlyEnd">
-              <events>
-                <trigger>
-                  <EventListener event="cruiserKilled" />
-                </trigger>
-              </events>
-              <events>
-                <activity>
-                  <EventListener event="movingpirates2" />
-                </activity>
-              </events>
-            </EventTrigger>
+<!-- triggers when either hydrofarmer or cruiser is killed -->
+            <Trigger mode=or name="gameEnd">
+                <EventTrigger activations="1">
+                  <events>
+                    <trigger>
+                      <EventListener event="HydroFarmer" />
+                    </trigger>
+                  </events>
+                </EventTrigger>
+                <EventTrigger activations="1">
+                  <events>
+                    <trigger>
+                      <EventListener event="cruiserKilled" />
+                    </trigger>
+                  </events>
+                </EventTrigger>
+            </Trigger>
 
+<!-- triggers delayed when either hydrofarmer or cruiser is killed -->
             <EventTrigger delay=4 name="earlyEnd">
               <events>
                 <trigger>
-                  <EventListener event="HydroFarmer" />
+                  <EventListener event="gameEnd" />
                 </trigger>
               </events>
               <events>
@@ -804,7 +1124,6 @@
             </EventTrigger>
 
 
-
     <SimpleNotification message="Oh no! You killed the Hydrogen Farmer!" broadcast="true">
         <events>
             <trigger>
@@ -821,7 +1140,7 @@
         </events>
     </SimpleNotification>
 
-    <SimpleNotification message="Press 'Esc' and restart the mission." broadcast="true">
+    <SimpleNotification message="Press (Esc) and restart the mission." broadcast="true">
         <events>
             <trigger>
                 <EventListener event="earlyEnd" />
@@ -829,7 +1148,6 @@
         </events>
     </SimpleNotification>
 
-
 <!-- hydrogen farmer & docking END -->
 
 
@@ -871,7 +1189,7 @@
       enablecollisiondamage = "false"
     >
       <!--attached>
-        <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-50" /> 
+        <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-50" />
       </attached-->  <!-- Forcefield kills HYDROGEN FARMER-->
       <collisionShapes>
         <SphereCollisionShape radius="2500" position="0,0,0" />
@@ -880,28 +1198,52 @@
 
 
 <!-------------------------------------- The attack --------------------------------------->
-
 <!-- TODO:
      - update spaceshipTransporter
-     - bots do friendly fire (is drone function reusable?) 
+     - bots do friendly fire (is drone function reusable?)
 -->
 
+<!-- Fallback Spawnpoint: on cruiserdeath caused by pirates. Unfortunately unstable behaviour concerning activity. -->
+    <TeamSpawnPoint team=0 position="2000,1500,-1500" direction="-1,-1,1" spawnclass=SpaceShip pawndesign=spaceshipspacecruiser>
+        <events>
+            <activity>
+                <EventListener event="attack" />
+            </activity>
+        </events>
+    </TeamSpawnPoint>
+
 <!-- @Triggers: toHydroFamer <-> first  portal usage
                 ondock       <-> successfull docking
                 attack       <-> second portal usage -->
 
-    <DistanceTrigger name="attack" position="-1400,-500,800" target="Pawn" distance=100 stayActive="true" >
+    <DistanceTrigger name="attack" position="-1400,-500,800" target="Pawn" distance=100 stayActive="true" mode="and">
         <EventTrigger name="ondock" activations="1" stayactive="true" delay=6>
           <events>
             <trigger>
               <EventListener event="dockMe" />
             </trigger>
           </events>
-            <DistanceTrigger name="toHydroFarmer" position="-47000,-1000,1300" target="Pawn" distance=100 stayActive="true" />
+            <Trigger mode=and>
+              <DistanceTrigger name="toHydroFarmer" position="-47000,-1000,1300" target="Pawn" distance=100 stayActive="true" />
+              <EventTrigger activations="1" invert="true">
+                <events>
+                  <trigger>
+                    <EventListener event="gameEnd" />
+                  </trigger>
+                </events>
+              </EventTrigger>
+            </Trigger>
         </EventTrigger>
+        <EventTrigger activations="1" invert="true">
+          <events>
+            <trigger>
+              <EventListener event="earlyEnd" />
+            </trigger>
+          </events>
+        </EventTrigger>
     </DistanceTrigger>
 
-    <SimpleNotification message="Return before it's too late. Boost with 'Space'." broadcast="true">
+    <SimpleNotification message="Return before it's too late. Boost with (Space)." broadcast="true">
         <events>
             <trigger>
                 <EventListener event=ondock />
@@ -918,8 +1260,8 @@
     </SimpleNotification>
 
 
-
 <!-- @Objects: 6 pirates, heading towards DuBall, attacking  -->
+<!-- TODO: re-hide pirates on early end-->
 <!-- 1 -->
     <SpaceShip position="3000,-4000,4000" lookat="-1300,-600,900" name="attacker"visible="true">
         <events>
@@ -1065,6 +1407,7 @@
         </controller>
     </SpaceShip>
 
+
 <!-- @Triggers: attacktriggerX <-> X enemies destroyed , X is an element of [1,6] -->
     <EventTrigger name="attacktrigger6" activations="1" stayactive="true">
       <events>
@@ -1141,6 +1484,7 @@
         </trigger>
       </events>
     </SimpleNotification>
+
     <SimpleNotification message="One enemy left!" broadcast="true">
       <events>
         <trigger>
@@ -1148,6 +1492,7 @@
         </trigger>
       </events>
     </SimpleNotification>
+
     <SimpleNotification message="Well done. You finished this tutorial." broadcast="true">
       <events>
         <trigger>
@@ -1157,7 +1502,7 @@
     </SimpleNotification>
 
 <!-- @Triggers: postAttack <-> delayed attacktrigger6 -->
-    <EventTrigger name="postAttack1" activations="1" stayactive="true" delay=3>
+    <EventTrigger name="postAttack1" activations="1" stayactive="true" delay=4.1>
       <events>
         <trigger>
           <EventListener event="attacktrigger6" />
@@ -1165,7 +1510,7 @@
       </events>
     </EventTrigger>
 
-    <EventTrigger name="postAttack2" activations="1" stayactive="true" delay=6>
+    <EventTrigger name="postAttack2" activations="1" stayactive="true" delay=8.2>
       <events>
         <trigger>
           <EventListener event="attacktrigger6" />
@@ -1173,7 +1518,7 @@
       </events>
     </EventTrigger>
 
-    <SimpleNotification message="Either quit by pressing 'Esc' or ..." broadcast="true">
+    <SimpleNotification message="Either quit by pressing (Esc) or ..." broadcast="true">
       <events>
         <trigger>
           <EventListener event="postAttack1" />
@@ -1191,14 +1536,14 @@
 
 <!-------------------------------------- |Bonus Part| --------------------------------------->
 <!-- @Triggers: "bonusX" <->  delayed "attacktrigger6" -->
-    <EventTrigger name="bonus1" activations="1" stayactive="true" delay=10>
+    <EventTrigger name="bonus1" activations="1" stayactive="true" delay=12.3>
       <events>
         <trigger>
           <EventListener event="attacktrigger6" />
         </trigger>
       </events>
     </EventTrigger>
-    <EventTrigger name="bonus2" activations="1" stayactive="true" delay=16>
+    <EventTrigger name="bonus2" activations="1" stayactive="true" delay=16.4>
       <events>
         <trigger>
           <EventListener event="attacktrigger6" />
@@ -1212,28 +1557,28 @@
         </trigger>
       </events>
     </EventTrigger>
-    <EventTrigger name="bonus4" activations="1" stayactive="true" delay=28>
+    <EventTrigger name="bonus4" activations="1" stayactive="true" delay=28.1>
       <events>
         <trigger>
           <EventListener event="attacktrigger6" />
         </trigger>
       </events>
     </EventTrigger>
-    <EventTrigger name="bonus5" activations="1" stayactive="true" delay=32.1>
+    <EventTrigger name="bonus5" activations="1" stayactive="true" delay=32.3>
       <events>
         <trigger>
           <EventListener event="attacktrigger6" />
         </trigger>
       </events>
     </EventTrigger>
-    <EventTrigger name="bonus6" activations="1" stayactive="true" delay=36.2>
+    <EventTrigger name="bonus6" activations="1" stayactive="true" delay=36.5>
       <events>
         <trigger>
           <EventListener event="attacktrigger6" />
         </trigger>
       </events>
     </EventTrigger>
-    <EventTrigger name="bonus7" activations="1" stayactive="true" delay=4>
+    <EventTrigger name="bonus7" activations="1" stayactive="true" delay=4.1>
       <events>
         <trigger>
           <EventListener event="bonus6" />
@@ -1243,7 +1588,7 @@
 
 
 
-    <SimpleNotification message="Rotate your ship. Press 'Q' or 'E'. "  broadcast="true">
+    <SimpleNotification message="Rotate your ship. Press (Q) or (E). "  broadcast="true">
         <events>
             <trigger>
                 <EventListener event=bonus1 />
@@ -1251,7 +1596,7 @@
         </events>
     </SimpleNotification>
 
-    <SimpleNotification message="Switch the camera's position. Press 'C'. "  broadcast="true">
+    <SimpleNotification message="Switch the camera's position. Press (C). "  broadcast="true">
         <events>
             <trigger>
                 <EventListener event=bonus2 />
@@ -1259,7 +1604,7 @@
         </events>
     </SimpleNotification>
 
-    <SimpleNotification message="360° view: press 'Ctrl' + use the mouse "  broadcast="true">
+    <SimpleNotification message="360° view: press (Ctrl) + use the mouse "  broadcast="true">
         <events>
             <trigger>
                 <EventListener event=bonus3 />
@@ -1291,7 +1636,7 @@
         </events>
     </SimpleNotification>
 
-    <SimpleNotification message="Press 'Esc' and return to the main menu."  broadcast="true">
+    <SimpleNotification message="Press (Esc) and return to the main menu."  broadcast="true">
         <events>
             <trigger>
                 <EventListener event=bonus7 />
@@ -1318,10 +1663,11 @@
     <!-- Script code="artificialcontroller setbotlevel 0.1" /-->
   </Scene>
 </Level>
-<!-- TODO: 
-! Quest Interface
-- Foolproof text messages (e.g. verspätete Nachrichten unterdrücken)
-- Radar visibility & Hud Markers (done)
+
+<!-- TODO:
+- Story & more precise Questmessages; more quest hints; fail-quest;
+- Colouring: Show who is friend or foe via the colour
+- Waypoints: show the player the way
+- Foolproof text messages (e.g. verspätete Nachrichten unterdrücken ~done )
 - End Tutorial, if either the Hydrogen Farmer or the SpaceCruiser gets destroyed. (~done)
-
  -->

Modified: code/trunk/data/levels/myTestLevel.oxw
===================================================================
--- code/trunk/data/levels/myTestLevel.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/myTestLevel.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "MyTestLevel"
  description = "A level to test the Class SpaceBoundaries."
  tags = "test"
+ screenshot = "mytestlevel.png"
 />
 
 <?lua
@@ -15,10 +16,7 @@
   include("templates/spaceshipPirate.oxt")
 ?>
 
-<Level
- name         = "Sample"
- description  = "Just a few tests"
->
+<Level>
   <templates>
     <Template link=lodtemplate_default />
   </templates>

Modified: code/trunk/data/levels/notifications.oxw
===================================================================
--- code/trunk/data/levels/notifications.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/notifications.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "Notifications showcase"
  description = "Level to test and showcase notifications."
  tags = "test, showcase"
+ screenshot = "notificationsshowcase.png"
 />
 
 <?lua
@@ -11,10 +12,7 @@
   include("templates/lodInformation.oxt")
 ?>
 
-<Level
- name         = "Presentation"
- description  = "A simple testlevel"
->
+<Level>
     <templates>
         <Template link=lodtemplate_default />
     </templates>

Modified: code/trunk/data/levels/pickups.oxw
===================================================================
--- code/trunk/data/levels/pickups.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/pickups.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "Pickups showcase"
  description = "Level to test and showcase pickups."
  tags = "test, showcase"
+ screenshot = "pickupsshowcase.png"
 />
 
 <?lua
@@ -15,10 +16,7 @@
   include("templates/lodInformation.oxt")
 ?>
 
-<Level
- name         = "Sample"
- description  = "Just a few tests"
->
+<Level>
   <templates>
     <Template link=lodtemplate_default />
   </templates>

Modified: code/trunk/data/levels/pirateAttack.oxw
===================================================================
--- code/trunk/data/levels/pirateAttack.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/pirateAttack.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,7 +1,8 @@
 <LevelInfo
  name = "Pirate Attack"
  description = "Dani's Testlevel"
- tags = "test"
+ tags = "mission"
+ screenshot = "pirateattack.png"
 />
 
 <?lua
@@ -27,7 +28,7 @@
 <Level
 name="Dani's Testlevel"
 description="Erste Versuche mit den Quests"
-gametype=TeamDeathmatch
+gametype=Mission
 >
 
   <templates>

Modified: code/trunk/data/levels/planets.oxw
===================================================================
--- code/trunk/data/levels/planets.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/planets.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "Planet Demonstration"
  description = "Demonstration of Planets"
  tags = "showcase"
+ screenshot = "planetdemonstration.png"
 />
 
 <?lua
@@ -11,10 +12,7 @@
   include("templates/spaceshipHXY.oxt")
 ?>
 
-<Level
- name         = "Planet"
- description  = "Demonstration of Planets"
->
+<Level>
   <templates>
     <Template link="lodtemplate_default" />
   </templates>

Modified: code/trunk/data/levels/pong.oxw
===================================================================
--- code/trunk/data/levels/pong.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/pong.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,7 +1,8 @@
 <LevelInfo
  name = "Pong"
  description = "Pong in space!"
- tags = ""
+ tags = "minigame"
+ screenshot = "pong.png"
 />
 
 <?lua
@@ -48,9 +49,7 @@
 
 
 <Level
- name         = "Presentation"
- description  = "A simple testlevel"
- gametype     = Pong
+ gametype = "Pong"
 >
   <templates>
     <Template link=lodtemplate_default />

Modified: code/trunk/data/levels/portals.oxw
===================================================================
--- code/trunk/data/levels/portals.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/portals.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,7 +2,8 @@
 <LevelInfo
  name = "Portals"
  description = "Level for testing portals"
- tags = "tutorial"
+ tags = "test"
+ screenshot = "portals.png"
 />
 
 <?lua
@@ -13,10 +14,7 @@
   include("templates/lodInformation.oxt")
 ?>
 
-<Level
- name         = "Presentation"
- description  = "A simple testlevel"
->
+<Level>
   <templates>
     <Template link=lodtemplate_default />
   </templates>

Modified: code/trunk/data/levels/presentation.oxw
===================================================================
--- code/trunk/data/levels/presentation.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/presentation.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "Presentation"
  description = "Presentation Level"
  tags = "presentation"
+ screenshot = "presentation.png"
 />
 
 <?lua
@@ -11,10 +12,7 @@
   include("templates/lodInformation.oxt")
 ?>
 
-<Level
- name         = "Sample"
- description  = "Just a few tests"
->
+<Level>
   <templates>
     <Template link=lodtemplate_default />
   </templates>

Modified: code/trunk/data/levels/presentation09.oxw
===================================================================
--- code/trunk/data/levels/presentation09.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/presentation09.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "Presentation X 3rd"
  description = "3rd Presentation level for Orxonox Convention X"
  tags = "presentation"
+ screenshot = "presentationx3rd.png"
 />
 
 <?lua
@@ -12,11 +13,7 @@
   include("templates/lodInformation.oxt")
 ?>
 
-<Level
- name         = "Presentation09"
- description  = "presentation level for Orxonox Convention X"
-
->
+<Level>
   <templates>
     <Template link=lodtemplate_default />
   </templates>

Modified: code/trunk/data/levels/presentation09b.oxw
===================================================================
--- code/trunk/data/levels/presentation09b.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/presentation09b.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "Presentation X2"
  description = "2nd Presentation level for Orxonox Convention X"
  tags = "presentation"
+ screenshot = "presentationx2.png"
 />
 
 <?lua
@@ -15,9 +16,7 @@
 ?>
 
 <Level
- name         = "Presentation09"
- description  = "presentation level for Orxonox Convention X"
- gametype     = TeamDeathmatch
+ gametype = "TeamDeathmatch"
 >
   <templates>
     <Template link=lodtemplate_default />

Modified: code/trunk/data/levels/presentationDM.oxw
===================================================================
--- code/trunk/data/levels/presentationDM.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/presentationDM.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "Presentation DM"
  description = "Presentation Level"
  tags = "presentation"
+ screenshot = "presentationdm.png"
 />
 
 <?lua
@@ -13,9 +14,7 @@
 ?>
 
 <Level
- name         = "Presentation"
- description  = "A simple testlevel"
- gametype     = Deathmatch
+ gametype = "Deathmatch"
 >
   <templates>
     <Template link=lodtemplate_default />

Modified: code/trunk/data/levels/presentationFS10.oxw
===================================================================
--- code/trunk/data/levels/presentationFS10.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/presentationFS10.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "Presentation XI"
  description = "1st Presentation level for Orxonox Convention XI"
  tags = "presentation"
+ screenshot = "presentationxi.png"
 />
 
 <?lua
@@ -18,9 +19,7 @@
 ?>
 
 <Level
- name         = "Sample"
- description  = "Just a few tests"
- gametype     = TeamDeathmatch
+ gametype = "TeamDeathmatch"
 >
   <templates>
     <Template link=lodtemplate_default />

Modified: code/trunk/data/levels/presentationFS102.oxw
===================================================================
--- code/trunk/data/levels/presentationFS102.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/presentationFS102.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "Presentation XI FPS 1st"
  description = "2nd Presentation level for Orxonox Convention XI, FPS"
  tags = "presentation"
+ screenshot = "presentationxifps1st.png"
 />
 
 <?lua
@@ -13,10 +14,7 @@
   include("templates/lodInformation.oxt")
 ?>
 
-<Level
- name         = "fps"
- description  = "tests"
->
+<Level>
   <templates>
     <Template link=lodtemplate_default />
   </templates>

Modified: code/trunk/data/levels/presentationFS10Ed.oxw
===================================================================
--- code/trunk/data/levels/presentationFS10Ed.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/presentationFS10Ed.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "Presentation XI FPS 2nd"
  description = "3rd Presentation level for Orxonox Convention XI, FPS"
  tags = "presentation"
+ screenshot = "presentationxifps2nd.png"
 />
 
 <?lua
@@ -13,10 +14,7 @@
   include("templates/lodInformation.oxt")
 ?>
 
-<Level
- name         = "fps"
- description  = "tests"
->
+<Level>
   <templates>
     <Template link=lodtemplate_default />
   </templates>

Modified: code/trunk/data/levels/presentationFS11.oxw
===================================================================
--- code/trunk/data/levels/presentationFS11.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/presentationFS11.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,7 +1,8 @@
 <LevelInfo
  name = "Presentation FS11"
  description = "Presentation level spring semester '11"
- tags = "test"
+ tags = "presentation"
+ screenshot = "presentationfs11.png"
 />
 
 <?lua
@@ -20,10 +21,7 @@
 include("templates/pickupRepresentationTemplates.oxt")
 ?>
 
-<Level
- name         = "Sample"
- description  = "Just a few tests"
->
+<Level>
   <templates>
     <Template link=lodtemplate_default />
   </templates>

Modified: code/trunk/data/levels/presentationHS09.oxw
===================================================================
--- code/trunk/data/levels/presentationHS09.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/presentationHS09.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "Presentation X 1st"
  description = "1st Presentation level for Orxonox Convention X"
  tags = "presentation"
+ screenshot = "presentationx1st.png"
 />
 
 <?lua
@@ -15,9 +16,7 @@
 ?>
 
 <Level
- name         = "Presentation09"
- description  = "presentation level for Orxonox Convention X"
- gametype     = TeamDeathmatch
+ gametype = "TeamDeathmatch"
  hasPhysics = true
 >
   <templates>

Modified: code/trunk/data/levels/presentationHS09b.oxw
===================================================================
--- code/trunk/data/levels/presentationHS09b.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/presentationHS09b.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "Presentation X 2nd"
  description = "2nd Presentation level for Orxonox Convention X"
  tags = "presentation"
+ screenshot = "presentationx2nd.png"
 />
 
 <?lua
@@ -21,9 +22,7 @@
 ?>
 
 <Level
- name         = "Sample"
- description  = "Just a few tests"
- gametype     = TeamDeathmatch
+ gametype = "TeamDeathmatch"
 >
   <templates>
     <Template link=lodtemplate_default />

Copied: code/trunk/data/levels/presentationHS11.oxw (from rev 9015, code/branches/presentation2011/data/levels/presentationHS11.oxw)
===================================================================
--- code/trunk/data/levels/presentationHS11.oxw	                        (rev 0)
+++ code/trunk/data/levels/presentationHS11.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -0,0 +1,152 @@
+<LevelInfo
+ name = "Presentation HS 2011"
+ description = "Oxonox Proudly Presents New Features From HS 2011"
+ tags = "presentation"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+?>
+
+<?lua
+  include("templates/spaceshipAssff.oxt")
+  include("templates/spaceshipPirate.oxt")
+  include("templates/spaceshipSwallow.oxt")
+  include("templates/spaceshipTransporter.oxt")
+?>
+
+<Level
+ gametype = "Mission"
+>                      <!--ALTERNATIVE: TeamGametype-->
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+
+  <NotificationQueueCEGUI
+    name="narrative"
+    targets="simpleNotification"
+    size=3
+    displayTime=3.9
+    position="0.2, 0, 0.1, 0"
+    fontSize="23"
+    fontColor="0.3, 1, 0.2, 0.8"
+    alignment="HorzCentred"
+    displaySize="0.6, 0, 0, 0"
+    />
+
+  <Scene
+    ambientlight = "0.8, 0.8, 0.8"
+    skybox       = "Orxonox/skyBoxMoreNebula"
+  >
+
+  <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"/>
+
+  <TeamSpawnPoint team=0 position="800,700,600" direction="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshipswallow/>
+
+  <!-- TRIGGERS -->
+    <DistanceTrigger name="FormationInit" position="800,700,600"  target="Pawn" distance=60 stayActive="true" delay=0.1 />
+    <DistanceTrigger name="LetsGo"        position="200,-200,1000" target="Pawn" distance=180 stayActive="true" delay=0.1 />
+      <BlinkingBillboard colour="1,1,0.05"position="200,-200,1000" frequency=0.6 amplitude=3 material="Flares/lensflare" >
+      </BlinkingBillboard>
+
+
+
+
+    <Script code="formationcontroller formationflight true" onLoad="false">
+        <events>
+            <trigger>
+                <EventListener event=FormationInit />
+            </trigger>
+        </events>
+    </Script> <!-- !!! activates formation behaviour !!! -->
+
+    <Script code="artificialcontroller setbotlevel 0.1" onLoad="false">
+        <events>
+            <trigger>
+                <EventListener event=FormationInit />
+            </trigger>
+        </events>
+    </Script> <!-- make bots "friendly", doesn't work yet :-( -->
+
+    <SimpleNotification message="Let's go!">
+        <events>
+            <trigger>
+                <EventListener event="LetsGo" />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+
+<!-- ADDING FORMATION: 5 Swallows -->
+<?lua for i=0,4,1 do
+?>
+    <SpaceShip position="<?lua print(400+i*200) ?>,-200,1000" lookat="-1300,-600,900" visible="true">
+        <!--events>
+            <visibility>
+                <EventListener event="ondock" />
+            </visibility>
+        </events-->
+        <templates>
+            <Template link=spaceshipswallow /> <!--spaceshipTransporter spaceshippirate-->
+        </templates>
+        <controller>
+            <AIController team=0>
+                <events>
+                    <activity>
+                        <EventListener event="LetsGo" />
+                     </activity>
+                </events>
+            </AIController>
+        </controller>
+    </SpaceShip>
+<?lua end ?>
+
+<?lua for i=0,2,1 do
+?>
+
+
+<!-- ENEMY TRANSPORTER -->
+    <SpaceShip position="<?lua print(-400+i*200) ?>,3000,-2000" lookat="-1300,-600,900" visible="true">
+        <!--events>
+            <visibility>
+                <EventListener event="LetsGo" />
+            </visibility>
+        </events-->
+        <templates>
+            <Template link=spaceshipTransporter />
+        </templates>
+        <controller>
+            <AIController team=1>
+                <events>
+                    <activity>
+                        <EventListener event="LetsGo" />
+                     </activity>
+                </events>
+            </AIController>
+        </controller>
+    </SpaceShip>
+<?lua end ?>
+
+
+
+
+
+
+
+<!-- Generate asteroid field and asteroid belt -->
+<!-- asteroidBelt(centerX, centerY, centerZ, yaw, pitch, segments, minSize, maxSize, radius0, radius1, count, fog) --> 
+    <?lua
+    	dofile("includes/asteroidField.lua")
+    	asteroidBelt(20000, 0, 13000, -48, -34, 70, 100, 200, 22000, 20000, 500, 1)
+
+    ?>
+
+
+
+
+  </Scene>
+</Level>
+

Modified: code/trunk/data/levels/princessAeryn.oxw
===================================================================
--- code/trunk/data/levels/princessAeryn.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/princessAeryn.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,7 +1,8 @@
 <LevelInfo
  name = "The Tale of Princess Aeryn"
  description = "The Tale of the elusive but beautiful Princess Aeryn"
- tags = ""
+ tags = "mission"
+ screenshot = "thetaleofprincessaeryn.png"
 />
 
 <?lua
@@ -15,10 +16,7 @@
   dofile("includes/CuboidSpaceStation.lua")
 ?>
 
-<Level
- name     = "The Tale of Princess Aeryn"
- description  = "The Tale of Princess Aeryn"
->
+<Level>
 
   <templates>
     <Template link=lodtemplate_default />

Modified: code/trunk/data/levels/quests.oxw
===================================================================
--- code/trunk/data/levels/quests.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/quests.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "Quests showcase"
  description = "Level to test and showcase quests."
  tags = "test, showcase"
+ screenshot = "questsshowcase.png"
 />
 
 <?lua
@@ -11,10 +12,7 @@
   include("templates/lodInformation.oxt")
 ?>
 
-<Level
- name         = "Questsystem"
- description  = "Just a few tests"
->
+<Level>
     <templates>
         <Template link=lodtemplate_default />
     </templates>

Modified: code/trunk/data/levels/screenshot.oxw
===================================================================
--- code/trunk/data/levels/screenshot.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/screenshot.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,7 +1,8 @@
 <LevelInfo
  name = "Screenshot"
  description = "Level to make awesome screenshots in."
- tags = "test"
+ tags = "test, showcase"
+ screenshot = "screenshot.png"
 />
 
 <?lua
@@ -14,9 +15,7 @@
 ?>
 
 <Level
- name         = "Waypoints"
- description  = "Testing waypoings for AI controlled spaceships."
- gametype     = TeamDeathmatch
+ gametype = "TeamDeathmatch"
 >
   <templates>
     <Template link=lodtemplate_default />

Modified: code/trunk/data/levels/shieldTest.oxw
===================================================================
--- code/trunk/data/levels/shieldTest.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/shieldTest.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "Shield Testlevel"
  description = "A simple Level with one shielded drone to shoot at"
  tags = "test"
+ screenshot = "shieldtestlevel.png"
 />
 
 <?lua
@@ -11,10 +12,7 @@
   include("templates/lodInformation.oxt")
 ?>
 
-<Level
- name         = "shieldTL"
- description  = "LEVEL-DESCRIPTION"
->
+<Level>
 
 <templates>
   <Template link=lodtemplate_default />

Modified: code/trunk/data/levels/sound.oxw
===================================================================
--- code/trunk/data/levels/sound.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/sound.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,7 +1,8 @@
 <LevelInfo
  name = "Sound showcase"
  description = "Level to test and showcase sound."
- tags = "test"
+ tags = "test, showcase"
+ screenshot = "soundshowcase.png"
 />
 
 <?lua
@@ -15,10 +16,7 @@
   include("templates/spaceshipPirate.oxt")
 ?>
 
-<Level
- name         = "Sample"
- description  = "Just a few tests"
->
+<Level>
   <templates>
     <Template link=lodtemplate_default />
   </templates>

Modified: code/trunk/data/levels/spaceRace.oxw
===================================================================
--- code/trunk/data/levels/spaceRace.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/spaceRace.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,7 +1,8 @@
 <LevelInfo
- name = "Space Race"
- description = "Test level for the gametype Space Race."
- tags = "test"
+ name = "Old Space Race"
+ description = "Have a furious Race in Space: Reach the checkpoints as fast as possible."
+ tags = "gametype"
+ screenshot = "spacerace.png"
 />
 
 <?lua
@@ -16,9 +17,7 @@
 ?>
 
 <Level
- name         = "Space Race"
- description  = "Test level for the gametype Space Race."
- gametype     = SpaceRace
+ gametype = "OldSpaceRace"
 >
   <templates>
     <Template link=lodtemplate_default />
@@ -52,7 +51,7 @@
     </SpawnPoint>
     
     <!-- ------------------CheckPoints----------------- -->
-    <RaceCheckPoint name="checkpoint1" position="0,-2000,1000" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="0" islast="false">
+    <OldRaceCheckPoint name="checkpoint1" position="0,-2000,1000" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="0" islast="false">
         <attached>
             <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
         </attached>
@@ -62,9 +61,9 @@
             <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
             <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
         </collisionShapes>
-    </RaceCheckPoint>
+    </OldRaceCheckPoint>
 
-    <RaceCheckPoint name="checkpoint2" position="0,-900,2300" stayActive="true" collisionType="static" scale="1" distance="40" checkpointindex="1" islast="false">
+    <OldRaceCheckPoint name="checkpoint2" position="0,-900,2300" stayActive="true" collisionType="static" scale="1" distance="40" checkpointindex="1" islast="false">
         <attached>
             <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
             <SpawnPoint position="0,0,0" lookat="0,1000,0" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
@@ -96,9 +95,9 @@
             <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
             <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
         </collisionShapes>
-    </RaceCheckPoint>
+    </OldRaceCheckPoint>
 
-    <RaceCheckPoint name="checkpoint3" position="0,700,2700" stayActive="true" direction="0,0,1" collisionType="static" scale="1" distance="40" checkpointindex="2" islast="false">
+    <OldRaceCheckPoint name="checkpoint3" position="0,700,2700" stayActive="true" direction="0,0,1" collisionType="static" scale="1" distance="40" checkpointindex="2" islast="false">
         <attached>
             <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
             <SpawnPoint position="0,0,0" lookat="0,1000,0" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
@@ -130,9 +129,9 @@
             <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
             <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
         </collisionShapes>
-    </RaceCheckPoint>
+    </OldRaceCheckPoint>
 
-    <RaceCheckPoint name="checkpoint4" position="0,2100,2300" stayActive="true" direction="0,1,1" collisionType="static" scale="1" distance="40" checkpointindex="3" islast="false">
+    <OldRaceCheckPoint name="checkpoint4" position="0,2100,2300" stayActive="true" direction="0,1,1" collisionType="static" scale="1" distance="40" checkpointindex="3" islast="false">
         <attached>
             <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
             <DistanceTrigger name="trigger3" position="0,0,0" distance=40 stayActive="true" />
@@ -165,9 +164,9 @@
             <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
             <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
         </collisionShapes>
-    </RaceCheckPoint>
+    </OldRaceCheckPoint>
 
-    <RaceCheckPoint name="checkpoint5" position="0,2200,500" stayActive="true" direction="0,1,0" collisionType="static" scale="1" distance="40" checkpointindex="4" islast="false">
+    <OldRaceCheckPoint name="checkpoint5" position="0,2200,500" stayActive="true" direction="0,1,0" collisionType="static" scale="1" distance="40" checkpointindex="4" islast="false">
         <attached>
         <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
         <DistanceTrigger name="trigger4" position="0,0,0" distance=40 stayActive="true" />
@@ -200,9 +199,9 @@
             <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
             <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
         </collisionShapes>
-    </RaceCheckPoint>
+    </OldRaceCheckPoint>
 
-    <RaceCheckPoint name="checkpoint6" position="0,1500,-800" stayActive="true" direction="0,1,-1" collisionType="static" scale="1" distance="40" checkpointindex="5" islast="false">
+    <OldRaceCheckPoint name="checkpoint6" position="0,1500,-800" stayActive="true" direction="0,1,-1" collisionType="static" scale="1" distance="40" checkpointindex="5" islast="false">
         <attached>
             <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
             <DistanceTrigger name="trigger5" position="0,0,0" distance=40 stayActive="true" />
@@ -235,9 +234,9 @@
             <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
             <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
         </collisionShapes>
-    </RaceCheckPoint>
+    </OldRaceCheckPoint>
 
-    <RaceCheckPoint name="checkpoint7" position="0,200,-1900" stayActive="true" collisionType="static" scale="1" distance="40" checkpointindex="6" islast="false">
+    <OldRaceCheckPoint name="checkpoint7" position="0,200,-1900" stayActive="true" collisionType="static" scale="1" distance="40" checkpointindex="6" islast="false">
         <attached>
             <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
             <DistanceTrigger name="trigger6" position="0,0,0" distance=40 stayActive="true" />
@@ -270,9 +269,9 @@
             <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
             <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
         </collisionShapes>
-    </RaceCheckPoint>
+    </OldRaceCheckPoint>
 
-    <RaceCheckPoint name="checkpoint8" position="0,-700,-1400" stayActive="true" direction="0,-1,-1" collisionType="static" scale="1" distance="40" checkpointindex="7" islast="false">
+    <OldRaceCheckPoint name="checkpoint8" position="0,-700,-1400" stayActive="true" direction="0,-1,-1" collisionType="static" scale="1" distance="40" checkpointindex="7" islast="false">
         <attached>
         <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
         <DistanceTrigger name="trigger7" position="0,0,0" distance=40 stayActive="true" />
@@ -305,9 +304,9 @@
             <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
             <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
         </collisionShapes>
-    </RaceCheckPoint>
+    </OldRaceCheckPoint>
 
-    <RaceCheckPoint name="checkpoint9" position="0,-1300,-800" stayActive="true" collisionType="static" scale="1" distance="40" checkpointindex="8" islast="false">
+    <OldRaceCheckPoint name="checkpoint9" position="0,-1300,-800" stayActive="true" collisionType="static" scale="1" distance="40" checkpointindex="8" islast="false">
         <attached>
             <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
             <DistanceTrigger name="trigger8" position="0,0,0" distance=40 stayActive="true" />
@@ -331,9 +330,9 @@
             <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
             <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
         </collisionShapes>
-    </RaceCheckPoint>
+    </OldRaceCheckPoint>
 
-    <RaceCheckPoint name="checkpoint10" position="0,-2100,0" collisionType="static" scale="1" distance="40" checkpointindex="9" islast="true" timelimit="150">
+    <OldRaceCheckPoint name="checkpoint10" position="0,-2100,0" collisionType="static" scale="1" distance="40" checkpointindex="9" islast="true" timelimit="150">
         <attached>
         <   Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
         </attached>
@@ -343,7 +342,7 @@
             <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
             <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
         </collisionShapes>
-    </RaceCheckPoint>
+    </OldRaceCheckPoint>
 
     <!-- ------------------Planet----------------- -->
     <Planet position="0,0,0" scale=300 pitch=-90 mesh="iceplanet.mesh" atmosphere="atmosphere1" rotationaxis="8,1,0" rotationrate="1" atmospheresize=224.0f imagesize=1024.0f />

Modified: code/trunk/data/levels/teamBaseMatch.oxw
===================================================================
--- code/trunk/data/levels/teamBaseMatch.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/teamBaseMatch.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,7 +1,8 @@
 <LevelInfo
  name = "Teambase Match"
- description = "Fight for the bases."
- tags = ""
+ description = "Fight for the bases. Capture bases by shooting at them and defend them against attackers."
+ tags = "gametype"
+ screenshot = "teambasematch.png"
 />
 
 <?lua
@@ -14,9 +15,7 @@
 ?>
 
 <Level
- name         = "Presentation"
- description  = "A simple testlevel"
- gametype     = TeamBaseMatch
+ gametype = "TeamBaseMatch"
 >
 
   <templates>

Modified: code/trunk/data/levels/teamDeathMatch.oxw
===================================================================
--- code/trunk/data/levels/teamDeathMatch.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/teamDeathMatch.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,7 +1,8 @@
 <LevelInfo
  name = "Team Deathmatch"
  description = "Fight against each other in teams."
- tags = ""
+ tags = "gametype"
+ screenshot = "teamdeathmatch.png"
 />
 
 <?lua
@@ -14,9 +15,7 @@
 ?>
 
 <Level
- name         = "Waypoints"
- description  = "Testing waypoings for AI controlled spaceships."
- gametype     = TeamDeathmatch
+ gametype = "TeamDeathmatch"
 >
   <templates>
     <Template link=lodtemplate_default />

Modified: code/trunk/data/levels/templates/spaceshipSpacecruiser.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipSpacecruiser.oxt	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/templates/spaceshipSpacecruiser.oxt	2012-02-15 22:51:58 UTC (rev 9016)
@@ -10,10 +10,10 @@
    maxhealth         = 400
    initialhealth     = 300
 
-   shieldhealth        = 60
-   initialshieldhealth = 60
-   maxshieldhealth     = 80
-   shieldabsorption    = 0.8
+   shieldhealth        = 75
+   initialshieldhealth = 75
+   maxshieldhealth     = 90
+   shieldabsorption    = 0.9
    reloadrate          = 1
    reloadwaittime      = 1
 
@@ -44,7 +44,7 @@
       <MultiStateEngine position="-7.6, 20, 0" template=spaceshipcruiserengine />
     </engines>
     <attached>
-      <Model position="12,-30,-120" yaw=90 pitch=-90 roll=0 scale=6 mesh="spacecruiser.mesh" />
+      <Model position="12,-5,-10" yaw=90 pitch=-90 roll=0 scale=6 mesh="spacecruiser.mesh" />
       <!--Model mesh="cube.mesh" mass=10 position="0,-30,-108" scale3D="38,6,62" />
       <Model mesh="cube.mesh" mass=10 position="0,-20,-108" scale3D="20,6,40" />
       <Model mesh="cube.mesh" mass=10 position="-16,-35,-112" scale3D="15,5,57" roll=-14 pitch=3.5/>
@@ -56,17 +56,17 @@
 
     </attached>
     <collisionShapes>
-      <BoxCollisionShape position="0,-30,-108"   halfExtents="38,6,62" />
-      <BoxCollisionShape position="0,-20,-108"   halfExtents="20,6,40" />
-      <BoxCollisionShape position="-16,-35,-112"  halfExtents="15,5,57" roll=-14 pitch=3.5/>
-      <BoxCollisionShape position="16,-35,-112"   halfExtents="15,5,57" roll=14 pitch=3.5/>
-      <BoxCollisionShape position="19,-21.5,-108" halfExtents="18,5,52" roll=-21 />
-      <BoxCollisionShape position="-19,-21.5,-108"halfExtents="18,5,52" roll=21 />
-      <BoxCollisionShape position="0,-21,-169"halfExtents="18,1,16" pitch=-30x />
+      <BoxCollisionShape position="0,-5,2"     halfExtents="38,6,62" />
+      <BoxCollisionShape position="0,5,2"      halfExtents="20,6,40" />
+      <BoxCollisionShape position="-16,-10,-2" halfExtents="15,5,57" roll=-14 pitch=3.5/>
+      <BoxCollisionShape position="16,-10,-2"  halfExtents="15,5,57" roll=14  pitch=3.5/>
+      <BoxCollisionShape position="19,3.5,2"   halfExtents="18,5,52" roll=-21 />
+      <BoxCollisionShape position="-19,4.5,2"  halfExtents="18,5,52" roll=21  />
+      <BoxCollisionShape position="0,4,-59"    halfExtents="18,1,16" pitch=-30/>
 
     </collisionShapes>
 <?lua
-  include("includes/weaponSettingsSpacecruiser.oxi")
+  include("../includes/weaponSettingsSpacecruiser.oxi")
 ?>
   </SpaceShip>
 </Template>
@@ -74,16 +74,9 @@
 <Template name=spaceshipcruisercameras defaults=0>
   <SpaceShip>
     <camerapositions>
-      <CameraPosition position="0,10,  40" drag=true mouselook=true />
-      <CameraPosition position="0,20,  80" drag=true mouselook=true />
-      <CameraPosition position="0,30, 120" drag=true mouselook=true />
-      <CameraPosition position="0,20,-260" drag=true mouselook=true yaw=180/>
-      <CameraPosition position="0,30,-350" drag=true mouselook=true yaw=180/>
-      <!--CameraPosition position="0,150,-25" pitch=-90 drag=true />
-      <CameraPosition position="0,0,-40" yaw=180 drag=true />
-      <CameraPosition position="0,3,-14" yaw=0 />
-      <CameraPosition position="-50,5,-8" yaw=-90 drag=true />
-      <CameraPosition position="50,5,-8" yaw=90 drag=true /-->
+      <CameraPosition position="0,40, 170" drag=true mouselook=true />
+      <CameraPosition position="0,55, 230" drag=true mouselook=true />
+      <CameraPosition position="0,65, 460" drag=true mouselook=true />
     </camerapositions>
   </SpaceShip>
 </Template>
@@ -92,10 +85,10 @@
   <MultiStateEngine
    boostfactor    = 2
 
-   speedfront     = 150
-   speedback      =  50
-   speedleftright =  50
-   speedupdown    =  50
+   speedfront     = 200
+   speedback      =  70
+   speedleftright =  70
+   speedupdown    =  70
 
    defEngineSndNormal = "sounds/Engine_low.ogg"
    defEngineSndBoost = "sounds/Engine_high.ogg"
@@ -110,25 +103,25 @@
       <WorldSound mainstate="activity" source="sounds/Engine_idle.ogg" looping=1 active=false/>
     </EffectContainer>
     <EffectContainer condition="not idle">
-      <FadingBillboard mainstate=activity active=false scale=0.1 position="20, -25, -40" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
-      <FadingBillboard mainstate=activity active=false scale=0.1 position="-20, -25, -40" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.1 position="20,  0, 70" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.1 position="-20, 0, 70" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
     </EffectContainer>
     <EffectContainer condition="normal or brake">
 
     </EffectContainer>
     <EffectContainer condition="normal or boost">
-      <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 20, -25, -40" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1300 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
-      <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-20, -25, -40" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1300 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 20, 0, 70" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1300 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-20, 0, 70" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1300 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
     </EffectContainer>
     <EffectContainer condition="boost">
-      <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 20, -25, -40" colour="0.6, 0.75, 0.8, 0.7" width=40 length=800 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
-      <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-20, -25, -40" colour="0.6, 0.75, 0.8, 0.7" width=40 length=800 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 20, 0, 70" colour="0.6, 0.75, 0.8, 0.7" width=40 length=800 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-20, 0, 70" colour="0.6, 0.75, 0.8, 0.7" width=40 length=800 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
     </EffectContainer>
 <!--    <EffectContainer condition="brake">
-      <FadingBillboard mainstate=activity active=false scale=0.3 position=" 20, -25, -40" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
-      <FadingBillboard mainstate=activity active=false scale=0.3 position="-20, -25, -40" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
-      <FadingBillboard mainstate=activity active=false scale=0.15 position="20, -25, -40" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
-      <FadingBillboard mainstate=activity active=false scale=0.15 position="-20, -25, -40" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.3 position=" 20,  0, 70" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.3 position="-20,  0, 70" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.15 position="20,  0, 70" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.15 position="-20, 0, 70" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
     </EffectContainer>
 -->
   </MultiStateEngine>

Modified: code/trunk/data/levels/testStars.oxw
===================================================================
--- code/trunk/data/levels/testStars.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/testStars.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "Stars Testlevel"
  description = "Level to test stars"
  tags = "test"
+ screenshot = "starstestlevel.png"
 />
 
 <?lua
@@ -15,10 +16,7 @@
   include("templates/spaceshipPirate.oxt")
 ?>
 
-<Level
- name         = "Sample"
- description  = "Just a few tests"
->
+<Level>
   <templates>
     <Template link=lodtemplate_default />
   </templates>

Modified: code/trunk/data/levels/testSwallow.oxw
===================================================================
--- code/trunk/data/levels/testSwallow.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/testSwallow.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "Swallow Testlevel"
  description = "Level to test the swallow spaceship."
  tags = "test"
+ screenshot = "swallowtestlevel.png"
 />
 
 <?lua
@@ -12,12 +13,8 @@
   include("templates/lodInformation.oxt")
 ?>
 
-<Level
- name         = "Presentation_swallow"
- description  = "presentation level for Orxonox Convention X"
+<Level>
 
->
-
   <templates>
     <Template link=lodtemplate_default />
   </templates>

Modified: code/trunk/data/levels/tetris.oxw
===================================================================
--- code/trunk/data/levels/tetris.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/tetris.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,7 +1,8 @@
 <LevelInfo
  name = "Tetris"
  description = "Tetris in space!"
- tags = ""
+ tags = "minigame"
+ screenshot = "tetris.png"
 />
 
 <?lua
@@ -29,9 +30,7 @@
 </Template>
 
 <Level
- name         = "Presentation"
- description  = "A simple testlevel"
- gametype     = "Tetris"
+ gametype = "Tetris"
 >
   <templates>
     <Template link=lodtemplate_default />

Modified: code/trunk/data/levels/theTimeMachine.oxw
===================================================================
--- code/trunk/data/levels/theTimeMachine.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/theTimeMachine.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,7 +1,8 @@
 <LevelInfo
  name = "The Time Machine"
  description = "A simple level. The only goal is to defeat as much enemies as you can."
- tags = "singleplayer"
+ tags = "gametype"
+ screenshot = "thetimemachine.png"
 />
 
 <?lua 
@@ -60,9 +61,7 @@
 <!--*****************************************************************************************************************************************************************************************-->
 
 <Level
-    name="The Time Machine"
-    description="A simple level. The only goal is to defeat as much enemies as you can."
-    gametype=TeamDeathmatch
+ gametype = "TeamDeathmatch"
 >
     <templates>
         <Template link=lodtemplate_default />

Modified: code/trunk/data/levels/tutorial.oxw
===================================================================
--- code/trunk/data/levels/tutorial.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/tutorial.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "Coding Tutorial"
  description = "Level for the coding tutorial."
  tags = "tutorial"
+ screenshot = "codingtutorial.png"
 />
 
 <?lua
@@ -11,10 +12,7 @@
   include("templates/lodInformation.oxt")
 ?>
 
-<Level
- name         = "Presentation"
- description  = "A simple testlevel"
->
+<Level>
   <templates>
     <Template link=lodtemplate_default />
   </templates>

Modified: code/trunk/data/levels/underAttack.oxw
===================================================================
--- code/trunk/data/levels/underAttack.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/underAttack.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,15 +1,20 @@
+<LevelInfo
+ name = "Under Attack"
+ description = "Fight the transporter."
+ tags = "gametype"
+ screenshot = "underattack.png"
+/>
+
 <?lua
   include("HUDTemplates3.oxo")
   include("stats.oxo")
-  include("underAttackHUD.oxo")
   include("templates/spaceshipAssff.oxt")
   include("templates/lodInformation.oxt")
 ?>
+<!--OUTDATED: include("underAttackHUD.oxo") -->
 
 <Level
- name         = "UnderAttack testing"
- description  = "A simple testlevel"
- gametype     = UnderAttack
+ gametype = "UnderAttack"
 >
   <templates>
     <Template link=lodtemplate_default />
@@ -50,6 +55,7 @@
       health            = 10000
       maxhealth         = 10000
       initialhealth     = 10000
+      RVName            = "Transporter"
     >
 
       <attached>

Modified: code/trunk/data/levels/waypoints.oxw
===================================================================
--- code/trunk/data/levels/waypoints.oxw	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/levels/waypoints.oxw	2012-02-15 22:51:58 UTC (rev 9016)
@@ -2,6 +2,7 @@
  name = "Waypoints Testlevel"
  description = "Testing waypoings for AI controlled spaceships."
  tags = "test"
+ screenshot = "waypointstestlevel.png"
 />
 
 <?lua
@@ -13,10 +14,7 @@
   include("templates/lodInformation.oxt")
 ?>
 
-<Level
- name         = "Waypoints"
- description  = "Testing waypoings for AI controlled spaceships."
->
+<Level>
   <templates>
     <Template link=lodtemplate_default />
   </templates>

Modified: code/trunk/data/overlays/HUDTemplates3.oxo
===================================================================
--- code/trunk/data/overlays/HUDTemplates3.oxo	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/overlays/HUDTemplates3.oxo	2012-02-15 22:51:58 UTC (rev 9016)
@@ -77,6 +77,27 @@
       <BarColour position = 1.0 colour = "0.2,0.7,0.2" />
     </HUDBoostBar>
 
+    <HUDEnemyHealthBar
+     name              = "EnemyHealthBar"
+     background        = "Orxonox/HealthBarBackground"
+     size              = "0.35, 0.0875"
+     position          = "1.0 , 0.1 "
+     pickpoint         = "1, 1"
+     bartexture        = "healthbar_bar.png"
+     textfont          = "VeraMono"
+     textusebarcolour  = true
+     textsize          = 0.039
+     textoffset        = "0.315, 0.05"
+     textpickpoint     = "0, 0"
+     textalign         = "right"
+     correctaspect     = false
+     textcorrectaspect = false
+    >
+      <BarColour position = 0.0 colour = "0.7,0.2,0.2" />
+      <BarColour position = 0.5 colour = "0.7,0.7,0.2" />
+      <BarColour position = 1.0 colour = "0.2,0.7,0.2" />
+    </HUDEnemyHealthBar>
+
     <HUDNavigation
      name          = "Navigation"
      correctaspect = true

Modified: code/trunk/data/overlays/underAttackHUD.oxo
===================================================================
--- code/trunk/data/overlays/underAttackHUD.oxo	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/data/overlays/underAttackHUD.oxo	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,6 +1,6 @@
-<Template name="UnderAttackHUD">
+< Template name="UnderAttackHUD">
   <OverlayGroup name="UnderAttackHUD" scale = "1, 1">
-    <UnderAttackHealthBar
+    <OUTDATED-- UnderAttackHealthBar
      name                 = "HealthBar"
      background           = "Orxonox/HealthBarBackground"
      size                 = "0.45, 0.0875"

Modified: code/trunk/src/libraries/core/GUIManager.cc
===================================================================
--- code/trunk/src/libraries/core/GUIManager.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/libraries/core/GUIManager.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -222,7 +222,7 @@
     static CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button);
 
     GUIManager* GUIManager::singletonPtr_s = 0;
-    /*static*/ const std::string GUIManager::defaultScheme_ = "TaharezGreen";
+    /*static*/ const std::string GUIManager::defaultScheme_ = "TaharezGreen"; //Alternative: Orxonox (not fully complete yet, see the graphics menu)
 
     SetConsoleCommand("showGUI", &GUIManager::showGUI).defaultValue(1, false).defaultValue(2, false);
     SetConsoleCommand("hideGUI", &GUIManager::hideGUI);

Modified: code/trunk/src/libraries/util/SignalHandler.cc
===================================================================
--- code/trunk/src/libraries/util/SignalHandler.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/libraries/util/SignalHandler.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -69,7 +69,7 @@
       assert( sigRecList.size() == 0 );
 
       catchSignal( SIGSEGV );
-      catchSignal( SIGABRT );
+      catchSignal( SIGABRT );  
       catchSignal( SIGILL );
     }
 
@@ -674,7 +674,7 @@
     }
 
     /// Returns a description of the given exception.
-    // Based on code from Dr. Mingw by José Fonseca
+    // Based on code from Dr. Mingw by Jos\E9 Fonseca
     /* static */ std::string SignalHandler::getExceptionType(PEXCEPTION_POINTERS pExceptionInfo)
     {
         PEXCEPTION_RECORD pExceptionRecord = pExceptionInfo->ExceptionRecord;
@@ -744,7 +744,7 @@
     }
 
     /// Retrieves the base address of the module that contains the specified address.
-    // Code from Dr. Mingw by José Fonseca
+    // Code from Dr. Mingw by Jos\E9 Fonseca
     /* static */ DWORD SignalHandler::getModuleBase(DWORD dwAddress)
     {
         MEMORY_BASIC_INFORMATION Buffer;

Modified: code/trunk/src/modules/gametypes/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/gametypes/CMakeLists.txt	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/modules/gametypes/CMakeLists.txt	2012-02-15 22:51:58 UTC (rev 9016)
@@ -1,6 +1,9 @@
 SET_SOURCE_FILES(GAMETYPES_SRC_FILES
   SpaceRace.cc
   RaceCheckPoint.cc
+  SpaceRaceManager.cc
+  OldSpaceRace.cc
+  OldRaceCheckPoint.cc
 )
 
 ORXONOX_ADD_LIBRARY(gametypes

Modified: code/trunk/src/modules/gametypes/GametypesPrereqs.h
===================================================================
--- code/trunk/src/modules/gametypes/GametypesPrereqs.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/modules/gametypes/GametypesPrereqs.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -65,6 +65,7 @@
 namespace orxonox
 {
     class SpaceRace;
+    class OldSpaceRace;
 }
 
 #endif /* _GametypesPrereqs_H__ */

Copied: code/trunk/src/modules/gametypes/OldRaceCheckPoint.cc (from rev 9015, code/branches/presentation2011/src/modules/gametypes/OldRaceCheckPoint.cc)
===================================================================
--- code/trunk/src/modules/gametypes/OldRaceCheckPoint.cc	                        (rev 0)
+++ code/trunk/src/modules/gametypes/OldRaceCheckPoint.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -0,0 +1,120 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Mauro Salomon
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OldRaceCheckPoint.h"
+
+#include "util/Convert.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "chat/ChatManager.h"
+
+#include "OldSpaceRace.h"
+
+namespace orxonox
+{
+    CreateFactory(OldRaceCheckPoint);
+
+    OldRaceCheckPoint::OldRaceCheckPoint(BaseObject* creator): DistanceTrigger(creator), RadarViewable(creator, static_cast<WorldEntity*>(this))
+    {
+        RegisterObject(OldRaceCheckPoint);
+
+        this->bCheckpointIndex_ = 0;
+        this->bIsLast_ = false;
+        this->bTimeLimit_ = 0;
+
+        this->setRadarObjectColour(ColourValue::Blue);
+        this->setRadarObjectShape(RadarViewable::Triangle);
+        this->setRadarVisibility(false);
+    }
+
+    OldRaceCheckPoint::~OldRaceCheckPoint()
+    {
+    }
+
+    void OldRaceCheckPoint::tick(float dt)
+    {
+        SUPER(OldRaceCheckPoint, tick, dt);
+
+        OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype().get());
+        assert(gametype);
+        if (this->getCheckpointIndex() == gametype->getCheckpointsReached())
+            this->setRadarVisibility(true);
+        else
+            this->setRadarVisibility(false);
+    }
+
+    void OldRaceCheckPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(OldRaceCheckPoint, XMLPort, xmlelement, mode);
+
+        XMLPortParam(OldRaceCheckPoint, "checkpointindex", setCheckpointIndex, getCheckpointIndex, xmlelement, mode).defaultValues(0);
+        XMLPortParam(OldRaceCheckPoint, "islast", setLast, getLast, xmlelement, mode).defaultValues(false);
+        XMLPortParam(OldRaceCheckPoint, "timelimit", setTimelimit, getTimeLimit, xmlelement, mode).defaultValues(0);
+    }
+
+    void OldRaceCheckPoint::triggered(bool bIsTriggered)
+    {
+        DistanceTrigger::triggered(bIsTriggered);
+
+        OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype().get());
+        if (gametype && this->getCheckpointIndex() == gametype->getCheckpointsReached() && bIsTriggered)
+        {
+            gametype->clock_.capture();
+            float time = gametype->clock_.getSecondsPrecise();
+            if (this->bTimeLimit_!=0 && time > this->bTimeLimit_)
+            {
+                gametype->timeIsUp();
+                gametype->end();
+            }
+            else if (this->getLast())
+                gametype->end();
+            else
+            {
+                gametype->newCheckpointReached();
+                this->setRadarObjectColour(ColourValue::Green); //sets the radar colour of the checkpoint to green if it is reached, else it is red.
+            }
+        }
+    }
+
+    void OldRaceCheckPoint::setTimelimit(float timeLimit)
+    {
+        this->bTimeLimit_ = timeLimit;
+        if (this->bTimeLimit_ != 0)
+        {
+            OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype().get());
+            if (gametype)
+            {
+                const std::string& message =  "You have " + multi_cast<std::string>(this->bTimeLimit_)
+                            + " seconds to reach the check point " + multi_cast<std::string>(this->bCheckpointIndex_+1);
+                const_cast<GametypeInfo*>(gametype->getGametypeInfo())->sendAnnounceMessage(message);
+                ChatManager::message(message);
+            }
+        }
+    }
+
+}

Copied: code/trunk/src/modules/gametypes/OldRaceCheckPoint.h (from rev 9015, code/branches/presentation2011/src/modules/gametypes/OldRaceCheckPoint.h)
===================================================================
--- code/trunk/src/modules/gametypes/OldRaceCheckPoint.h	                        (rev 0)
+++ code/trunk/src/modules/gametypes/OldRaceCheckPoint.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -0,0 +1,77 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Mauro Salomon
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _OldRaceCheckPoint_H__
+#define _OldRaceCheckPoint_H__
+
+#include "gametypes/GametypesPrereqs.h"
+
+#include "objects/triggers/DistanceTrigger.h"
+#include "interfaces/RadarViewable.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        The OldRaceCheckPoint class enables the creation of a check point to use in a OldSpaceRace level.
+        !!! Don't forget to control the indexes of your check points and to set one last check point!!!
+    */
+    class _GametypesExport OldRaceCheckPoint : public DistanceTrigger, public RadarViewable
+    {
+        public:
+            OldRaceCheckPoint(BaseObject* creator);
+            virtual ~OldRaceCheckPoint();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void tick(float dt);
+
+            protected:
+            virtual void triggered(bool bIsTriggered);
+            inline void setLast(bool isLast)
+                { this->bIsLast_ = isLast; }
+            inline bool getLast()
+                { return this->bIsLast_; }
+            inline void setCheckpointIndex(int checkpointIndex)
+                { this->bCheckpointIndex_ = checkpointIndex; }
+            inline int getCheckpointIndex()
+                { return this->bCheckpointIndex_; }
+            virtual void setTimelimit(float timeLimit);
+            inline float getTimeLimit()
+                { return this->bTimeLimit_;}
+            inline const WorldEntity* getWorldEntity() const
+                { return this; }
+
+        private:
+            int bCheckpointIndex_; //The index of this check point. This value will be compared with the number of check points reached in the level. The check points must be indexed in ascending order beginning from zero and without any jumps between the indexes.
+            bool bIsLast_; //True if this check point is the last of the level. There can be only one last check point for each level and there must be a last check point in the level.
+            float bTimeLimit_; //The time limit (from the start of the level) to reach this check point. If the check point is reached after this time, the game ends and the player looses.
+      
+    };
+}
+
+#endif /* _OldRaceCheckPoint_H__ */

Copied: code/trunk/src/modules/gametypes/OldSpaceRace.cc (from rev 9015, code/branches/presentation2011/src/modules/gametypes/OldSpaceRace.cc)
===================================================================
--- code/trunk/src/modules/gametypes/OldSpaceRace.cc	                        (rev 0)
+++ code/trunk/src/modules/gametypes/OldSpaceRace.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -0,0 +1,104 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *     Mauro Salomon
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OldSpaceRace.h"
+
+#include "core/CoreIncludes.h"
+#include "chat/ChatManager.h"
+#include "util/Convert.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(OldSpaceRace);
+
+    OldSpaceRace::OldSpaceRace(BaseObject* creator) : Gametype(creator)
+    {
+        RegisterObject(OldSpaceRace);
+        this->checkpointsReached_ = 0;
+        this->bTimeIsUp_ = false;
+        this->numberOfBots_ = 0;
+    }
+
+    void OldSpaceRace::end()
+    {
+        this->Gametype::end();
+
+        if (this->bTimeIsUp_)
+        {
+            this->clock_.capture();
+            int s = this->clock_.getSeconds();
+            int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);
+            const std::string& message = multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds !!\n"
+                        + "You didn't reach the check point " + multi_cast<std::string>(this->checkpointsReached_+1)
+                        + " before the time limit. You lose!";
+            const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+            ChatManager::message(message);
+        }
+        else
+        {
+            this->clock_.capture();
+            int s = this->clock_.getSeconds();
+            int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);
+            const std::string& message = "You win!! You have reached the last check point after "+ multi_cast<std::string>(s)
+                        + "." + multi_cast<std::string>(ms) + " seconds.";
+            const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+            ChatManager::message(message);
+/*
+            float time = this->clock_.getSecondsPrecise();
+            this->scores_.insert(time);
+            std::set<float>::iterator it;
+            for (it=this->scores_.begin(); it!=this->scores_.end(); it++)
+                orxout(level::message) << multi_cast<std::string>(*it) << endl;
+*/
+        }
+    }
+
+    void OldSpaceRace::start()
+    {
+        Gametype::start();
+
+        std::string message("The match has started! Reach the check points as quickly as possible!");
+        const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+        ChatManager::message(message);
+    }
+
+    void OldSpaceRace::newCheckpointReached()
+    {
+        this->checkpointsReached_++;
+        this->clock_.capture();
+        int s = this->clock_.getSeconds();
+        int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);
+        const std::string& message = "Checkpoint " + multi_cast<std::string>(this->getCheckpointsReached())
+                        + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms)
+                        + " seconds.";
+        const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+        ChatManager::message(message);
+    }
+
+}

Copied: code/trunk/src/modules/gametypes/OldSpaceRace.h (from rev 9015, code/branches/presentation2011/src/modules/gametypes/OldSpaceRace.h)
===================================================================
--- code/trunk/src/modules/gametypes/OldSpaceRace.h	                        (rev 0)
+++ code/trunk/src/modules/gametypes/OldSpaceRace.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -0,0 +1,79 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Mauro Salomon
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _OldSpaceRace_H__
+#define _OldSpaceRace_H__
+
+#include "gametypes/GametypesPrereqs.h"
+
+#include <set>
+#include <string>
+
+#include <util/Clock.h>
+
+#include "gametypes/Gametype.h"
+
+#include "OldRaceCheckPoint.h"
+
+namespace orxonox
+{
+  /**
+  @brief
+    The OldSpaceRace class enables the creation of a space race level, where the player has to reach check points in a given order.
+  */
+    class _GametypesExport OldSpaceRace : public Gametype
+    {
+        friend class OldRaceCheckPoint;
+
+        public:
+            OldSpaceRace(BaseObject* creator);
+            virtual ~OldSpaceRace() {}
+
+            virtual void start();
+            virtual void end();
+
+            virtual void newCheckpointReached();
+
+            inline void setCheckpointsReached(int n)
+                { this->checkpointsReached_ = n;}
+            inline int getCheckpointsReached()
+                { return this->checkpointsReached_; }
+            inline void timeIsUp()
+                { this->bTimeIsUp_ = true;}
+
+        protected:
+
+        private:
+            int checkpointsReached_; //The current number of check points reached by the player.
+            std::set<float> scores_; //The times of the players are saved in a set.
+            bool bTimeIsUp_; //True if one of the check points is reached too late.
+            Clock clock_; //The clock starts running at the beginning of the game. It is used to give the time at each check point, the give the time at the end of the game, and to stop the game if a check point is reached too late.
+    };
+}
+
+#endif /* _OldSpaceRace_H__ */

Modified: code/trunk/src/modules/gametypes/RaceCheckPoint.cc
===================================================================
--- code/trunk/src/modules/gametypes/RaceCheckPoint.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/modules/gametypes/RaceCheckPoint.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -33,28 +33,39 @@
 #include "core/XMLPort.h"
 #include "chat/ChatManager.h"
 
+#include <infos/PlayerInfo.h>
+#include <worldentities/ControllableEntity.h>
+
 #include "SpaceRace.h"
 
 namespace orxonox
 {
     CreateFactory(RaceCheckPoint);
+    
+     
 
-    RaceCheckPoint::RaceCheckPoint(BaseObject* creator): DistanceTrigger(creator), RadarViewable(creator, static_cast<WorldEntity*>(this))
+    RaceCheckPoint::RaceCheckPoint(BaseObject* creator): DistanceMultiTrigger(creator), RadarViewable(creator, static_cast<WorldEntity*>(this))
     {
         RegisterObject(RaceCheckPoint);
-
-        this->bCheckpointIndex_ = 0;
-        this->bIsLast_ = false;
+        this->setDistance(100);
+        this->setBeaconMode("off");
+        this->setBroadcast(false);
+        this->setSimultaneousTriggerers(100);
         this->bTimeLimit_ = 0;
 
         this->setRadarObjectColour(ColourValue::Blue);
         this->setRadarObjectShape(RadarViewable::Triangle);
         this->setRadarVisibility(false);
+        this->settingsChanged();
+        this->reached_=NULL;
+      
     }
+    
 
-    RaceCheckPoint::~RaceCheckPoint()
-    {
-    }
+   RaceCheckPoint::~RaceCheckPoint()
+   {
+    
+   }
 
     void RaceCheckPoint::tick(float dt)
     {
@@ -62,43 +73,30 @@
 
         SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
         assert(gametype);
-        if (this->getCheckpointIndex() == gametype->getCheckpointsReached())
-            this->setRadarVisibility(true);
-        else
-            this->setRadarVisibility(false);
     }
 
     void RaceCheckPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
         SUPER(RaceCheckPoint, XMLPort, xmlelement, mode);
-
+        Vector3 v= Vector3(0,0,0);
         XMLPortParam(RaceCheckPoint, "checkpointindex", setCheckpointIndex, getCheckpointIndex, xmlelement, mode).defaultValues(0);
         XMLPortParam(RaceCheckPoint, "islast", setLast, getLast, xmlelement, mode).defaultValues(false);
         XMLPortParam(RaceCheckPoint, "timelimit", setTimelimit, getTimeLimit, xmlelement, mode).defaultValues(0);
+    XMLPortParamTemplate(RaceCheckPoint, "nextcheckpoints", setNextcheckpoint, getNextcheckpoint, xmlelement, mode,const Vector3&).defaultValues(v);
     }
 
-    void RaceCheckPoint::triggered(bool bIsTriggered)
+    void RaceCheckPoint::fire(bool bIsTriggered,BaseObject* player)
     {
-        DistanceTrigger::triggered(bIsTriggered);
-
+        DistanceMultiTrigger::fire((bool)bIsTriggered,player);
+        
         SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
-        if (gametype && this->getCheckpointIndex() == gametype->getCheckpointsReached() && bIsTriggered)
-        {
-            gametype->clock_.capture();
-            float time = gametype->clock_.getSecondsPrecise();
-            if (this->bTimeLimit_!=0 && time > this->bTimeLimit_)
-            {
-                gametype->timeIsUp();
-                gametype->end();
-            }
-            else if (this->getLast())
-                gametype->end();
-            else
-            {
-                gametype->newCheckpointReached();
-                this->setRadarObjectColour(ColourValue::Green); //sets the radar colour of the checkpoint to green if it is reached, else it is red.
-            }
-        }
+        assert(gametype);
+        ControllableEntity* entity = (ControllableEntity*) player;
+     
+        PlayerInfo* player2 = entity->getPlayer();
+     
+        if(bIsTriggered)
+            this->reached_=player2;
     }
 
     void RaceCheckPoint::setTimelimit(float timeLimit)
@@ -107,6 +105,7 @@
         if (this->bTimeLimit_ != 0)
         {
             SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
+            assert(gametype);
             if (gametype)
             {
                 const std::string& message =  "You have " + multi_cast<std::string>(this->bTimeLimit_)

Modified: code/trunk/src/modules/gametypes/RaceCheckPoint.h
===================================================================
--- code/trunk/src/modules/gametypes/RaceCheckPoint.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/modules/gametypes/RaceCheckPoint.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -31,7 +31,9 @@
 
 #include "gametypes/GametypesPrereqs.h"
 
-#include "objects/triggers/DistanceTrigger.h"
+
+
+#include "objects/triggers/DistanceMultiTrigger.h"
 #include "interfaces/RadarViewable.h"
 
 namespace orxonox
@@ -39,9 +41,9 @@
     /**
     @brief
         The RaceCheckPoint class enables the creation of a check point to use in a SpaceRace level.
-        !!! Don't forget to control the indexes of your check points and to set one last check point!!!
+         Don't forget to control the indexes of your check points and to set one last check point
     */
-    class _GametypesExport RaceCheckPoint : public DistanceTrigger, public RadarViewable
+    class _GametypesExport RaceCheckPoint : public DistanceMultiTrigger, public RadarViewable
     {
         public:
             RaceCheckPoint(BaseObject* creator);
@@ -49,29 +51,41 @@
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             virtual void tick(float dt);
+            inline void setCheckpointIndex(int checkpointIndex)
+                { this->bCheckpointIndex_ = checkpointIndex; }
+            inline int getCheckpointIndex()
+                { return this->bCheckpointIndex_; }
 
-            protected:
-            virtual void triggered(bool bIsTriggered);
+            inline void setNextcheckpoint(const Vector3& checkpoints)
+                { this->nextcheckpoints_=checkpoints; }
+            inline void setNextcheckpoint(float x, float y, float z)
+                { this->setNextcheckpoint(Vector3(x, y, z)); }
+            inline const Vector3& getNextcheckpoint() const
+                { return this->nextcheckpoints_; }
             inline void setLast(bool isLast)
                 { this->bIsLast_ = isLast; }
             inline bool getLast()
                 { return this->bIsLast_; }
-            inline void setCheckpointIndex(int checkpointIndex)
-                { this->bCheckpointIndex_ = checkpointIndex; }
-            inline int getCheckpointIndex()
-                { return this->bCheckpointIndex_; }
+
+            bool bIsLast_; //True if this check point is the last of the level. There can be only one last check point for each level and there must be a last check point in the level.
+            float bTimeLimit_; //The time limit (from the start of the level) to reach this check point. If the check point is reached after this time, the game ends and the player looses.
+            PlayerInfo* reached_;
+                
+            inline float getTimeLimit()
+                { return this->bTimeLimit_; }
+    
+        protected:
+            virtual void fire(bool bIsTriggered,BaseObject* player);
             virtual void setTimelimit(float timeLimit);
-            inline float getTimeLimit()
-                { return this->bTimeLimit_;}
+            
             inline const WorldEntity* getWorldEntity() const
                 { return this; }
 
         private:
-            int bCheckpointIndex_; //The index of this check point. This value will be compared with the number of check points reached in the level. The check points must be indexed in ascending order beginning from zero and without any jumps between the indexes.
-            bool bIsLast_; //True if this check point is the last of the level. There can be only one last check point for each level and there must be a last check point in the level.
-            float bTimeLimit_; //The time limit (from the start of the level) to reach this check point. If the check point is reached after this time, the game ends and the player looses.
-      
+            int bCheckpointIndex_; //The index of this check point. The race starts with the check point with the index 0
+            Vector3 nextcheckpoints_; //the indexes of the next check points
+            
     };
 }
 
-#endif /* _RaceCheckPoint_H__ */
\ No newline at end of file
+#endif /* _RaceCheckPoint_H__ */

Modified: code/trunk/src/modules/gametypes/SpaceRace.cc
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRace.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/modules/gametypes/SpaceRace.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -28,11 +28,16 @@
 
 #include "SpaceRace.h"
 
+
+#include "items/Engine.h"
+
 #include "core/CoreIncludes.h"
 #include "chat/ChatManager.h"
 #include "util/Convert.h"
 #include "util/Math.h"
 
+#include "items/Engine.h"
+
 namespace orxonox
 {
     CreateUnloadableFactory(SpaceRace);
@@ -40,10 +45,17 @@
     SpaceRace::SpaceRace(BaseObject* creator) : Gametype(creator)
     {
         RegisterObject(SpaceRace);
-        this->checkpointsReached_ = 0;
+        
         this->bTimeIsUp_ = false;
         this->numberOfBots_ = 0;
+        this->cantMove_=false;
+        
     }
+       
+    
+  // void SpaceRace::SetConfigValues(){
+    //SUPER(Gametype,setConfigValues);
+    //this->Gametype::SetConfigValue(initialStartCountdown_, 3.0f);}
 
     void SpaceRace::end()
     {
@@ -55,8 +67,7 @@
             int s = this->clock_.getSeconds();
             int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);
             const std::string& message = multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds !!\n"
-                        + "You didn't reach the check point " + multi_cast<std::string>(this->checkpointsReached_+1)
-                        + " before the time limit. You lose!";
+                        + "You didn't reach the check point  before the time limit. You lose!";
             const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
             ChatManager::message(message);
         }
@@ -69,36 +80,112 @@
                         + "." + multi_cast<std::string>(ms) + " seconds.";
             const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
             ChatManager::message(message);
-/*
+
             float time = this->clock_.getSecondsPrecise();
             this->scores_.insert(time);
             std::set<float>::iterator it;
-            for (it=this->scores_.begin(); it!=this->scores_.end(); it++)
-                orxout(level::message) << multi_cast<std::string>(*it) << endl;
-*/
+            
+
         }
     }
 
     void SpaceRace::start()
     {
-        Gametype::start();
 
-        std::string message("The match has started! Reach the check points as quickly as possible!");
-        const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
-        ChatManager::message(message);
+        this->spawnPlayersIfRequested();
+        Gametype::checkStart(); 
+        this->cantMove_=true; 
+        
+        for(ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it) 
+        {
+            it->setActive(false);
+            
+        } 
+        this->addBots(this->numberOfBots_); 
     }
+    
+    void SpaceRace::tick(float dt)
+    {
+        SUPER(SpaceRace,tick,dt);
+    
+        if(!this->isStartCountdownRunning() && this->cantMove_)
+        {
+            for(ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it) 
+            { 
+                it->setActive(true);
+                
+            }
+            this->cantMove_= false;
+            
+            std::string message("The match has started! Reach the check points as quickly as possible!");
+            const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+            ChatManager::message(message);            
+        }
+   
+    }
 
-    void SpaceRace::newCheckpointReached()
+    
+    
+    void SpaceRace::newCheckpointReached(SpaceRaceManager* p, int index,PlayerInfo* pl)
     {
-        this->checkpointsReached_++;
+        this->checkpointReached_[pl]=index;
         this->clock_.capture();
         int s = this->clock_.getSeconds();
         int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);
-        const std::string& message = "Checkpoint " + multi_cast<std::string>(this->getCheckpointsReached())
-                        + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms)
-                        + " seconds.";
+        const std::string& message = "Checkpoint " + multi_cast<std::string>(index)
+            + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms)
+            + " seconds.";// Message is too long for a normal screen.
         const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
         ChatManager::message(message);
     }
+   
+    void SpaceRace::newCheckpointReached(RaceCheckPoint* p, PlayerInfo* pl)
+    {   
+        int index = p->getCheckpointIndex();
+        this->checkpointReached_[pl]=index;
+        this->clock_.capture();
+        int s = this->clock_.getSeconds();
+        int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);
+        const std::string& message = "Checkpoint " + multi_cast<std::string>(index)
+            + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms)
+            + " seconds.";
+        const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+        ChatManager::message(message);
+    }
+        
+    
+    void SpaceRace::playerEntered(PlayerInfo* player)
+    {
+        Gametype::playerEntered(player);
+    
+        this->checkpointReached_[player]=-1;
+        //this->playersAlive_++;
+    }
+    
+    bool SpaceRace::playerLeft(PlayerInfo* player)
+    {
+        return Gametype::playerLeft(player);
+        // bool valid_player = true;
+        //if (valid_player)
+       // {
+        //    this->playersAlive_--;
+        //}
 
+       // return valid_player;
+    }
+    
+    bool SpaceRace::allowPawnHit(Pawn* victim, Pawn* originator)
+    {
+        return false;
+    }
+
+    bool SpaceRace::allowPawnDamage(Pawn* victim, Pawn* originator)
+    {
+        return false;
+    }
+
+    bool SpaceRace::allowPawnDeath(Pawn* victim, Pawn* originator)
+    {
+        return false;
+    }
 }

Modified: code/trunk/src/modules/gametypes/SpaceRace.h
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRace.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/modules/gametypes/SpaceRace.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -33,12 +33,13 @@
 
 #include <set>
 #include <string>
+# include <vector>
 
 #include <util/Clock.h>
 
 #include "gametypes/Gametype.h"
 
-#include "RaceCheckPoint.h"
+#include "SpaceRaceManager.h"
 
 namespace orxonox
 {
@@ -49,6 +50,7 @@
     class _GametypesExport SpaceRace : public Gametype
     {
         friend class RaceCheckPoint;
+       
 
         public:
             SpaceRace(BaseObject* creator);
@@ -57,22 +59,35 @@
             virtual void start();
             virtual void end();
 
-            virtual void newCheckpointReached();
+            virtual void newCheckpointReached(SpaceRaceManager* p, int index,PlayerInfo* pl);
+            virtual void newCheckpointReached(RaceCheckPoint* p, PlayerInfo* pl);
 
-            inline void setCheckpointsReached(int n)
-                { this->checkpointsReached_ = n;}
-            inline int getCheckpointsReached()
-                { return this->checkpointsReached_; }
+            inline void setCheckpointReached(int n, PlayerInfo* p)
+                { this->checkpointReached_[p] = n;}
+            inline int getCheckpointReached(PlayerInfo* p)
+                { return this->checkpointReached_[p]; }
+
             inline void timeIsUp()
                 { this->bTimeIsUp_ = true;}
+            void tick(float dt);
+            Clock clock_; //The clock starts running at the beginning of the game. It is used to give the time at each check point, the give the time at the end of the game, and to stop the game if a check point is reached too late.
 
+
+            bool allowPawnHit(Pawn* victim, Pawn* originator);
+
+            bool allowPawnDamage(Pawn* victim, Pawn* originator);
+
+            bool allowPawnDeath(Pawn* victim, Pawn* originator);
         protected:
-
+            virtual void playerEntered(PlayerInfo* player); //!< Initializes values.
+            virtual bool playerLeft(PlayerInfo* player); //!< Manages all local variables.
         private:
-            int checkpointsReached_; //The current number of check points reached by the player.
+            bool cantMove_;
+            std::map<PlayerInfo*, int>checkpointReached_; //The number of the last check point reached by each player.
             std::set<float> scores_; //The times of the players are saved in a set.
             bool bTimeIsUp_; //True if one of the check points is reached too late.
-            Clock clock_; //The clock starts running at the beginning of the game. It is used to give the time at each check point, the give the time at the end of the game, and to stop the game if a check point is reached too late.
+            
+            int playersAlive_;
     };
 }
 

Copied: code/trunk/src/modules/gametypes/SpaceRaceManager.cc (from rev 9015, code/branches/presentation2011/src/modules/gametypes/SpaceRaceManager.cc)
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRaceManager.cc	                        (rev 0)
+++ code/trunk/src/modules/gametypes/SpaceRaceManager.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -0,0 +1,195 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *     Celine Eggenberger
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "SpaceRaceManager.h"
+#include "SpaceRace.h"
+#include "infos/PlayerInfo.h"
+
+#include "core/XMLPort.h"
+
+#include "core/CoreIncludes.h"
+
+#include "util/Convert.h"
+#include "util/Math.h"
+
+
+
+namespace orxonox
+{
+    CreateFactory(SpaceRaceManager);
+
+    SpaceRaceManager::SpaceRaceManager(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(SpaceRaceManager);
+         
+        this->firstcheckpointvisible_=false;
+         
+    }
+
+    SpaceRaceManager::~SpaceRaceManager()
+    {
+        if (this->isInitialized())
+        {
+            for (size_t i = 0; i < this->checkpoints_.size(); ++i)
+                this->checkpoints_[i]->destroy();
+        }
+    }
+   
+    void SpaceRaceManager::addCheckpoint(RaceCheckPoint* checkpoint)
+    {
+        this->checkpoints_.push_back(checkpoint);
+    }
+
+    RaceCheckPoint* SpaceRaceManager::getCheckpoint(unsigned int index) const
+    {
+        if (index < this->checkpoints_.size())
+            return this->checkpoints_[index];
+        else
+            return 0;
+    }
+    
+    int SpaceRaceManager::getIndex(RaceCheckPoint* r) 
+    {
+        for (size_t i = 0; i < this->checkpoints_.size(); ++i)
+            if (this->checkpoints_[i]==r) {return i;}
+           
+        return -1;
+    }
+    
+    void SpaceRaceManager::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(SpaceRaceManager, XMLPort, xmlelement, mode);
+
+        
+        XMLPortObject(SpaceRaceManager, RaceCheckPoint, "checkpoints", addCheckpoint, getCheckpoint,  xmlelement, mode);
+    }
+    
+    void SpaceRaceManager::tick(float dt)
+    {
+        SUPER(SpaceRaceManager,tick,dt);
+     
+        if(this->checkpoints_[0] != NULL && !this->firstcheckpointvisible_)
+        {
+            this->checkpoints_[0]->setRadarVisibility(true);
+            this->firstcheckpointvisible_=true;
+        }
+         
+        for (size_t i = 0; i < this->checkpoints_.size(); ++i)
+        {
+            if(this->checkpoints_[i]->reached_!=NULL)
+                this->checkpointReached(this->checkpoints_[i],this->checkpoints_[i]->reached_);
+        }
+    }
+    
+    
+    void SpaceRaceManager::checkpointReached(RaceCheckPoint* check, PlayerInfo* player)
+    {
+        SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
+        assert(gametype);
+        
+        bool b =false;    
+            
+        int index=gametype->getCheckpointReached(player);
+        Vector3 v=Vector3 (-1,-1,-1);
+        if (index>-1)
+        {
+            RaceCheckPoint* tmp= this->getCheckpoint(index);
+            v= tmp->getNextcheckpoint();
+       
+            if (this->getCheckpoint(v.x) == check)
+            {
+                b = true;
+            }    
+       
+            if (this->getCheckpoint(v.y) == check)
+            {
+                b = true;
+            }    
+            if (this->getCheckpoint(v.z) == check)
+            {
+                b = true;
+            }    
+        }
+        else
+        {
+            b = (this->getIndex(check) == 0);
+        }
+            
+        if (gametype && b)
+        {
+            gametype->clock_.capture();
+            float time = gametype->clock_.getSecondsPrecise();
+            if (check->getTimeLimit()!=0 && time > check->getTimeLimit())
+            {
+                gametype->timeIsUp();
+                gametype->end();
+            }
+            else if (check->getLast())
+                gametype->end();
+            else
+				{
+                if (index > -1)this->setRadVis(player,false);
+                	else this->getCheckpoint(0)->setRadarVisibility(false);
+                gametype->newCheckpointReached(check,player);
+               
+                
+                this->setRadVis(player, true);
+            }
+        }
+        check->reached_=NULL;
+    }
+    
+    void SpaceRaceManager::setRadVis(PlayerInfo* player, bool b)
+    {
+        SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
+        assert(gametype);
+        int index = gametype->getCheckpointReached(player);
+        Vector3 v = Vector3(-1,-1,-1);
+        RaceCheckPoint* tmp = this->getCheckpoint(index);
+        v = tmp->getNextcheckpoint();
+    
+        if(v.x > -1)
+        {
+            this->getCheckpoint(v.x)->setRadarVisibility(b);
+            this->getCheckpoint(v.x)->settingsChanged();
+        }
+        if(v.y > -1)
+        {
+            this->getCheckpoint(v.y)->setRadarVisibility(b);
+            this->getCheckpoint(v.y)->settingsChanged();
+        }
+        if(v.z > -1)
+        {
+            this->getCheckpoint(v.z)->setRadarVisibility(b);
+           this->getCheckpoint(v.z)->settingsChanged();
+        }
+        
+        
+    }
+    
+}

Copied: code/trunk/src/modules/gametypes/SpaceRaceManager.h (from rev 9015, code/branches/presentation2011/src/modules/gametypes/SpaceRaceManager.h)
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRaceManager.h	                        (rev 0)
+++ code/trunk/src/modules/gametypes/SpaceRaceManager.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -0,0 +1,79 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Mauro Salomon
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _SpaceRaceManager_H__
+#define _SpaceRaceManager_H__
+
+#include "gametypes/GametypesPrereqs.h"
+
+#include <set>
+#include <string>
+#include <vector>
+
+#include <util/Clock.h>
+
+#include "gametypes/Gametype.h"
+#include "tools/interfaces/Tickable.h"
+#include "RaceCheckPoint.h"
+
+
+
+namespace orxonox
+{
+  /**
+  @brief
+    The SpaceRaceManager class controls a space race level, where the player has to reach check points in a given order.
+  */
+    class _GametypesExport SpaceRaceManager : public BaseObject, public Tickable
+    {
+        friend class RaceCheckPoint;
+    
+        public:
+            SpaceRaceManager(BaseObject* creator);
+            virtual ~SpaceRaceManager() ;
+
+            void XMLPort(Element& xmlelement, XMLPort::Mode mode); 
+            int getIndex(RaceCheckPoint* r);
+            void addCheckpoint(RaceCheckPoint* checkpoint);
+            RaceCheckPoint* getCheckpoint(unsigned int index) const;
+        
+            void checkpointReached(RaceCheckPoint* check, PlayerInfo* player);
+        
+            void tick(float dt);
+    
+        protected:
+            void setRadVis(PlayerInfo* player, bool b);//sets RadarVisibility of the checkpoints the player can reach.
+    
+        private:
+            std::vector<RaceCheckPoint*> checkpoints_;
+            bool firstcheckpointvisible_;//true if the first check point is visible.
+        
+    };
+}
+
+#endif /* _SpaceRaceManager_H__ */

Modified: code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h
===================================================================
--- code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -90,7 +90,7 @@
 
     @ingroup MultiTrigger
     */
-    class _ObjectsExport DistanceMultiTrigger : public MultiTrigger
+    class _ObjectsExport DistanceMultiTrigger : public MultiTrigger 
     {
 
         public:

Modified: code/trunk/src/modules/objects/triggers/MultiTrigger.h
===================================================================
--- code/trunk/src/modules/objects/triggers/MultiTrigger.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/modules/objects/triggers/MultiTrigger.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -156,7 +156,7 @@
             bool isModeTriggered(BaseObject* triggerer = NULL); //!< Checks whether the MultiTrigger is triggered concerning it's children.
             bool isTriggered(BaseObject* triggerer = NULL); //!< Get whether the MultiTrigger is triggered for a given object.
 
-            void fire(bool status, BaseObject* originator = NULL);  //!< Helper method. Creates an Event for the given status and originator and fires it.
+            virtual void fire(bool status, BaseObject* originator = NULL);  //!< Helper method. Creates an Event for the given status and originator and fires it.
             void broadcast(bool status); //!< Helper method. Broadcasts an Event for every object that is a target.
 
             void removeTarget(const std::string& target); //!< Remove some target from the MultiTrigger.

Modified: code/trunk/src/modules/overlays/hud/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/overlays/hud/CMakeLists.txt	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/modules/overlays/hud/CMakeLists.txt	2012-02-15 22:51:58 UTC (rev 9016)
@@ -6,6 +6,7 @@
   HUDBoostBar.cc
   HUDHealthBar.cc
   HUDTimer.cc
+  HUDEnemyHealthBar.cc
   ChatOverlay.cc
   AnnounceMessage.cc
   KillMessage.cc

Copied: code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.cc (from rev 9015, code/branches/presentation2011/src/modules/overlays/hud/HUDEnemyHealthBar.cc)
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.cc	                        (rev 0)
+++ code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -0,0 +1,210 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Matthias Spalinger
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "HUDEnemyHealthBar.h"
+
+#include <OgreCamera.h>
+
+#include "util/Convert.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "infos/PlayerInfo.h"
+#include "overlays/OverlayGroup.h"
+#include "CameraManager.h"
+#include "graphics/Camera.h"
+#include "util/Math.h"
+#include "HUDNavigation.h"
+#include "core/input/InputManager.h"
+#include "controllers/HumanController.h"
+#include "core/GraphicsManager.h"
+#include "Scene.h"
+#include "Radar.h"
+#include "controllers/NewHumanController.h"
+
+namespace orxonox
+{
+    CreateFactory(HUDEnemyHealthBar);
+
+    HUDEnemyHealthBar::HUDEnemyHealthBar(BaseObject* creator) : HUDHealthBar(creator)
+    {
+        RegisterObject(HUDEnemyHealthBar);
+
+        this->setConfigValues();
+        setSensibility(0.1f);
+        this->owner_ = 0;
+        markerLimit_ = 3; //TODO connect with markerLimit_ from the settings / from HUDNavigation.cc
+        currentYaw = 0;
+        currentPitch = 0;
+
+        this->getOverlayText()->setCaption("");
+    }
+
+    HUDEnemyHealthBar::~HUDEnemyHealthBar()
+    {
+        sortedObjectList_.clear();
+    }
+
+    void HUDEnemyHealthBar::setConfigValues()
+    {
+        SetConfigValue(useEnemyBar_, true);
+    }
+
+    void HUDEnemyHealthBar::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(HUDEnemyHealthBar, XMLPort, xmlelement, mode);
+
+        XMLPortParam ( HUDEnemyHealthBar, "sensibility", setSensibility, getSensibility, xmlelement, mode );
+    }
+
+    bool compareDist ( std::pair<RadarViewable*, unsigned int > a, std::pair<RadarViewable*, unsigned int > b )
+    {
+        return a.second<b.second;
+    }
+
+    void HUDEnemyHealthBar::tick(float dt)
+    {
+        if (!useEnemyBar_){
+            this->setValue(0); //TODO hide it instead of setting it to 0
+            this->getOverlayText()->setCaption("");
+            return;
+        }
+
+        Camera* cam = CameraManager::getInstance().getActiveCamera();
+        if ( cam == NULL )
+            return;
+        const Matrix4& camTransform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix();
+
+        unsigned int markerCount_ = 0;
+
+        for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++listIt )
+        {
+            listIt->second = ( int ) ( ( listIt->first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition() ).length() + 0.5f );
+        }
+    
+        sortedObjectList_.sort ( compareDist );
+
+        for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++markerCount_, ++listIt )
+        {
+            if ( markerCount_ < markerLimit_ )
+            {        
+                // Transform to screen coordinates and reverse x-axis
+                Vector3 pos = (camTransform * listIt->first->getRVWorldPosition());
+                pos.x = -pos.x;                
+
+                // get mouse position
+                if(this->getOwner() && dynamic_cast<ControllableEntity*>(this->getOwner())->getController() && dynamic_cast<NewHumanController*>(dynamic_cast<ControllableEntity*>(this->getOwner())->getController()))
+                {
+                    currentYaw = dynamic_cast<NewHumanController*>(dynamic_cast<ControllableEntity*>(this->getOwner())->getController())->getCurrentYaw();
+                    currentPitch = dynamic_cast<NewHumanController*>(dynamic_cast<ControllableEntity*>(this->getOwner())->getController())->getCurrentPitch();
+                }
+                // Compare cursor position to object position
+                if ( fabs(pos.x - currentYaw) < sens_ && fabs(pos.y - currentPitch) < sens_ )
+                {
+                    this->owner_ = orxonox_cast<Pawn*>(listIt->first);
+                    break;
+                }
+            }
+            this->owner_ = 0;
+        }
+
+
+
+        if (this->owner_)
+        {
+            this->setValue(this->owner_->getHealth() / this->owner_->getInitialHealth());
+            this->getOverlayText()->setCaption(multi_cast<std::string>(static_cast<int>(this->owner_->getHealth())));
+        }
+        else
+        {
+            this->setValue(0);      //TODO hide it instead of setting it to zero
+            this->getOverlayText()->setCaption("");
+        }
+
+        if (this->getTextUseBarColour())
+            this->getOverlayText()->setColour(this->getCurrentBarColour());
+    }
+
+    void HUDEnemyHealthBar::addObject ( RadarViewable* object )
+    {
+        if( showObject(object)==false )
+            return;
+    
+        if ( sortedObjectList_.size() >= markerLimit_ )
+            if ( object == NULL )
+                return;
+    
+        sortedObjectList_.push_front ( std::make_pair ( object, ( unsigned int ) 0 ) );
+
+        //remove duplicates
+        sortedObjectList_.unique();
+    }
+
+    bool HUDEnemyHealthBar::showObject(RadarViewable* rv)
+    {
+        if ( rv == dynamic_cast<RadarViewable*> ( this->getOwner() ) )
+            return false;
+        assert( rv->getWorldEntity() );
+        if ( rv->getWorldEntity()->isVisible()==false || rv->getRadarVisibility()==false )
+            return false;
+        return true;
+    }
+
+    void HUDEnemyHealthBar::removeObject ( RadarViewable* viewable )
+    {
+        for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++listIt )
+        {
+            if ( (listIt->first) == viewable )
+            {
+                sortedObjectList_.erase ( listIt );
+                break;
+            }
+    
+        }
+
+    }
+
+    void HUDEnemyHealthBar::objectChanged(RadarViewable* viewable)
+    {
+        // TODO: niceification neccessary - and while you're at it: the same function exists in HUDNavigation.cc ;)
+        removeObject(viewable);
+        addObject(viewable);
+    }
+
+    void HUDEnemyHealthBar::changedOwner()
+    {
+    
+        const std::set<RadarViewable*>& respawnObjects = this->getOwner()->getScene()->getRadar()->getRadarObjects();
+        for ( std::set<RadarViewable*>::const_iterator it = respawnObjects.begin(); it != respawnObjects.end(); ++it )
+        {
+            if ( ! ( *it )->isHumanShip_ )
+                this->addObject ( *it );
+        }
+    }
+
+}

Copied: code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.h (from rev 9015, code/branches/presentation2011/src/modules/overlays/hud/HUDEnemyHealthBar.h)
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.h	                        (rev 0)
+++ code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -0,0 +1,83 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Matthias Spalinger
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _HUDEnemyHealthBar_H__
+#define _HUDEnemyHealthBar_H__
+
+#include "interfaces/RadarViewable.h"
+#include "worldentities/pawns/Pawn.h"
+
+#include "HUDHealthBar.h"
+#include "interfaces/RadarListener.h"
+
+namespace orxonox
+{
+    class _OverlaysExport HUDEnemyHealthBar : public HUDHealthBar, public RadarListener
+    {
+        public:
+            HUDEnemyHealthBar(BaseObject* creator);
+            virtual ~HUDEnemyHealthBar();
+            void setConfigValues();
+
+            bool compareDistance ( std::pair<RadarViewable*, unsigned int > a, std::pair<RadarViewable*, unsigned int > b );
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void tick(float dt);
+
+            //RadarListener interface
+            void addObject ( RadarViewable* object );
+            void removeObject ( RadarViewable* viewable );
+            void objectChanged(RadarViewable* viewable);
+            virtual void radarTick ( float dt ) {}
+            inline float getRadarSensitivity() const
+                { return 1.0f; }
+
+            void changedOwner();
+
+        private:
+
+            void setSensibility (float sense){
+                this->sens_ = sense;}
+            float getSensibility(){
+                return this->sens_;}
+
+            bool showObject(RadarViewable* rv);
+        
+            typedef std::list < std::pair<RadarViewable*, unsigned int > > sortedList;
+            sortedList sortedObjectList_;
+
+            Pawn* owner_;
+            float sens_;
+            bool useEnemyBar_;
+            unsigned int markerLimit_;
+
+            float currentYaw;
+            float currentPitch;
+    };
+}
+#endif /* _HUDEnemyHealthBar_H__ */

Modified: code/trunk/src/modules/overlays/hud/HUDHealthBar.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDHealthBar.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/modules/overlays/hud/HUDHealthBar.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -109,6 +109,11 @@
             inline float getTextSpaceWidth() const
                 { return this->textoverlay_->getSpaceWidth(); }
 
+            inline void setOverlayText(SmartPtr<OverlayText> textoverlay)
+                { this->textoverlay_ = textoverlay; }
+            inline SmartPtr<OverlayText> getOverlayText() const
+                {return this->textoverlay_; }
+
         private:
             WeakPtr<Pawn> owner_;
             SmartPtr<OverlayText> textoverlay_;

Modified: code/trunk/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDNavigation.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/modules/overlays/hud/HUDNavigation.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -24,6 +24,7 @@
  *   Co-authors:
  *      Reto Grieder
  *      Oliver Scheuss
+ *      Matthias Spalinger
  *
  */
 
@@ -62,7 +63,7 @@
 void HUDNavigation::setConfigValues()
 {
   SetConfigValue(markerLimit_, 3);
-
+  SetConfigValue(showDistance, false);
 }
 
 CreateFactory ( HUDNavigation );
@@ -74,10 +75,10 @@
     this->setConfigValues();
 
     // Set default values
-    setFont ( "Monofur" );
-    setTextSize ( 0.05f );
-    setNavMarkerSize ( 0.05f );
-    setDetectionLimit( 10000.0f );
+    this->setFont ( "Monofur" );
+    this->setTextSize ( 0.05f );
+    this->setNavMarkerSize ( 0.05f );
+    this->setDetectionLimit( 10000.0f ); 
 }
 
 HUDNavigation::~HUDNavigation()
@@ -96,10 +97,10 @@
 {
     SUPER ( HUDNavigation, XMLPort, xmlelement, mode );
 
-    XMLPortParam ( HUDNavigation, "font",           setFont,           getFont,           xmlelement, mode );
-    XMLPortParam ( HUDNavigation, "textSize",       setTextSize,       getTextSize,       xmlelement, mode );
-    XMLPortParam ( HUDNavigation, "navMarkerSize",  setNavMarkerSize,  getNavMarkerSize,  xmlelement, mode );
-    XMLPortParam ( HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode );
+    XMLPortParam ( HUDNavigation, "font",          setFont,          getFont,          xmlelement, mode );
+    XMLPortParam ( HUDNavigation, "textSize",      setTextSize,      getTextSize,      xmlelement, mode );
+    XMLPortParam ( HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlelement, mode );
+    XMLPortParam ( HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode ); 
 }
 
 void HUDNavigation::setFont ( const std::string& font )
@@ -143,7 +144,19 @@
     return textSize_;
 }
 
+float HUDNavigation::getArrowSizeX(int dist)
+{    
+    if (dist < 600) 
+        dist = 600;
+    return this->getActualSize().x * 900 * navMarkerSize_ / dist;
+}
 
+float HUDNavigation::getArrowSizeY(int dist)
+{    
+    if (dist < 600)
+        dist = 600;   
+    return this->getActualSize().y * 900 * navMarkerSize_ / dist;
+}
 
 void HUDNavigation::tick ( float dt )
 {
@@ -164,20 +177,33 @@
 
     unsigned int markerCount_ = 0;
     bool closeEnough_ = false; //only display objects that are close enough to be relevant for the player
+
 //         for (ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); ++it)
     for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++markerCount_, ++listIt )
     {
         ObjectMap::iterator it = activeObjectList_.find ( listIt->first );
         closeEnough_ = listIt->second < detectionLimit_ ;
-        if ( markerCount_ < markerLimit_ && (closeEnough_ ||  detectionLimit_ < 0) ) // display on HUD if the statement is true
+        // display radarviewables on HUD if the marker limit and max-distance is not exceeded 
+        if ( markerCount_ < markerLimit_ && (closeEnough_ ||  detectionLimit_ < 0) ) 
         {
 
 
             // Get Distance to HumanController and save it in the TextAreaOverlayElement.
             int dist = listIt->second;
+            float textLength = 0.0f;
+
+            //display distance next to cursor
+            if (showDistance){
             it->second.text_->setCaption ( multi_cast<std::string> ( dist ) );
-            float textLength = multi_cast<std::string> ( dist ).size() * it->second.text_->getCharHeight() * 0.3f;
+            textLength = multi_cast<std::string> ( dist ).size() * it->second.text_->getCharHeight() * 0.3f;
+            }
 
+            //display name next to cursor
+            else{
+            it->second.text_->setCaption(it->first->getRVName()); 
+            textLength = it->first->getRVName().size() * it->second.text_->getCharHeight() * 0.3f;
+            }
+
             // Transform to screen coordinates
             Vector3 pos = camTransform * it->first->getRVWorldPosition();
 
@@ -193,8 +219,6 @@
             }
             else
                 outOfView = pos.x < -1.0 || pos.x > 1.0 || pos.y < -1.0 || pos.y > 1.0;
-            // Get Distance to HumanController and save it in the TextAreaOverlayElement.
-            it->second.text_->setCaption ( multi_cast<std::string> ( dist ) );
 
             if ( outOfView )
             {
@@ -207,6 +231,12 @@
                     it->second.wasOutOfView_ = true;
                 }
 
+                //float xDistScale = this->getActualSize().x * 1000.0f * navMarkerSize_ / dist;
+                //float yDistScale = this->getActualSize().y * 1000.0f * navMarkerSize_ / dist;
+
+                // Adjust Arrowsize according to distance
+                it->second.panel_->setDimensions(getArrowSizeX(dist),getArrowSizeY(dist));
+
                 // Switch between top, bottom, left and right position of the arrow at the screen border
                 if ( pos.x < pos.y )
                 {
@@ -262,6 +292,7 @@
                 {
                   //it->second.panel_->setMaterialName ( "Orxonox/NavTDC" );
                     it->second.panel_->setMaterialName( TextureGenerator::getMaterialName( "tdc.png", it->first->getRadarObjectColour()) );
+                    it->second.panel_->setDimensions ( navMarkerSize_ * this->getActualSize().x, navMarkerSize_ * this->getActualSize().y );
                     it->second.wasOutOfView_ = false;
                 }
 
@@ -279,7 +310,7 @@
             it->second.panel_->show();
             it->second.text_->show();
         }
-        else // do not display on HUD
+        else // do not display on HUD 
         {
             it->second.panel_->hide();
             it->second.text_->hide();
@@ -311,7 +342,7 @@
 
 void HUDNavigation::addObject ( RadarViewable* object )
 {
-    if( showObject(object) == false )
+    if( showObject(object)==false )
         return;
 
     if ( activeObjectList_.size() >= markerLimit_ )
@@ -398,7 +429,7 @@
     if ( rv == dynamic_cast<RadarViewable*> ( this->getOwner() ) )
         return false;
     assert( rv->getWorldEntity() );
-    if ( rv->getWorldEntity()->isVisible() == false || rv->getRadarVisibility() == false )
+    if ( rv->getWorldEntity()->isVisible()==false || rv->getRadarVisibility()==false )
         return false;
     return true;
 }

Modified: code/trunk/src/modules/overlays/hud/HUDNavigation.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDNavigation.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/modules/overlays/hud/HUDNavigation.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -23,6 +23,7 @@
  *      Felix Schulthess
  *   Co-authors:
  *      Reto Grieder
+ *      Matthias Spalinger
  *
  */
 
@@ -53,6 +54,7 @@
     virtual void XMLPort ( Element& xmlelement, XMLPort::Mode mode );
     virtual void tick ( float dt );
 
+    // RadarListener interface
     virtual void addObject ( RadarViewable* object );
     virtual void removeObject ( RadarViewable* viewable );
     virtual void objectChanged ( RadarViewable* viewable );
@@ -66,6 +68,8 @@
     inline float getRadarSensitivity() const
     { return 1.0f; }
 
+    unsigned int getMarkerLimit() { return this->markerLimit_; }
+
 private:
     struct ObjectInfo
     {
@@ -80,15 +84,14 @@
 
     // XMLPort accessors
     void setNavMarkerSize ( float size )
-    { navMarkerSize_ = size; this->sizeChanged(); }
+        { navMarkerSize_ = size; this->sizeChanged(); }
     float getNavMarkerSize() const
-    { return navMarkerSize_; }
+        { return navMarkerSize_; }
+    void setDetectionLimit( float limit ) 
+        { this->detectionLimit_ = limit; } 
+    float getDetectionLimit() const 
+        { return this->detectionLimit_; }
 
-    void setDetectionLimit( float limit )
-    { this->detectionLimit_ = limit; }
-    float getDetectionLimit() const
-    { return this->detectionLimit_; }
-
     void setTextSize ( float size );
     float getTextSize() const;
 
@@ -101,14 +104,17 @@
     typedef std::list < std::pair<RadarViewable*, unsigned int > > sortedList;
     sortedList sortedObjectList_;
 
+    float getArrowSizeX(int dist);    
+    float getArrowSizeY(int dist);
 
     float navMarkerSize_;
     std::string fontName_;
     float textSize_;
+    bool showDistance;
 
-    unsigned int markerLimit_; //TODO: is it possible to set this over the console and/or the IG-Setting
-    float detectionLimit_; //!< Objects that are more far away than detectionLimit_ are not displayed on the HUD. 10000.0f is the default value.
-                           //!< In order to bypass this behaviour, set a negative detectionLimit_. Then the detection range is "infinite".
+    unsigned int markerLimit_;
+    float detectionLimit_; //!< Objects that are more far away than detectionLimit_ are not displayed on the HUD. 10000.0f is the default value. 
+
 };
 }
 

Modified: code/trunk/src/modules/pong/Pong.cc
===================================================================
--- code/trunk/src/modules/pong/Pong.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/modules/pong/Pong.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -36,15 +36,16 @@
 #include "core/CoreIncludes.h"
 #include "core/EventIncludes.h"
 #include "core/command/Executor.h"
+#include "core/ConfigValueIncludes.h"
 
 #include "gamestates/GSLevel.h"
+#include "chat/ChatManager.h"
 
 #include "PongCenterpoint.h"
 #include "PongBall.h"
 #include "PongBat.h"
 #include "PongBot.h"
 #include "PongAI.h"
-
 namespace orxonox
 {
     // Events to allow to react to scoring of a player, in the level-file.
@@ -74,6 +75,8 @@
 
         // Set the type of Bots for this particular Gametype.
         this->botclass_ = Class(PongBot);
+	this->scoreLimit_ = 10;
+	this->setConfigValues();
     }
 
     /**
@@ -279,8 +282,28 @@
             this->bat_[1]->setPosition( this->center_->getFieldDimension().x / 2, 0, 0);
         }
 
+        // If a palyer gets 21 points, he won the game -> end of game
+        
+        PlayerInfo* player1 = this->getLeftPlayer();
+        PlayerInfo* player2 = this->getRightPlayer();
+        if(player1==NULL||player2==NULL) return; //safety
+        if(this->getScore(player1) >= scoreLimit_)
+        {
+            std::string name1=player1->getName();
+            std::string message(name1 + " has won!");
+            ChatManager::message(message);
+            this->end();
+        }
+        else if(this->getScore(player2) >= scoreLimit_)
+        {
+             std::string name2=player2->getName();
+             std::string message2(name2 + " has won!");
+             ChatManager::message(message2);
+             this->end();
+        }
         // Restart the timer to start the ball.
         this->starttimer_.startTimer();
+
     }
 
     /**
@@ -320,4 +343,13 @@
         else
             return 0;
     }
+
+    /**
+     @brief
+         Make scoreLimit_ configurable e.g. in the menu.
+     */
+    void Pong::setConfigValues()
+    {
+        SetConfigValue(scoreLimit_, 10).description("The player first reaching those points wins.");
+    }
 }

Modified: code/trunk/src/modules/pong/Pong.h
===================================================================
--- code/trunk/src/modules/pong/Pong.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/modules/pong/Pong.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -80,8 +80,9 @@
             */
             void setCenterpoint(PongCenterpoint* center)
                 { this->center_ = center; }
-
-            PlayerInfo* getLeftPlayer() const; //!< Get the left player.
+            void setConfigValues(); //!< Makes scoreLimit configurable.
+            
+	    PlayerInfo* getLeftPlayer() const; //!< Get the left player.
             PlayerInfo* getRightPlayer() const; //!< Get the right player.
 
         protected:
@@ -93,7 +94,8 @@
             WeakPtr<PongCenterpoint> center_; //!< The playing field.
             WeakPtr<PongBall> ball_; //!< The Pong ball.
             WeakPtr<PongBat> bat_[2]; //!< The two bats.
-            Timer starttimer_; //!< A timer to delay the start of the game.
+	    Timer starttimer_; //!< A timer to delay the start of the game.
+            int scoreLimit_; //!< If a player scored that much points, the game is ended.
     };
 }
 

Modified: code/trunk/src/modules/pong/PongAI.h
===================================================================
--- code/trunk/src/modules/pong/PongAI.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/modules/pong/PongAI.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -79,7 +79,7 @@
             void move(char direction, bool bUseDelay); //!< Determine the movement the AI will undertake.
             void delayedMove(); //!< Is called, when a delayed move takes effect.
 
-            PongBall* ball_; //!< A pointer to the ball.
+            WeakPtr<PongBall> ball_; //!< A weak pointer to the ball.
             Vector2 ballDirection_; //!< Vector to store the (x,z) direction in which the ball is flying.
             float ballEndPosition_; //!< The calculated end position of the ball.
             float randomOffset_; //!< A random offset to introduce random errors (weighted by the strength of the AI) into the AI's behavior.

Modified: code/trunk/src/modules/pong/PongScore.cc
===================================================================
--- code/trunk/src/modules/pong/PongScore.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/modules/pong/PongScore.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -59,6 +59,8 @@
         this->bShowScore_ = false;
         this->bShowLeftPlayer_ = false;
         this->bShowRightPlayer_ = false;
+        this->player1_ = NULL;
+	this->player2_ = NULL;
     }
 
     /**
@@ -97,44 +99,51 @@
         // If the owner is set. The owner being a Pong game.
         if (this->owner_ != NULL)
         {
-            // Get the two players.
-            PlayerInfo* player1 = this->owner_->getLeftPlayer();
-            PlayerInfo* player2 = this->owner_->getRightPlayer();
-
-            std::string name1;
-            std::string name2;
-
-            std::string score1("0");
-            std::string score2("0");
-
-            // Save the name and score of each player as a string.
-            if (player1 != NULL)
+	    if(!this->owner_->hasEnded())
             {
-                name1 = player1->getName();
-                score1 = multi_cast<std::string>(this->owner_->getScore(player1));
+                //get the two players
+                player1_ = this->owner_->getLeftPlayer();
+                player2_ = this->owner_->getRightPlayer();
             }
-            if (player2 != NULL)
-            {
-                name2 = player2->getName();
-                score2 = multi_cast<std::string>(this->owner_->getScore(player2));
-            }
 
-            // Assemble the strings, depending on what should all be displayed.
-            std::string output1;
-            if (this->bShowLeftPlayer_)
+            if(this->owner_->hasStarted())
             {
-                if (this->bShowName_ && this->bShowScore_ && player1 != NULL)
-                    output1 = name1 + " - " + score1;
-                else if (this->bShowScore_)
-                    output1 = score1;
-                else if (this->bShowName_)
-                    output1 = name1;
-            }
+                // Get the two players.
 
-            std::string output2;
-            if (this->bShowRightPlayer_)
-            {
-                if (this->bShowName_ && this->bShowScore_ && player2 != NULL)
+                std::string name1;
+                std::string name2;
+
+                std::string score1("0");
+                std::string score2("0");
+
+                // Save the name and score of each player as a string.
+                if (player1_ != NULL)
+                {
+                    name1 = player1_->getName();
+                    score1 = multi_cast<std::string>(this->owner_->getScore(player1_));
+                }
+                if (player2_ != NULL)
+                {
+                    name2 = player2_->getName();
+                    score2 = multi_cast<std::string>(this->owner_->getScore(player2_));
+                }
+
+                // Assemble the strings, depending on what should all be displayed.
+                std::string output1;
+                if (this->bShowLeftPlayer_)
+                {
+                    if (this->bShowName_ && this->bShowScore_ && player1_ != NULL)
+                         output1 = name1 + " - " + score1;
+                    else if (this->bShowScore_)
+                         output1 = score1;
+                    else if (this->bShowName_)
+                         output1 = name1;
+                }
+
+                std::string output2;
+                if (this->bShowRightPlayer_)
+                {
+                if (this->bShowName_ && this->bShowScore_ && player2_ != NULL)
                     output2 = score2 + " - " + name2;
                 else if (this->bShowScore_)
                     output2 = score2;
@@ -142,16 +151,16 @@
                     output2 = name2;
             }
 
-            std::string output("PONG");
-            if (this->bShowName_ || this->bShowScore_)
-            {
-                if (this->bShowLeftPlayer_ && this->bShowRightPlayer_)
-                    output = output1 + ':' + output2;
-                else if (this->bShowLeftPlayer_ || this->bShowRightPlayer_)
-                    output = output1 + output2;
+                std::string output("PONG");
+                if (this->bShowName_ || this->bShowScore_)
+                {
+                    if (this->bShowLeftPlayer_ && this->bShowRightPlayer_)
+                        output = output1 + ':' + output2;
+                    else if (this->bShowLeftPlayer_ || this->bShowRightPlayer_)
+                        output = output1 + output2;
+                }
+                this->setCaption(output);
             }
-
-            this->setCaption(output);
         }
     }
 

Modified: code/trunk/src/modules/pong/PongScore.h
===================================================================
--- code/trunk/src/modules/pong/PongScore.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/modules/pong/PongScore.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -121,6 +121,8 @@
             bool bShowScore_; //!< Whether the score of the players is shown.
             bool bShowLeftPlayer_; //!< Whether the left player is shown.
             bool bShowRightPlayer_; //!< Whether the right player is shown.
+            PlayerInfo* player1_; //!< Store information about left player permanently.
+            PlayerInfo* player2_; //!< Same for the right player. To end the game properly.
     };
 }
 #endif /* _PongScore_H__ */

Modified: code/trunk/src/modules/weapons/projectiles/Rocket.cc
===================================================================
--- code/trunk/src/modules/weapons/projectiles/Rocket.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/modules/weapons/projectiles/Rocket.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -65,7 +65,6 @@
 
         this->localAngularVelocity_ = 0;
         this->lifetime_ = 100.0f;
-        this->bIsRocket_= true;
 
         if (GameMode::isMaster())
         {
@@ -134,7 +133,6 @@
     {
         if(this->isInitialized())
         {
-            this->bIsRocket_= false;
             if (GameMode::isMaster())
             {
                 this->destructionEffect();
@@ -162,7 +160,8 @@
         this->BasicProjectile::setShooter(shooter);
         
         this->player_ = this->getShooter()->getPlayer();
-        this->getShooter()->getPlayer()->startTemporaryControl(this);
+        if(this->player_)
+            this->player_->startTemporaryControl(this);
 
         if( GameMode::isMaster() )
         {

Modified: code/trunk/src/modules/weapons/projectiles/Rocket.h
===================================================================
--- code/trunk/src/modules/weapons/projectiles/Rocket.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/modules/weapons/projectiles/Rocket.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -121,6 +121,7 @@
             Vector3 localAngularVelocity_; //!< Variable to temporarily store accumulated steering command input.
 
             WeakPtr<PlayerInfo> player_; //!< The player that controls the Rocket.
+            //WeakPtr<Pawn> pawn_; //!< The pawn that controls the Rocket. TODO
             Timer destroyTimer_; //!< Timer to destroy the projectile after its lifetime has run out.
             float lifetime_; //!< The time the projectile exists.
 

Modified: code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -51,7 +51,7 @@
 
         this->reloadTime_ = 1.0f;
         this->damage_ = 0.0f;
-        this->speed_ = 250.0f;
+        this->speed_ = 700.0f;
 
         this->setMunitionName("LaserMunition");
         this->setDefaultSound("sounds/Weapon_LightningGun.ogg");

Modified: code/trunk/src/orxonox/Level.cc
===================================================================
--- code/trunk/src/orxonox/Level.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/Level.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -70,7 +70,6 @@
     {
         SUPER(Level, XMLPort, xmlelement, mode);
 
-        XMLPortParam(Level, "description", setDescription, getDescription, xmlelement, mode);
         XMLPortParam(Level, "gametype", setGametypeString, getGametypeString, xmlelement, mode).defaultValues("Gametype");
 
         XMLPortObject(Level, MeshLodInformation, "lodinformation", addLodInfo, getLodInfo, xmlelement, mode);
@@ -81,7 +80,6 @@
     {
         registerVariable(this->xmlfilename_,            VariableDirection::ToClient, new NetworkCallback<Level>(this, &Level::networkcallback_applyXMLFile));
         registerVariable(this->name_,                   VariableDirection::ToClient, new NetworkCallback<Level>(this, &Level::changedName));
-        registerVariable(this->description_,            VariableDirection::ToClient);
         registerVariable(this->networkTemplateNames_,   VariableDirection::ToClient, new NetworkCallback<Level>(this, &Level::networkCallbackTemplatesChanged));
     }
 

Modified: code/trunk/src/orxonox/Level.h
===================================================================
--- code/trunk/src/orxonox/Level.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/Level.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -48,11 +48,6 @@
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
-            inline void setDescription(const std::string& description)
-                { this->description_ = description; }
-            inline const std::string& getDescription() const
-                { return this->description_; }
-
             void playerEntered(PlayerInfo* player);
             void playerLeft(PlayerInfo* player);
 
@@ -75,7 +70,6 @@
 
             void networkcallback_applyXMLFile();
 
-            std::string                    description_;
             std::string                    gametype_;
             std::string                    xmlfilename_;
             XMLFile*                       xmlfile_;

Modified: code/trunk/src/orxonox/LevelInfo.cc
===================================================================
--- code/trunk/src/orxonox/LevelInfo.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/LevelInfo.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -86,11 +86,12 @@
         if(!LevelInfoItem::initialized_s)
         {
             LevelInfoItem::possibleTags_s.insert("test");
-            LevelInfoItem::possibleTags_s.insert("singleplayer");
-            LevelInfoItem::possibleTags_s.insert("multiplayer");
             LevelInfoItem::possibleTags_s.insert("showcase");
             LevelInfoItem::possibleTags_s.insert("tutorial");
             LevelInfoItem::possibleTags_s.insert("presentation");
+            LevelInfoItem::possibleTags_s.insert("mission");
+            LevelInfoItem::possibleTags_s.insert("gametype");
+            LevelInfoItem::possibleTags_s.insert("minigame");
         }
     }
 
@@ -188,6 +189,7 @@
         SUPER(LevelInfo, XMLPort, xmlelement, mode);
 
         XMLPortParam(LevelInfo, "description", setDescription, getDescription, xmlelement, mode);
+        XMLPortParam(LevelInfo, "screenshot", setScreenshot, getScreenshot, xmlelement, mode);
         XMLPortParam(LevelInfo, "tags", setTags, getTags, xmlelement, mode);
     }
 
@@ -202,6 +204,7 @@
     {
         LevelInfoItem* info = new LevelInfoItem(this->BaseObject::getName(), this->getXMLFilename());
         info->setDescription(this->getDescription());
+        info->setScreenshot(this->getScreenshot());
         info->setTags(this->getTags());
         return info;
     }

Modified: code/trunk/src/orxonox/LevelInfo.h
===================================================================
--- code/trunk/src/orxonox/LevelInfo.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/LevelInfo.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -76,6 +76,17 @@
             @return Returns the name of the Level.
             */
             inline const std::string& getName(void) const { return this->name_; } // tolua_export
+        
+            /**
+            @brief Set the screenshot of the Level.
+            @param screenshot The screenshot to be set.
+            */
+            inline void setScreenshot(const std::string& screenshot) { this->screenshot_ = std::string(screenshot); }
+            /**
+            @brief Get the screenshot of the Level.
+            @return Returns the screenshot of the Level.
+            */
+            inline const std::string& getScreenshot() const { return this->screenshot_; } // tolua_export
 
             /**
             @brief Set the description of the Level.
@@ -137,6 +148,7 @@
 
             std::string name_; //!< The name of the Level.
             std::string description_; //!< The description of the Level.
+            std::string screenshot_; //!< The screenshot of the Level.
             std::set<std::string> tags_; //!< The set of tags the Level is tagged with.
             std::string tagsString_; //!< The comma-seperated string of all the tags the Level is tagged with.
     }; // tolua_export
@@ -147,6 +159,7 @@
         The following parameters can be specified:
         - @b name The name of the level.
         - @b description The description of the level.
+        - @b screenshot The screenshot of the level.
         - @b tags A comma-seperated string of tags. Allowed tags are: <em>test</em>, <em>singleplayer</em>, <em>multiplayer</em>, <em>showcase</em>, <em>tutorial</em>, <em>presentation</em>.
 
         An example would be:
@@ -154,6 +167,7 @@
         <LevelInfo
             name = "Levelname"lhs->compare(rhs) < 0
             description = "This is just some awesome level."
+            screenshot = "Screenshot.png"
             tags = "test, awesome"
         />
         @endcode
@@ -171,6 +185,17 @@
             virtual ~LevelInfo();
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Creates a LevelInfo object through XML.
+        
+            /**
+            @brief Set the screenshot of the Level.
+            @param screenshot The screenshot to be set.
+            */
+            inline void setScreenshot(const std::string& screenshot) { this->LevelInfoItem::setScreenshot(screenshot); }
+            /**
+            @brief Get the screenshot of the Level.
+            @return Returns the screenshot of the Level.
+            */
+            inline const std::string& getScreenshot() const { return this->LevelInfoItem::getScreenshot(); }
 
             /**
             @brief Set the description of the Level.

Modified: code/trunk/src/orxonox/controllers/AIController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/AIController.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/controllers/AIController.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -58,85 +58,53 @@
 
         if (this->state_ == FREE)
         {
-
+            
             if (this->formationFlight_)
             {
+
+                //changed order -> searchNewMaster MUSTN'T be called in SLAVE-state (bugfix for internal-error messages at quit)
+                random = rnd(maxrand);
+                if (random < 90 && (((!this->target_) || (random < 50 && this->target_)) && !this->forcedFree()))
+                       this->searchNewMaster();
+
                 // return to Master after being forced free
                 if (this->freedomCount_ == 1)
                 {
                     this->state_ = SLAVE;
                     this->freedomCount_ = 0;
                 }
-
-                random = rnd(maxrand);
-                if (random < 90 && (((!this->target_) || (random < 50 && this->target_)) && !this->forcedFree()))
-                    this->searchNewMaster();
             }
 
+            this->defaultBehaviour(maxrand);
+
+        }
+
+        if (this->state_ == SLAVE && this->formationMode_ == ATTACK) 
+        {
             // search enemy
             random = rnd(maxrand);
-            if (random < (15 + botlevel_* 20) && (!this->target_))
+            if (random < (botlevel_*100) && (!this->target_))
                 this->searchNewTarget();
 
-            // forget enemy
-            random = rnd(maxrand);
-            if (random < ((1-botlevel_)*6) && (this->target_))
-                this->forgetTarget();
-
             // next enemy
             random = rnd(maxrand);
-            if (random < (botlevel_*20) && (this->target_))
+            if (random < (botlevel_*30) && (this->target_))
                 this->searchNewTarget();
 
-            // fly somewhere
-            random = rnd(maxrand);
-            if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
-                this->searchRandomTargetPosition();
-
-            // stop flying
-            random = rnd(maxrand);
-            if (random < 10 && (this->bHasTargetPosition_ && !this->target_))
-                this->bHasTargetPosition_ = false;
-
-            // fly somewhere else
-            random = rnd(maxrand);
-            if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
-                this->searchRandomTargetPosition();
-
             // shoot
             random = rnd(maxrand);
-            if (!(this->passive_) && random < (75 + botlevel_*25) && (this->target_ && !this->bShooting_))
+            if (!(this->passive_) && random < (botlevel_*100) && (this->target_ && !this->bShooting_))
                 this->bShooting_ = true;
 
             // stop shooting
             random = rnd(maxrand);
-            if (random < ((1 - botlevel_)*25) && (this->bShooting_))
+            if (random < (1-botlevel_)*50 && (this->bShooting_))
                 this->bShooting_ = false;
 
-            // boost
-            random = rnd(maxrand);
-            if (random < botlevel_*100 )
-                this->boostControl();
-
-            // update Checkpoints
-            /*random = rnd(maxrand);
-            if (this->defaultWaypoint_ && random > (maxrand-10))
-                this->manageWaypoints();
-            else //if(random > maxrand-10) //CHECK USABILITY!!*/
-            if (this->waypoints_.size() == 0 )
-                this->manageWaypoints();
-
         }
 
-        if (this->state_ == SLAVE)
-        {
-
-        }
-
         if (this->state_ == MASTER)
         {
-
-
             this->commandSlaves();
 
             if  (this->specificMasterAction_ != NONE)
@@ -154,11 +122,11 @@
                 if (random < 5)
                    this->spinInit();
 
-                // follow a randomly chosen human - a specific Master Action
+                /*// follow a randomly chosen human - a specific Master Action
                 random = rnd(1000.0f);
                 if (random < 1)
                    this->followRandomHumanInit();
-
+*/
                  // lose master status (only if less than 4 slaves in formation)
                 random = rnd(maxrand);
                 if(random < 15/(this->slaves_.size()+1) && this->slaves_.size() < 4 )
@@ -169,57 +137,8 @@
                 if(this->slaves_.size() < 3 && random < 20)
                     this->searchNewMaster();
 
-                // search enemy
-                random = rnd(maxrand);
-                if (random < (botlevel_)*25 && (!this->target_))
-                    this->searchNewTarget();
+                this->defaultBehaviour(maxrand);
 
-                // forget enemy
-                random = rnd(maxrand);
-                if (random < (1-botlevel_)*6 && (this->target_))
-                    this->forgetTarget();
-
-                // next enemy
-                random = rnd(maxrand);
-                if (random < 10 && (this->target_))
-                    this->searchNewTarget();
-
-                // fly somewhere
-                random = rnd(maxrand);
-                if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
-                    this->searchRandomTargetPosition();
-
-
-                // fly somewhere else
-                random = rnd(maxrand);
-                if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
-                    this->searchRandomTargetPosition();
-
-                // shoot
-                random = rnd(maxrand);
-                if (!(this->passive_) && random < 25*(botlevel_)+1 && (this->target_ && !this->bShooting_))
-                {
-                    this->bShooting_ = true;
-                    this->forceFreeSlaves();
-                }
-
-                // stop shooting
-                random = rnd(maxrand);
-                if (random < ( (1- botlevel_)*25 ) && (this->bShooting_))
-                    this->bShooting_ = false;
-
-                // boost
-                random = rnd(maxrand);
-                if (random < botlevel_*100 )
-                    this->boostControl();
-
-                // update Checkpoints
-                /*random = rnd(maxrand);
-                if (this->defaultWaypoint_ && random > (maxrand-10))
-                    this->manageWaypoints();
-                else //if(random > maxrand-10) //CHECK USABILITY!!*/
-                if (this->waypoints_.size() == 0 )
-                    this->manageWaypoints();
             }
         }
 
@@ -233,7 +152,7 @@
         float random;
         float maxrand = 100.0f / ACTION_INTERVAL;
         ControllableEntity* controllable = this->getControllableEntity();
-
+        //DOES: Either move to the waypoint or search for a Point of interest
         if (controllable && this->mode_ == DEFAULT)// bot is ready to move to a target
         {
             if (this->waypoints_.size() > 0 ) //Waypoint functionality.
@@ -255,8 +174,9 @@
                 random = rnd(maxrand);
             }
         }
-        if(this->mode_ == DEFAULT)
-	    {
+
+        if (this->mode_ == DEFAULT)
+        {
             if (this->state_ == MASTER)
             {
                 if (this->specificMasterAction_ ==  NONE)
@@ -269,14 +189,13 @@
                         {
                             this->aimAtTarget();
                             random = rnd(maxrand);
-                            if(this->botlevel_*100 > random && !this->isCloseAtTarget(20))
+                            if(this->botlevel_*70 > random && !this->isCloseAtTarget(100))
                                 this->follow();  //If a bot is shooting a player, it shouldn't let him go away easily.
                         }
                     }
 
                     if (this->bHasTargetPosition_)
                         this->moveToTargetPosition();
-
                     this->doFire();
                 }
 
@@ -289,39 +208,33 @@
                     this->follow();
             }
 
-            if (this->state_ == SLAVE)
+            if (this->state_ == SLAVE && this->formationMode_ != ATTACK)
             {
                 if (this->bHasTargetPosition_)
                     this->moveToTargetPosition();
             }
 
-            if (this->state_ == FREE)
+            if (this->state_ == FREE || (this->state_==SLAVE && this->formationMode_ == ATTACK) )
             {
                 if (this->target_)
                 {
                     if (!this->target_->getRadarVisibility()) /* So AI won't shoot invisible Spaceships */
                         this->forgetTarget();
-                    else
-                    {
-                        this->aimAtTarget();
-                        random = rnd(maxrand);
-
-                        if(this->botlevel_*100 > random && !this->isCloseAtTarget(20))
-                            this->follow();//If a bot is shooting a player, it shouldn't let him go away easily.
-                     }
+                    else this->aimAtTarget();
                 }
 
                 if (this->bHasTargetPosition_)
                     this->moveToTargetPosition();
 
-                this->doFire();
+                    this->doFire();
             }
-        }//END_OF DEFAULT MODE
+        }
         else if (this->mode_ == ROCKET)//Rockets do not belong to a group of bots -> bot states are not relevant.
         {   //Vector-implementation: mode_.back() == ROCKET;
             if(controllable)
-            {
-                if(controllable->getRocket())//Check wether the bot is controlling the rocket and if the timeout is over.
+            {//Check wether the bot is controlling the rocket and if the timeout is over.
+                if(controllable->getIdentifier() == ClassByString("Rocket"))
+
                 {
                     this->follow();
                     this->timeout_ -= dt;
@@ -340,5 +253,73 @@
 
         SUPER(AIController, tick, dt);
     }
+//**********************************************NEW
+    void AIController::defaultBehaviour(float maxrand)
+    {       float random;
+            // search enemy
+            random = rnd(maxrand);
+            if (random < (botlevel_* 100) && (!this->target_))
+                this->searchNewTarget();
 
+            // forget enemy
+            random = rnd(maxrand);
+            if (random < ((1-botlevel_)*20) && (this->target_))
+                this->forgetTarget();
+
+            // next enemy
+            random = rnd(maxrand);
+            if (random < (botlevel_*30) && (this->target_))
+                this->searchNewTarget();
+
+            // fly somewhere
+            random = rnd(maxrand);
+            if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
+                this->searchRandomTargetPosition();
+
+            // stop flying
+            random = rnd(maxrand);
+            if (random < 10 && (this->bHasTargetPosition_ && !this->target_))
+                this->bHasTargetPosition_ = false;
+
+            // fly somewhere else
+            random = rnd(maxrand);
+            if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
+                this->searchRandomTargetPosition();
+
+            if (this->state_ == MASTER) // master: shoot
+            {
+                random = rnd(maxrand);
+                if (!(this->passive_) && random < (100*botlevel_) && (this->target_ && !this->bShooting_))
+                {
+                    this->bShooting_ = true;
+                    this->forceFreeSlaves();
+                }
+            }
+            else
+            {
+                // shoot
+                random = rnd(maxrand);
+                if (!(this->passive_) && random < (botlevel_*100) && (this->target_ && !this->bShooting_))
+                    this->bShooting_ = true;
+            }
+
+            // stop shooting
+            random = rnd(maxrand);
+            if (random < ((1 - botlevel_)*50) && (this->bShooting_))
+                this->bShooting_ = false;
+
+            // boost
+            random = rnd(maxrand);
+            if (random < botlevel_*50 )
+                this->boostControl();
+
+            // update Checkpoints
+            /*random = rnd(maxrand);
+            if (this->defaultWaypoint_ && random > (maxrand-10))
+                this->manageWaypoints();
+            else //if(random > maxrand-10) //CHECK USABILITY!!*/
+            if (this->waypoints_.size() == 0 )
+                this->manageWaypoints();
+    }
+
 }

Modified: code/trunk/src/orxonox/controllers/AIController.h
===================================================================
--- code/trunk/src/orxonox/controllers/AIController.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/controllers/AIController.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -43,15 +43,16 @@
             AIController(BaseObject* creator);
             virtual ~AIController();
 
-            virtual void tick(float dt);
+            virtual void tick(float dt); //<! Carrying out the targets set in action().
 
         protected:
-            virtual void action();
+            virtual void action(); //<! action() is called in regular intervals managing the bot's behaviour ~ setting targets.
+            void defaultBehaviour(float maxrand); //<! Helper function for code reusage. Some concrete commands for a bot.
 
         private:
             static const float ACTION_INTERVAL;
 
-            Timer actionTimer_;
+            Timer actionTimer_; //<! Regularly calls action().
     };
 }
 

Modified: code/trunk/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/ArtificialController.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/controllers/ArtificialController.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -23,80 +23,35 @@
  *      Fabian 'x3n' Landau
  *   Co-authors:
  *      Dominik Solenicki
- *
+ *      
  */
 
 #include "ArtificialController.h"
-
-#include <vector>
-#include <climits>
-
-#include "util/Math.h"
 #include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
 #include "core/command/ConsoleCommand.h"
-#include "worldentities/ControllableEntity.h"
 #include "worldentities/pawns/Pawn.h"
-#include "worldentities/pawns/TeamBaseMatchBase.h"
 #include "worldentities/pawns/SpaceShip.h"
-#include "gametypes/TeamDeathmatch.h"
-#include "gametypes/Dynamicmatch.h"
-#include "controllers/WaypointPatrolController.h"
-#include "controllers/NewHumanController.h"
-#include "controllers/DroneController.h"
+
 #include "weaponsystem/WeaponMode.h"
 #include "weaponsystem/WeaponPack.h"
 #include "weaponsystem/Weapon.h"
 #include "weaponsystem/WeaponSlot.h"
 #include "weaponsystem/WeaponSlot.h"
 
+
 namespace orxonox
 {
-    SetConsoleCommand("ArtificialController", "formationflight",  &ArtificialController::formationflight);
-    SetConsoleCommand("ArtificialController", "masteraction",     &ArtificialController::masteraction);
-    SetConsoleCommand("ArtificialController", "followme",         &ArtificialController::followme);
-    SetConsoleCommand("ArtificialController", "passivebehaviour", &ArtificialController::passivebehaviour);
-    SetConsoleCommand("ArtificialController", "formationsize",    &ArtificialController::formationsize);
     SetConsoleCommand("ArtificialController", "setbotlevel",      &ArtificialController::setAllBotLevel);
 
-    static const unsigned int STANDARD_MAX_FORMATION_SIZE = 7;
-    static const int RADIUS_TO_SEARCH_FOR_MASTERS = 5000;
-    static const int FORMATION_LENGTH =  130;
-    static const int FORMATION_WIDTH =  110;
-    static const int FREEDOM_COUNT = 4; //seconds the slaves in a formation will be set free when master attacks an enemy
-    static const float SPEED_MASTER = 0.6f;
-    static const float ROTATEFACTOR_MASTER = 0.2f;
-    static const float SPEED_FREE = 0.8f;
-    static const float ROTATEFACTOR_FREE = 0.8f;
-
-
-    ArtificialController::ArtificialController(BaseObject* creator) : Controller(creator)
+    ArtificialController::ArtificialController(BaseObject* creator) : FormationController(creator)
     {
-        RegisterObject(ArtificialController);
-
-        this->target_ = 0;
-        this->formationFlight_ = false;
-        this->passive_ = false;
-        this->maxFormationSize_ = STANDARD_MAX_FORMATION_SIZE;
-        this->myMaster_ = 0;
-        this->freedomCount_ = 0;
-        this->team_ = -1;
-        this->state_ = FREE;
-        this->specificMasterAction_ = NONE;
-        this->specificMasterActionHoldCount_  = 0;
-        this->bShooting_ = false;
-        this->bHasTargetPosition_ = false;
-        this->speedCounter_ = 0.2f;
-        this->targetPosition_ = Vector3::ZERO;
-
-        this->target_.setCallback(createFunctor(&ArtificialController::targetDied, this));
         this->bSetupWorked = false;
-        this->botlevel_ = 0.2f;
-        this->mode_ = DEFAULT;////Vector-implementation: mode_.push_back(DEFAULT);
+        this->botlevel_ = 0.5f;
         this->timeout_ = 0;
         this->currentWaypoint_ = 0;
         this->setAccuracy(5);
         this->defaultWaypoint_ = NULL;
+        this->mode_ = DEFAULT;//Vector-implementation: mode_.push_back(DEFAULT);
     }
 
     ArtificialController::~ArtificialController()
@@ -104,810 +59,21 @@
         if (this->isInitialized())
         {//Vector-implementation: mode_.erase(mode_.begin(),mode_.end());
             this->waypoints_.clear();
-            this->removeFromFormation();
             this->weaponModes_.clear();
-            for (ObjectList<ArtificialController>::iterator it = ObjectList<ArtificialController>::begin(); it; ++it)
-            {
-                if (*it != this)
-                {
-                    if (it->myMaster_ == this)
-                    {
-                        orxout(internal_error) << this << " is still master in " << (*it) << endl;
-                        it->myMaster_ = 0;
-                    }
-
-                    while (true)
-                    {
-                        std::vector<ArtificialController*>::iterator it2 = std::find(it->slaves_.begin(), it->slaves_.end(), this);
-                        if (it2 != it->slaves_.end())
-                        {
-                            orxout(internal_error) << this << " is still slave in " << (*it) << endl;
-                            it->slaves_.erase(it2);
-                        }
-                        else
-                            break;
-                    }
-                }
-            }
         }
     }
 
-    void ArtificialController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SUPER(ArtificialController, XMLPort, xmlelement, mode);
 
-        XMLPortParam(ArtificialController, "team", setTeam, getTeam, xmlelement, mode).defaultValues(-1);
-        XMLPortParam(ArtificialController, "formationFlight", setFormationFlight, getFormationFlight, xmlelement, mode).defaultValues(false);
-        XMLPortParam(ArtificialController, "formationSize", setFormationSize, getFormationSize, xmlelement, mode).defaultValues(STANDARD_MAX_FORMATION_SIZE);
-        XMLPortParam(ArtificialController, "passive", setPassive, getPassive, xmlelement, mode).defaultValues(false);
-    }
-
-// Documentation only here to get a faster overview for creating a useful documentation...
-
     /**
-        @brief Activates / deactivates formationflight behaviour
-        @param form activate formflight if form is true
-    */
-    void ArtificialController::formationflight(const bool form)
-    {
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
-        {
-            Controller* controller = 0;
-
-            if (it->getController())
-                controller = it->getController();
-            else if (it->getXMLController())
-                controller = it->getXMLController();
-
-            if (!controller)
-                continue;
-
-            ArtificialController *aiController = orxonox_cast<ArtificialController*>(controller);
-
-            if (aiController)
-            {
-                aiController->formationFlight_ = form;
-                if (!form)
-                {
-                    aiController->removeFromFormation();
-                }
-            }
-        }
-    }
-
-    /**
-        @brief Get all masters to do a "specific master action"
-        @param action which action to perform (integer, so it can be called with a console command (tmp solution))
-    */
-    void ArtificialController::masteraction(const int action)
-    {
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
-        {
-            Controller* controller = 0;
-
-            if (it->getController())
-                controller = it->getController();
-            else if (it->getXMLController())
-                controller = it->getXMLController();
-
-            if (!controller)
-                continue;
-
-            ArtificialController *aiController = orxonox_cast<ArtificialController*>(controller);
-
-            if(aiController && aiController->state_ == MASTER)
-            {
-                if (action == 1)
-                    aiController->spinInit();
-                if (action == 2)
-                    aiController->turn180Init();
-            }
-        }
-    }
-
-    /**
-        @brief A human player gets followed by its nearest master. Initiated by console command, so far intended for demonstration puproses (possible future pickup).
-    */
-    void ArtificialController::followme()
-    {
-
-        Pawn *humanPawn = NULL;
-        NewHumanController *currentHumanController = NULL;
-        std::vector<ArtificialController*> allMasters;
-
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
-        {
-            Controller* controller = 0;
-
-            if (it->getController())
-                controller = it->getController();
-            else if (it->getXMLController())
-                controller = it->getXMLController();
-
-            if (!controller)
-                continue;
-
-            currentHumanController = orxonox_cast<NewHumanController*>(controller);
-
-            if(currentHumanController) humanPawn = *it;
-
-            ArtificialController *aiController = orxonox_cast<ArtificialController*>(controller);
-
-            if(aiController && aiController->state_ == MASTER)
-                allMasters.push_back(aiController);
-
-        }
-
-        if((humanPawn != NULL) && (allMasters.size() != 0))
-        {
-                float posHuman = humanPawn->getPosition().length();
-                float distance = 0.0f;
-                float minDistance = FLT_MAX;
-                int index = 0;
-                int i = 0;
-
-                for(std::vector<ArtificialController*>::iterator it = allMasters.begin(); it != allMasters.end(); it++, i++)
-                    {
-                        if (!ArtificialController::sameTeam((*it)->getControllableEntity(), humanPawn, (*it)->getGametype())) continue;
-                        distance = posHuman - (*it)->getControllableEntity()->getPosition().length();
-                        if(distance < minDistance) index = i;
-                    }
-                allMasters[index]->followInit(humanPawn);
-            }
-
-    }
-
-    /**
-        @brief Sets shooting behaviour of pawns.
-        @param passive if true, bots won't shoot.
-    */
-    void ArtificialController::passivebehaviour(const bool passive)
-    {
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
-        {
-            Controller* controller = 0;
-
-            if (it->getController())
-                controller = it->getController();
-            else if (it->getXMLController())
-                controller = it->getXMLController();
-
-            if (!controller)
-                continue;
-
-            ArtificialController *aiController = orxonox_cast<ArtificialController*>(controller);
-
-            if(aiController)
-            {
-                aiController->passive_ = passive;
-            }
-        }
-    }
-
-
-    /**
-        @brief Sets maximal formation size
-        @param size maximal formation size.
-    */
-    void ArtificialController::formationsize(const int size)
-    {
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
-        {
-            Controller* controller = 0;
-
-            if (it->getController())
-                controller = it->getController();
-            else if (it->getXMLController())
-                controller = it->getXMLController();
-
-            if (!controller)
-                continue;
-
-            ArtificialController *aiController = orxonox_cast<ArtificialController*>(controller);
-
-            if(aiController)
-            {
-                aiController->maxFormationSize_ = size;
-            }
-        }
-    }
-
-    /**
         @brief Gets called when ControllableEntity is being changed. Resets the bot when it dies.
     */
     void ArtificialController::changedControllableEntity()
     {
         if (!this->getControllableEntity())
             this->removeFromFormation();
-        this->bSetupWorked = false;        // reset weapon information
-        this->setupWeapons();
     }
 
-    void ArtificialController::removeFromFormation()
-    {
-        if (this->state_ == SLAVE || this->myMaster_) // slaves can also be temporary free, so check if myMaster_ is set
-            this->unregisterSlave();
-        else if (this->state_ == MASTER)
-            this->setNewMasterWithinFormation();
-    }
 
-    void ArtificialController::moveToPosition(const Vector3& target)
-    {
-        if (!this->getControllableEntity())
-            return;
-
-        // Slave uses special movement if its master is in FOLLOW mode
-        if(this->state_ == SLAVE && this->myMaster_ && this->myMaster_->specificMasterAction_ == FOLLOW)
-        {
-//             this->followForSlaves(target);
-//             return;
-        }
-
-        Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
-        float distance = (target - this->getControllableEntity()->getPosition()).length();
-
-
-        if(this->state_ == FREE)
-        {
-            if (this->target_ || distance > 10)
-            {
-                // Multiply with ROTATEFACTOR_FREE to make them a bit slower
-                this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x*coord.x);
-                this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y*coord.y);
-            }
-
-            if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
-            {
-              this->getControllableEntity()->moveFrontBack(-0.05f); // They don't brake with full power to give the player a chance
-            } else this->getControllableEntity()->moveFrontBack(SPEED_FREE);
-        }
-
-
-
-        if(this->state_ == MASTER)
-        {
-            if (this->target_ || distance > 10)
-            {
-                this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_MASTER * sgn(coord.x) * coord.x*coord.x);
-                this->getControllableEntity()->rotatePitch(ROTATEFACTOR_MASTER * sgn(coord.y) * coord.y*coord.y);
-            }
-
-            if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
-            {
-                this->getControllableEntity()->moveFrontBack(-0.05f);
-            } else this->getControllableEntity()->moveFrontBack(SPEED_MASTER);
-        }
-
-
-
-        if(this->state_ == SLAVE)
-        {
-
-           this->getControllableEntity()->rotateYaw(-2.0f * ROTATEFACTOR_MASTER * sgn(coord.x) * coord.x*coord.x);
-           this->getControllableEntity()->rotatePitch(2.0f * ROTATEFACTOR_MASTER * sgn(coord.y) * coord.y*coord.y);
-
-            if (distance < 300)
-            {
-                if (distance < 40)
-                {
-                    this->getControllableEntity()->moveFrontBack(0.8f*SPEED_MASTER);
-                } else this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER);
-
-            } else {
-                this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER + distance/300.0f);
-            }
-        }
-
-        if (distance < 10)
-        {
-            this->positionReached();
-        }
-    }
-
-    void ArtificialController::absoluteMoveToPosition(const Vector3& target)
-    {
-        float minDistance = 40.0f;
-        if (!this->getControllableEntity())
-            return;
-
-        Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
-        float distance = (target - this->getControllableEntity()->getPosition()).length();
-
-            if (this->target_ || distance > minDistance)
-            {
-                // Multiply with ROTATEFACTOR_FREE to make them a bit slower
-                this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x*coord.x);
-                this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y*coord.y);
-                this->getControllableEntity()->moveFrontBack(SPEED_FREE);
-            }
-
-
-        if (distance < minDistance)
-        {
-            this->positionReached();
-        }
-    }
-
-
-    void ArtificialController::moveToTargetPosition()
-    {
-        this->moveToPosition(this->targetPosition_);
-    }
-
-    /**
-        @brief Unregisters a slave from its master. Initiated by a slave.
-    */
-    void ArtificialController::unregisterSlave()
-    {
-        if (this->myMaster_)
-        {
-            std::vector<ArtificialController*>::iterator it = std::find(this->myMaster_->slaves_.begin(), this->myMaster_->slaves_.end(), this);
-            if (it != this->myMaster_->slaves_.end())
-                this->myMaster_->slaves_.erase(it);
-        }
-
-        this->myMaster_ = 0;
-        this->state_ = FREE;
-    }
-
-    void ArtificialController::searchNewMaster()
-    {
-
-        if (!this->getControllableEntity())
-            return;
-
-        this->targetPosition_ = this->getControllableEntity()->getPosition();
-        this->forgetTarget();
-        int teamSize = 0;
-        //go through all pawns
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
-        {
-            //same team?
-            if (!ArtificialController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(*it), this->getGametype()))
-                continue;
-
-            //has it an ArtificialController?
-            Controller* controller = 0;
-
-            if (it->getController())
-                controller = it->getController();
-            else if (it->getXMLController())
-                controller = it->getXMLController();
-
-            if (!controller)
-                continue;
-
-            //is pawn oneself?
-            if (orxonox_cast<ControllableEntity*>(*it) == this->getControllableEntity())
-                continue;
-
-            teamSize++;
-
-            ArtificialController *newMaster = orxonox_cast<ArtificialController*>(controller);
-
-            //is it a master?
-            if (!newMaster || newMaster->state_ != MASTER)
-                continue;
-
-            float distance = (it->getPosition() - this->getControllableEntity()->getPosition()).length();
-
-            // is pawn in range?
-            if (distance < RADIUS_TO_SEARCH_FOR_MASTERS)
-            {
-                if(newMaster->slaves_.size() > this->maxFormationSize_) continue;
-
-                for(std::vector<ArtificialController*>::iterator itSlave = this->slaves_.begin(); itSlave != this->slaves_.end(); itSlave++)
-                {
-                    (*itSlave)->myMaster_ = newMaster;
-                    newMaster->slaves_.push_back(*itSlave);
-                }
-                this->slaves_.clear();
-                this->state_ = SLAVE;
-
-                this->myMaster_ = newMaster;
-                newMaster->slaves_.push_back(this);
-
-                break;
-            }
-        }
-
-        if (this->state_ != SLAVE  && teamSize != 0)
-        {
-            this->state_ = MASTER;
-            this->myMaster_ = 0;
-        }
-    }
-
-    /**
-        @brief Commands the slaves of a master into a formation. Sufficiently fast not to be called within tick. Initiated by a master.
-    */
-    void ArtificialController::commandSlaves()
-    {
-        if(this->state_ != MASTER) return;
-
-        Quaternion orient = this->getControllableEntity()->getOrientation();
-        Vector3 dest = this->getControllableEntity()->getPosition();
-
-        // 1 slave: follow
-        if (this->slaves_.size() == 1)
-        {
-            dest += 4*orient*WorldEntity::BACK;
-            this->slaves_.front()->setTargetPosition(dest);
-        }
-        else
-        {
-            dest += 1.0f*orient*WorldEntity::BACK;
-            Vector3 pos = Vector3::ZERO;
-            int i = 1;
-
-            for(std::vector<ArtificialController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++)
-            {
-                pos = Vector3::ZERO;
-                if (i <= 1) pos += dest  + (float)FORMATION_WIDTH*(orient*WorldEntity::LEFT);
-                if (i == 2) pos += dest  + (float)FORMATION_WIDTH*(orient*WorldEntity::RIGHT);
-                if (i == 3) pos += dest  + (float)FORMATION_WIDTH*(orient*WorldEntity::UP);
-                if (i >= 4)
-                {
-                    pos += dest  + (float)FORMATION_WIDTH*(orient*WorldEntity::DOWN);
-                    i = 1;
-                    dest += (float)FORMATION_LENGTH*(orient*WorldEntity::BACK);
-                    (*it)->setTargetPosition(pos);
-                    continue;
-                }
-                i++;
-                (*it)->setTargetPosition(pos);
-            }
-        }
-    }
-
-    /**
-        @brief Sets a new master within the formation. Called by a master.
-    */
-    void ArtificialController::setNewMasterWithinFormation()
-    {
-        if(this->state_ != MASTER) return;
-
-        if (!this->slaves_.empty())
-        {
-            ArtificialController *newMaster = this->slaves_.back();
-            this->slaves_.pop_back();
-
-            newMaster->state_ = MASTER;
-            newMaster->slaves_ = this->slaves_;
-            newMaster->myMaster_ = 0;
-
-            for(std::vector<ArtificialController*>::iterator it = newMaster->slaves_.begin(); it != newMaster->slaves_.end(); it++)
-            {
-                (*it)->myMaster_ = newMaster;
-            }
-        }
-
-        this->slaves_.clear();
-        this->specificMasterAction_ = NONE;
-        this->state_ = FREE;
-    }
-
-    /**
-        @brief Frees all slaves form a master. Initiated by a master.
-    */
-    void ArtificialController::freeSlaves()
-    {
-        if(this->state_ != MASTER) return;
-
-        for(std::vector<ArtificialController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++)
-        {
-            (*it)->state_ = FREE;
-            (*it)->myMaster_ = 0;
-        }
-        this->slaves_.clear();
-    }
-
-    /**
-        @brief Master sets its slaves free for @ref FREEDOM_COUNT seconds.
-    */
-    void ArtificialController::forceFreeSlaves()
-    {
-        if(this->state_ != MASTER) return;
-
-        for(std::vector<ArtificialController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++)
-        {
-            (*it)->state_ = FREE;
-            (*it)->forceFreedom();
-            (*it)->targetPosition_ = this->targetPosition_;
-            (*it)->bShooting_ = true;
-//             (*it)->getControllableEntity()->fire(0);// fire once for fun
-        }
-    }
-
-    void ArtificialController::loseMasterState()
-    {
-        this->freeSlaves();
-        this->state_ = FREE;
-    }
-
-
-    void ArtificialController::forceFreedom()
-    {
-        this->freedomCount_ = FREEDOM_COUNT;
-    }
-
-    /**
-        @brief Checks wether caller has been forced free, decrements time to stay forced free.
-        @return true if forced free.
-    */
-    bool ArtificialController::forcedFree()
-    {
-        if(this->freedomCount_ > 0)
-        {
-            this->freedomCount_--;
-            return true;
-        } else return false;
-    }
-
-    /**
-        @brief Used to continue a "specific master action" for a certain time and resuming normal behaviour after.
-    */
-    void ArtificialController::specificMasterActionHold()
-    {
-        if(this->state_ != MASTER) return;
-
-        if (specificMasterActionHoldCount_ == 0)
-         {
-            this->specificMasterAction_ = NONE;
-            this->searchNewTarget();
-         }
-        else specificMasterActionHoldCount_--;
-    }
-
-    /**
-        @brief Master initializes a 180 degree turn. Leads to a "specific master action".
-    */
-    void ArtificialController::turn180Init()
-    {
-        if(this->state_ != MASTER) return;
-
-        Quaternion orient = this->getControllableEntity()->getOrientation();
-
-        this->setTargetPosition(this->getControllableEntity()->getPosition() + 1000.0f*orient*WorldEntity::BACK);
-
-        this->specificMasterActionHoldCount_ = 4;
-
-        this->specificMasterAction_ = TURN180;
-    }
-
-    /**
-        @brief Execute the 180 degree turn. Called within tick.
-    */
-    void ArtificialController::turn180()
-    {
-            Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, this->targetPosition_);
-
-            this->getControllableEntity()->rotateYaw(-2.0f * sgn(coord.x) * coord.x*coord.x);
-            this->getControllableEntity()->rotatePitch(2.0f * sgn(coord.y) * coord.y*coord.y);
-
-            this->getControllableEntity()->moveFrontBack(SPEED_MASTER);
-    }
-
-    /**
-        @brief Master initializes a spin around its looking direction axis. Leads to a "specific master action".
-    */
-    void ArtificialController::spinInit()
-    {
-        if(this->state_ != MASTER) return;
-        this->specificMasterAction_ = SPIN;
-        this->specificMasterActionHoldCount_ = 10;
-    }
-
-    /**
-        @brief Execute the spin. Called within tick.
-    */
-    void ArtificialController::spin()
-    {
-            this->moveToTargetPosition();
-            this->getControllableEntity()->rotateRoll(0.8f);
-    }
-
-    /**
-        @brief Master begins to follow a pawn. Is a "specific master action".
-        @param pawn pawn to follow.
-        @param always follows pawn forever if true (false if omitted).
-        @param secondsToFollow seconds to follow the pawn if always is false. Will follow pawn 100 seconds if omitted (set in header).
-    */
-    void ArtificialController::followInit(Pawn* pawn, const bool always, const int secondsToFollow)
-    {
-        if (pawn == NULL || this->state_ != MASTER)
-            return;
-        this->specificMasterAction_  =  FOLLOW;
-
-        this->setTarget(pawn);
-        if (!always)
-            this->specificMasterActionHoldCount_ = secondsToFollow;
-        else
-            this->specificMasterActionHoldCount_ = INT_MAX; //for now...
-
-    }
-
-
-    /**
-        @brief Master begins to follow a randomly chosen human player of the same team. Is a "specific master action".
-    */
-    void ArtificialController::followRandomHumanInit()
-    {
-
-        Pawn *humanPawn = NULL;
-        NewHumanController *currentHumanController = NULL;
-
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
-        {
-            if (!it->getController())
-                continue;
-
-            currentHumanController = orxonox_cast<NewHumanController*>(it->getController());
-            if(currentHumanController)
-            {
-                if (!ArtificialController::sameTeam(this->getControllableEntity(), *it, this->getGametype())) continue;
-                humanPawn = *it;
-                break;
-            }
-        }
-
-        if((humanPawn != NULL))
-                this->followInit(humanPawn);
-    }
-
-    /**
-        @brief Master follows target with adjusted speed. Called within tick.
-    */
-    void ArtificialController::follow()
-    {
-        if (this->target_)
-            this->moveToPosition(this->target_->getPosition());
-        else
-            this->specificMasterActionHoldCount_ = 0;
-/*
-        if (!this->getControllableEntity())
-            return;
-
-        float distance = (this->target_->getPosition() - this->getControllableEntity()->getPosition()).length();
-
-        Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, this->target_->getPosition());
-
-
-        this->getControllableEntity()->rotateYaw(-0.8f * sgn(coord.x) * coord.x*coord.x);
-        this->getControllableEntity()->rotatePitch(0.8f * sgn(coord.y) * coord.y*coord.y);
-
-        float speedDiv = this->getControllableEntity()->getVelocity().squaredLength() - this->target_->getVelocity().squaredLength();
-
-orxout() << "~follow distance: " << distance << "SpeedCounter: " << this->speedCounter_ << "~speedDiv: " << speedDiv << endl;
-        if (distance < 800)
-        {
-            if (distance < 200)
-            {
-                this->speedCounter_ -= 0.5f;
-                if(this->speedCounter_ < 0) this->speedCounter_ = 0.0f;
-                this->getControllableEntity()->moveFrontBack(speedCounter_);
-            } else {
-                if(speedDiv < 0)
-                    this->speedCounter_ +=  0.01f;
-                else
-                    this->speedCounter_ -= 0.05f;
-                this->getControllableEntity()->moveFrontBack(speedCounter_);
-            }
-
-        } else {
-            this->speedCounter_ += 0.05f;
-            this->getControllableEntity()->moveFrontBack(speedCounter_ + distance/300.0f);
-        }
-//         if (this->getControllableEntity()->getVelocity().squaredLength() > 50.0f) this->speedCounter_ = 0;
-
-*/
-    }
-
-
-    /**
-        @brief Slave moving behaviour when master is following a pawn, gets redirected from moveToPosition(const Vector3& target)). Called within tick.
-    */
-    void ArtificialController::followForSlaves(const Vector3& target)
-    {
-
-/*
-        if (!this->getControllableEntity() && !this->myMaster_ && this->myMaster_->state_ != FOLLOW && !this->myMaster_->target_)
-            return;
-
-        float distance = (target - this->getControllableEntity()->getPosition()).length();
-
-        Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
-
-
-        this->getControllableEntity()->rotateYaw(-0.8f * sgn(coord.x) * coord.x*coord.x);
-        this->getControllableEntity()->rotatePitch(0.8f * sgn(coord.y) * coord.y*coord.y);
-
-
-        float speedDiv = this->getControllableEntity()->getVelocity().squaredLength() - this->myMaster_->target_->getVelocity().squaredLength();
-
-
-         if (distance < 800)
-        {
-            if (distance < 200)
-            {
-                this->speedCounter_ -= 5.0f;
-                if(this->speedCounter_ < 0) this->speedCounter_ = 0.0f;
-                this->getControllableEntity()->moveFrontBack(speedCounter_);
-            } else {
-                if(speedDiv < 0)
-                    this->speedCounter_ +=  0.01f;
-                else
-                    this->speedCounter_ -= 0.05f;
-                this->getControllableEntity()->moveFrontBack(speedCounter_);
-            }
-
-        } else {
-            this->speedCounter_ += 0.05f;
-            this->getControllableEntity()->moveFrontBack(speedCounter_ + distance/300.0f);
-        }
-//         if (this->getControllableEntity()->getVelocity().squaredLength() > 50.0f) this->speedCounter_ = 0;
-*/
-    }
-
-
-    void ArtificialController::setTargetPosition(const Vector3& target)
-    {
-        this->targetPosition_ = target;
-        this->bHasTargetPosition_ = true;
-    }
-
-    void ArtificialController::searchRandomTargetPosition()
-    {
-        this->targetPosition_ = Vector3(rnd(-2000,2000), rnd(-2000,2000), rnd(-2000,2000));
-        this->bHasTargetPosition_ = true;
-    }
-
-    void ArtificialController::setTarget(Pawn* target)
-    {
-        this->target_ = target;
-
-        if (target)
-            this->targetPosition_ = target->getPosition();
-    }
-
-    void ArtificialController::searchNewTarget()
-    {
-        if (!this->getControllableEntity())
-            return;
-
-        this->targetPosition_ = this->getControllableEntity()->getPosition();
-        this->forgetTarget();
-
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
-        {
-            if (ArtificialController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(*it), this->getGametype()))
-                continue;
-
-            /* So AI won't choose invisible Spaceships as target */
-            if (!it->getRadarVisibility())
-                continue;
-
-            if (static_cast<ControllableEntity*>(*it) != this->getControllableEntity())
-            {
-                float speed = this->getControllableEntity()->getVelocity().length();
-                Vector3 distanceCurrent = this->targetPosition_ - this->getControllableEntity()->getPosition();
-                Vector3 distanceNew = it->getPosition() - this->getControllableEntity()->getPosition();
-                if (!this->target_ || it->getPosition().squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceNew) / speed / distanceNew.length()) / math::twoPi)
-                        < this->targetPosition_.squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceCurrent) / speed / distanceCurrent.length()) / math::twoPi) + rnd(-250, 250))
-                {
-                    this->target_ = (*it);
-                    this->targetPosition_ = it->getPosition();
-                }
-            }
-        }
-    }
-
-    void ArtificialController::forgetTarget()
-    {
-        this->target_ = 0;
-        this->bShooting_ = false;
-    }
-
     void ArtificialController::aimAtTarget()
     {
         if (!this->target_ || !this->getControllableEntity())
@@ -948,122 +114,6 @@
             this->targetDied();
     }
 
-    void ArtificialController::targetDied()
-    {
-        this->forgetTarget();
-        this->searchRandomTargetPosition();
-    }
-
-    bool ArtificialController::sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype)
-    {
-        if(!entity1 || !entity2)
-            return true;
-        if (entity1 == entity2)
-            return true;
-
-        int team1 = -1;
-        int team2 = -1;
-
-        Controller* controller = 0;
-        if (entity1->getController())
-            controller = entity1->getController();
-        else
-            controller = entity1->getXMLController();
-        if (controller)
-        {
-            ArtificialController* ac = orxonox_cast<ArtificialController*>(controller);
-            if (ac)
-                team1 = ac->getTeam();
-        }
-
-        if (entity2->getController())
-            controller = entity2->getController();
-        else
-            controller = entity2->getXMLController();
-        if (controller)
-        {
-            ArtificialController* ac = orxonox_cast<ArtificialController*>(controller);
-            if (ac)
-                team2 = ac->getTeam();
-        }
-
-        TeamDeathmatch* tdm = orxonox_cast<TeamDeathmatch*>(gametype);
-        if (tdm)
-        {
-            if (entity1->getPlayer())
-                team1 = tdm->getTeam(entity1->getPlayer());
-
-            if (entity2->getPlayer())
-                team2 = tdm->getTeam(entity2->getPlayer());
-        }
-
-        TeamBaseMatchBase* base = 0;
-        base = orxonox_cast<TeamBaseMatchBase*>(entity1);
-        if (base)
-        {
-            switch (base->getState())
-            {
-                case BaseState::ControlTeam1:
-                    team1 = 0;
-                    break;
-                case BaseState::ControlTeam2:
-                    team1 = 1;
-                    break;
-                case BaseState::Uncontrolled:
-                default:
-                    team1 = -1;
-            }
-        }
-        base = orxonox_cast<TeamBaseMatchBase*>(entity2);
-        if (base)
-        {
-            switch (base->getState())
-            {
-                case BaseState::ControlTeam1:
-                    team2 = 0;
-                    break;
-                case BaseState::ControlTeam2:
-                    team2 = 1;
-                    break;
-                case BaseState::Uncontrolled:
-                default:
-                    team2 = -1;
-            }
-        }
-
-        DroneController* droneController = 0;
-        droneController = orxonox_cast<DroneController*>(entity1->getController());
-        if (droneController && static_cast<ControllableEntity*>(droneController->getOwner()) == entity2)
-            return true;
-        droneController = orxonox_cast<DroneController*>(entity2->getController());
-        if (droneController && static_cast<ControllableEntity*>(droneController->getOwner()) == entity1)
-            return true;
-        DroneController* droneController1 = orxonox_cast<DroneController*>(entity1->getController());
-        DroneController* droneController2 = orxonox_cast<DroneController*>(entity2->getController());
-        if (droneController1 && droneController2 && droneController1->getOwner() == droneController2->getOwner())
-            return true;
-
-        Dynamicmatch* dynamic = orxonox_cast<Dynamicmatch*>(gametype);
-        if (dynamic)
-        {
-            if (dynamic->notEnoughPigs||dynamic->notEnoughKillers||dynamic->notEnoughChasers) {return false;}
-
-            if (entity1->getPlayer())
-                team1 = dynamic->getParty(entity1->getPlayer());
-
-            if (entity2->getPlayer())
-                team2 = dynamic->getParty(entity2->getPlayer());
-
-            if (team1 ==-1 ||team2 ==-1 ) {return false;}
-            else if (team1 == dynamic->chaser && team2 != dynamic->chaser) {return false;}
-            else if (team1 == dynamic->piggy && team2 == dynamic->chaser) {return false;}
-            else if (team1 == dynamic->killer && team2 == dynamic->chaser) {return false;}
-            else return true;
-        }
-
-        return (team1 == team2 && team1 != -1);
-    }
-
     /**
         @brief DoFire is called when a bot should shoot and decides which weapon is used and whether the bot shoots at all.
     */
@@ -1109,7 +159,7 @@
         if(this->getControllableEntity())
         {
             Pawn* pawn = orxonox_cast<Pawn*>(this->getControllableEntity());
-            if(pawn)
+            if(pawn && pawn->isA(Class(SpaceShip))) //fix for First Person Mode: check for SpaceShip
             {
                 this->weaponModes_.clear(); // reset previous weapon information
                 WeaponSlot* wSlot = 0;
@@ -1216,7 +266,7 @@
     }
 
     /**
-        @brief Adds point of interest depending on context. Further Possibilites: "ForceField", "PortalEndPoint", "MovableEntity", "Dock"
+        @brief Adds point of interest depending on context.  TODO: Further Possibilites: "ForceField", "PortalEndPoint", "MovableEntity", "Dock"
     */
     void ArtificialController::manageWaypoints()
     {
@@ -1225,5 +275,5 @@
         else
             this->updatePointsOfInterest("PickupSpawner", 20.0f); // take pickup en passant if there is a default waypoint
     }
-
+ 
 }

Modified: code/trunk/src/orxonox/controllers/ArtificialController.h
===================================================================
--- code/trunk/src/orxonox/controllers/ArtificialController.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/controllers/ArtificialController.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -30,54 +30,21 @@
 #define _ArtificialController_H__
 
 #include "OrxonoxPrereqs.h"
+#include "controllers/FormationController.h"
 
-#include <map>
 
-#include "util/Math.h"
-#include "Controller.h"
-#include "controllers/NewHumanController.h"
-#include "weaponsystem/WeaponSystem.h"
-
 namespace orxonox
 {
-    class _OrxonoxExport ArtificialController : public Controller
+    class _OrxonoxExport ArtificialController : public FormationController
     {
         public:
             ArtificialController(BaseObject* creator);
             virtual ~ArtificialController();
 
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-
             void abandonTarget(Pawn* target);
 
-            inline void setTeam(int team)
-                { this->team_ = team; }
-            inline int getTeam() const
-                { return this->team_; }
-
-            inline void setFormationFlight(bool formation)
-                { this->formationFlight_ = formation; }
-            inline bool getFormationFlight() const
-                { return this->formationFlight_; }
-
-            inline void setFormationSize(int size)
-                { this->maxFormationSize_ = size; }
-            inline int getFormationSize() const
-                { return this->maxFormationSize_; }
-
-            inline void setPassive(bool passive)
-                { this->passive_ = passive; }
-            inline bool getPassive() const
-                { return this->passive_; }
-
             virtual void changedControllableEntity();
 
-            static void formationflight(const bool form);
-            static void masteraction(const int action);
-            static void followme();
-            static void passivebehaviour(const bool passive);
-            static void formationsize(const int size);
-
             virtual void doFire();
             void setBotLevel(float level=1.0f);
             inline float getBotLevel() const
@@ -94,89 +61,39 @@
             void updatePointsOfInterest(std::string name, float distance);
             void manageWaypoints();
 
-        protected:
+            
 
-            int team_;
-            bool formationFlight_;
-            bool passive_;
-            unsigned int maxFormationSize_;
-            int freedomCount_;
-            enum State {SLAVE, MASTER, FREE};
-            State state_;
-            std::vector<ArtificialController*> slaves_;
-            ArtificialController *myMaster_;
-            enum SpecificMasterAction {NONE, HOLD, SPIN, TURN180, FOLLOW};
-            SpecificMasterAction specificMasterAction_;
-            int specificMasterActionHoldCount_;
-            float speedCounter_; //for speed adjustment when following
-
-            void moveToPosition(const Vector3& target);
-            void moveToTargetPosition();
-            void absoluteMoveToPosition(const Vector3& target);
-
-            virtual void positionReached() {}
-
-            void removeFromFormation();
-            void unregisterSlave();
-            void searchNewMaster();
-            void commandSlaves();
-            void setNewMasterWithinFormation();
-
-            void freeSlaves();
-            void forceFreeSlaves();
-            void loseMasterState();
-            void forceFreedom();
-            bool forcedFree();
-
-            void specificMasterActionHold();
-            void turn180Init();
-            void turn180();
-            void spinInit();
-            void spin();
-            void followInit(Pawn* pawn, const bool always = false, const int secondsToFollow = 100);
-            void followRandomHumanInit();
-            void follow();
-            void followForSlaves(const Vector3& target);
-
-            void setTargetPosition(const Vector3& target);
-            void searchRandomTargetPosition();
-
-            void setTarget(Pawn* target);
-            void searchNewTarget();
-            void forgetTarget();
+        protected:
+            
             void aimAtTarget();
 
             bool isCloseAtTarget(float distance) const;
             bool isLookingAtTarget(float angle) const;
 
-            void targetDied();
-
-            static bool sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype); // hack
-            void boostControl(); //<! Sets and resets the boost parameter of the spaceship. Bots alternate between boosting and saving boost.
-
-            bool bHasTargetPosition_;
-            Vector3 targetPosition_;
-            WeakPtr<Pawn> target_;
-            bool bShooting_;
-
             float botlevel_; //<! Makes the level of a bot configurable.
             enum Mode {DEFAULT, ROCKET, DEFENCE, MOVING};//TODO; implement DEFENCE, MOVING modes
             Mode mode_; //TODO: replace single value with stack-like implementation: std::vector<Mode> mode_;
             void setPreviousMode();
 
+
             //WEAPONSYSTEM DATA
-            std::map<std::string, int> weaponModes_; //<! Links each "weapon" to it's weaponmode- managed by setupWeapons()
+            std::map<std::string, int> weaponModes_; //<! Links each "weapon" to it's weaponmode - managed by setupWeapons()
             //std::vector<int> projectiles_; //<! Displays amount of projectiles of each weapon. - managed by setupWeapons()
             float timeout_; //<! Timeout for rocket usage. (If a rocket misses, a bot should stop using it.)
             void setupWeapons(); //<! Defines which weapons are available for a bot. Is recalled whenever a bot was killed.
             bool bSetupWorked; //<! If false, setupWeapons() is called.
             int getFiremode(std::string name);
 
+
             //WAYPOINT DATA
             std::vector<WeakPtr<WorldEntity> > waypoints_;
             size_t currentWaypoint_;
             float squaredaccuracy_;
             WorldEntity* defaultWaypoint_;
+
+            void boostControl(); //<! Sets and resets the boost parameter of the spaceship. Bots alternate between boosting and saving boost.
+
+        private:
     };
 }
 

Modified: code/trunk/src/orxonox/controllers/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/controllers/CMakeLists.txt	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/controllers/CMakeLists.txt	2012-02-15 22:51:58 UTC (rev 9016)
@@ -8,4 +8,5 @@
   WaypointController.cc
   WaypointPatrolController.cc
   DroneController.cc
+  FormationController.cc
 )

Copied: code/trunk/src/orxonox/controllers/FormationController.cc (from rev 9015, code/branches/presentation2011/src/orxonox/controllers/FormationController.cc)
===================================================================
--- code/trunk/src/orxonox/controllers/FormationController.cc	                        (rev 0)
+++ code/trunk/src/orxonox/controllers/FormationController.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -0,0 +1,1066 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      Dominik Solenicki
+ *
+ */
+
+#include <climits>
+#include "controllers/FormationController.h"
+
+#include "core/CoreIncludes.h"
+
+#include "core/XMLPort.h"
+#include "core/command/ConsoleCommand.h"
+
+#include "worldentities/ControllableEntity.h"
+#include "worldentities/pawns/Pawn.h"
+#include "worldentities/pawns/TeamBaseMatchBase.h"
+#include "gametypes/TeamDeathmatch.h"
+#include "gametypes/Dynamicmatch.h"
+#include "gametypes/Mission.h"
+#include "gametypes/Gametype.h"
+#include "controllers/WaypointPatrolController.h"
+#include "controllers/NewHumanController.h"
+#include "controllers/DroneController.h"
+
+
+namespace orxonox
+{
+
+  SetConsoleCommand("FormationController", "formationflight",  &FormationController::formationflight);
+  SetConsoleCommand("FormationController", "masteraction",     &FormationController::masteraction);
+  SetConsoleCommand("FormationController", "followme",         &FormationController::followme);
+  SetConsoleCommand("FormationController", "passivebehaviour", &FormationController::passivebehaviour);
+  SetConsoleCommand("FormationController", "formationsize",    &FormationController::formationsize);
+
+
+
+
+  static const unsigned int STANDARD_MAX_FORMATION_SIZE = 9;
+  static const int RADIUS_TO_SEARCH_FOR_MASTERS = 5000;
+  static const int FORMATION_LENGTH =  110;
+  static const int FORMATION_WIDTH =  110;
+  static const int FREEDOM_COUNT = 4; //seconds the slaves in a formation will be set free when master attacks an enemy
+  static const float SPEED_MASTER = 0.6f;
+  static const float ROTATEFACTOR_MASTER = 0.2f;
+  static const float SPEED_FREE = 0.8f;
+  static const float ROTATEFACTOR_FREE = 0.8f;
+
+  FormationController::FormationController(BaseObject* creator) : Controller(creator)
+  {
+        RegisterObject(FormationController);
+
+        this->target_ = 0;
+        this->formationFlight_ = false;
+        this->passive_ = false;
+        this->maxFormationSize_ = STANDARD_MAX_FORMATION_SIZE;
+        this->myMaster_ = 0;
+        this->freedomCount_ = 0;
+
+        this->state_ = FREE;
+        this->formationMode_ = NORMAL;
+        this->specificMasterAction_ = NONE;
+        this->specificMasterActionHoldCount_  = 0;
+        this->bShooting_ = false;
+        this->bHasTargetPosition_ = false;
+        this->bHasTargetOrientation_=false;
+        this->speedCounter_ = 0.2f;
+        this->targetPosition_ = Vector3::ZERO;
+        this->team_=-1;
+        this->target_.setCallback(createFunctor(&FormationController::targetDied, this));
+  }
+
+  FormationController::~FormationController()
+  {
+    if (this->isInitialized())
+        {
+            this->removeFromFormation();
+
+            for (ObjectList<FormationController>::iterator it = ObjectList<FormationController>::begin(); it; ++it)
+            {
+                if (*it != this)
+                {
+                    if (it->myMaster_ == this)
+                    {
+                        orxout(internal_error) << this << " is still master in " << (*it) << endl;
+                        it->myMaster_ = 0;
+                    }
+
+                    while (true)
+                    {
+                        std::vector<FormationController*>::iterator it2 = std::find(it->slaves_.begin(), it->slaves_.end(), this);
+                        if (it2 != it->slaves_.end())
+                        {
+                            orxout(internal_error) << this << " is still slave in " << (*it) << endl;
+                            it->slaves_.erase(it2);
+                        }
+                        else
+                            break;
+                    }
+                }
+            }
+        }
+  }
+
+  void FormationController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(FormationController, XMLPort, xmlelement, mode);
+
+        XMLPortParam(FormationController, "team", setTeam, getTeam, xmlelement, mode).defaultValues(-1);
+        XMLPortParam(FormationController, "formationFlight", setFormationFlight, getFormationFlight, xmlelement, mode).defaultValues(false);
+        XMLPortParam(FormationController, "formationSize", setFormationSize, getFormationSize, xmlelement, mode).defaultValues(STANDARD_MAX_FORMATION_SIZE);
+        XMLPortParam(FormationController, "passive", setPassive, getPassive, xmlelement, mode).defaultValues(false);
+    }
+
+
+
+  /**
+        @brief Activates / deactivates formationflight behaviour
+        @param form activate formflight if form is true
+    */
+  void FormationController::formationflight(const bool form)
+    {
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        {
+            Controller* controller = 0;
+
+            if (it->getController())
+                controller = it->getController();
+            else if (it->getXMLController())
+                controller = it->getXMLController();
+
+            if (!controller)
+                continue;
+
+            FormationController *aiController = orxonox_cast<FormationController*>(controller);
+
+            if (aiController)
+            {
+                aiController->formationFlight_ = form;
+                if (!form)
+                {
+                    aiController->removeFromFormation();
+                }
+            }
+        }
+    }
+
+  /**
+        @brief Get all masters to do a "specific master action"
+        @param action which action to perform (integer, so it can be called with a console command (tmp solution))
+    */
+    void FormationController::masteraction(const int action)
+    {
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        {
+            Controller* controller = 0;
+
+            if (it->getController())
+                controller = it->getController();
+            else if (it->getXMLController())
+                controller = it->getXMLController();
+
+            if (!controller)
+                continue;
+
+            FormationController *aiController = orxonox_cast<FormationController*>(controller);
+
+            if(aiController && aiController->state_ == MASTER)
+            {
+                if (action == 1)
+                    aiController->spinInit();
+                if (action == 2)
+                    aiController->turn180Init();
+            }
+        }
+    }
+
+  /**
+        @brief Sets shooting behaviour of pawns.
+        @param passive if true, bots won't shoot.
+    */
+    void FormationController::passivebehaviour(const bool passive)
+    {
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        {
+            Controller* controller = 0;
+
+            if (it->getController())
+                controller = it->getController();
+            else if (it->getXMLController())
+                controller = it->getXMLController();
+
+            if (!controller)
+                continue;
+
+            FormationController *aiController = orxonox_cast<FormationController*>(controller);
+
+            if(aiController)
+            {
+                aiController->passive_ = passive;
+            }
+        }
+    }
+
+  /**
+        @brief Sets maximal formation size
+        @param size maximal formation size.
+    */
+    void FormationController::formationsize(const int size)
+    {
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        {
+            Controller* controller = 0;
+
+            if (it->getController())
+                controller = it->getController();
+            else if (it->getXMLController())
+                controller = it->getXMLController();
+
+            if (!controller)
+                continue;
+
+            FormationController *aiController = orxonox_cast<FormationController*>(controller);
+
+            if(aiController)
+            {
+                aiController->maxFormationSize_ = size;
+            }
+        }
+    }
+
+  void FormationController::removeFromFormation()
+    {
+        if (this->state_ == SLAVE || this->myMaster_) // slaves can also be temporary free, so check if myMaster_ is set
+            this->unregisterSlave();
+        else if (this->state_ == MASTER)
+            this->setNewMasterWithinFormation();
+    }
+
+    void FormationController::moveToPosition(const Vector3& target)
+    {
+        if (!this->getControllableEntity())
+            return;
+
+        // Slave uses special movement if its master is in FOLLOW mode
+        if(this->state_ == SLAVE && this->myMaster_ && this->myMaster_->specificMasterAction_ == FOLLOW)
+        {
+//             this->followForSlaves(target);
+//             return;
+        }
+
+        Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
+        float distance = (target - this->getControllableEntity()->getPosition()).length();
+
+
+        if(this->state_ == FREE)
+        {
+            if (this->target_ || distance > 10)
+            {
+                // Multiply with ROTATEFACTOR_FREE to make them a bit slower
+                this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x*coord.x);
+                this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y*coord.y);
+            }
+
+            if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
+            {
+              this->getControllableEntity()->moveFrontBack(-0.05f); // They don't brake with full power to give the player a chance
+            } else this->getControllableEntity()->moveFrontBack(SPEED_FREE);
+        }
+
+
+
+        if(this->state_ == MASTER)
+        {
+            if (this->target_ || distance > 10)
+            {
+                this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_MASTER * sgn(coord.x) * coord.x*coord.x);
+                this->getControllableEntity()->rotatePitch(ROTATEFACTOR_MASTER * sgn(coord.y) * coord.y*coord.y);
+            }
+
+            if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
+            {
+                this->getControllableEntity()->moveFrontBack(-0.05f);
+            } else this->getControllableEntity()->moveFrontBack(SPEED_MASTER);
+        }
+
+
+
+        if(this->state_ == SLAVE)
+        {
+
+           this->getControllableEntity()->rotateYaw(-2.0f * ROTATEFACTOR_MASTER * sgn(coord.x) * coord.x*coord.x);
+           this->getControllableEntity()->rotatePitch(2.0f * ROTATEFACTOR_MASTER * sgn(coord.y) * coord.y*coord.y);
+
+            if (distance < 300)
+            {
+		 if (bHasTargetOrientation_)
+		    {
+			copyTargetOrientation();
+		    }
+                if (distance < 100)
+                {   //linear speed reduction
+                    this->getControllableEntity()->moveFrontBack(distance/100.0f*0.4f*SPEED_MASTER);
+		   
+                } else this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER);
+
+            } else {
+                this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER + distance/300.0f);
+            }
+        }
+
+        if (distance < 10)
+        {
+            this->positionReached();
+	    bHasTargetOrientation_=false;
+        }
+    }
+
+
+
+  void FormationController::moveToTargetPosition()
+    {
+        this->moveToPosition(this->targetPosition_);
+    }
+
+  //copy the Roll orientation of given Quaternion.
+  void FormationController::copyOrientation(const Quaternion& orient)
+    {
+        //roll angle difference in radian
+        float diff=orient.getRoll(false).valueRadians()-(this->getControllableEntity()->getOrientation().getRoll(false).valueRadians());
+        while(diff>math::twoPi) diff-=math::twoPi;
+        while(diff<-math::twoPi) diff+=math::twoPi;
+        this->getControllableEntity()->rotateRoll(diff*ROTATEFACTOR_MASTER);
+    }
+
+    void FormationController::copyTargetOrientation()
+    {
+        if (bHasTargetOrientation_)
+        {
+            copyOrientation(targetOrientation_);
+        }
+    }
+
+
+   /**
+        @brief Unregisters a slave from its master. Initiated by a slave.
+    */
+    void FormationController::unregisterSlave()
+    {
+        if (this->myMaster_)
+        {
+            std::vector<FormationController*>::iterator it = std::find(this->myMaster_->slaves_.begin(), this->myMaster_->slaves_.end(), this);
+            if (it != this->myMaster_->slaves_.end())
+                this->myMaster_->slaves_.erase(it);
+        }
+
+        this->myMaster_ = 0;
+        this->state_ = FREE;
+    }
+
+    void FormationController::searchNewMaster()
+    {
+        if (this->state_==SLAVE) 
+           return;
+        if (!this->getControllableEntity())
+            return;
+
+        this->targetPosition_ = this->getControllableEntity()->getPosition();
+        this->forgetTarget();
+        int teamSize = 0;
+        //go through all pawns
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        {
+           
+            //same team?
+            Gametype* gt=this->getGametype();
+            if (!gt)
+            {
+                gt=it->getGametype();
+            }
+            if (!FormationController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(*it),gt))
+                continue;
+
+            //has it an FormationController?
+            Controller* controller = 0;
+
+            if (it->getController())
+                controller = it->getController();
+            else if (it->getXMLController())
+                controller = it->getXMLController();
+
+            if (!controller)
+                continue;
+
+            //is pawn oneself?
+            if (orxonox_cast<ControllableEntity*>(*it) == this->getControllableEntity())
+                continue;
+
+            teamSize++;
+
+            FormationController *newMaster = orxonox_cast<FormationController*>(controller);
+
+            //is it a master?
+            if (!newMaster || newMaster->state_ != MASTER)
+                continue;
+
+            float distance = (it->getPosition() - this->getControllableEntity()->getPosition()).length();
+
+            // is pawn in range?
+            if (distance < RADIUS_TO_SEARCH_FOR_MASTERS)
+            {
+                if(newMaster->slaves_.size() > this->maxFormationSize_) continue;
+
+                for(std::vector<FormationController*>::iterator itSlave = this->slaves_.begin(); itSlave != this->slaves_.end(); itSlave++)
+                {
+                    (*itSlave)->myMaster_ = newMaster;
+                    newMaster->slaves_.push_back(*itSlave);
+                }
+                this->slaves_.clear();
+                this->state_ = SLAVE;
+
+                this->myMaster_ = newMaster;
+                newMaster->slaves_.push_back(this);
+
+                break;
+            }
+        }
+
+        if (this->state_ != SLAVE  && teamSize != 0)
+        {
+            this->state_ = MASTER;
+            this->myMaster_ = 0;
+        }
+    }
+ /**
+        @brief Commands the slaves of a master into a formation. Sufficiently fast not to be called within tick. Initiated by a master.
+    */
+
+void FormationController::commandSlaves()
+    {
+        if(this->state_ != MASTER) return;
+
+        Quaternion orient = this->getControllableEntity()->getOrientation();
+        Vector3 dest = this->getControllableEntity()->getPosition();
+
+        // 1 slave: follow
+        if (this->slaves_.size() == 1)
+        {
+            dest += 4*orient*WorldEntity::BACK;
+            this->slaves_.front()->setTargetPosition(dest);
+        }
+        else
+	// formation:
+        {
+            dest += 1.0f*orient*WorldEntity::BACK;
+            Vector3 pos = Vector3::ZERO;
+	         bool left=true;
+            int i = 1;
+	    
+            for(std::vector<FormationController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++)
+            {
+                pos = Vector3::ZERO;
+                if (left)
+                {
+                    pos+=dest+i*FORMATION_WIDTH*(orient*WorldEntity::LEFT);
+                } else{
+                    pos+=dest+i*FORMATION_WIDTH*(orient*WorldEntity::RIGHT);
+                    i++;
+                    dest+=FORMATION_LENGTH*(orient*WorldEntity::BACK);
+                }		
+                (*it)->setTargetOrientation(orient);
+                (*it)->setTargetPosition(pos);
+                left=!left;
+            }
+        }
+    }
+
+    /**
+        @brief Sets a new master within the formation. Called by a master.
+    */
+    void FormationController::setNewMasterWithinFormation()
+    {
+        if(this->state_ != MASTER) return;
+
+        if (!this->slaves_.empty())
+        {
+            FormationController *newMaster = this->slaves_.back();
+            this->slaves_.pop_back();
+
+            newMaster->state_ = MASTER;
+            newMaster->slaves_ = this->slaves_;
+            newMaster->myMaster_ = 0;
+
+            for(std::vector<FormationController*>::iterator it = newMaster->slaves_.begin(); it != newMaster->slaves_.end(); it++)
+            {
+                (*it)->myMaster_ = newMaster;
+            }
+        }
+
+        this->slaves_.clear();
+        this->specificMasterAction_ = NONE;
+        this->state_ = FREE;
+    }
+
+
+  /**
+        @brief Frees all slaves form a master. Initiated by a master.
+    */
+    void FormationController::freeSlaves()
+    {
+        if(this->state_ != MASTER) return;
+
+        for(std::vector<FormationController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++)
+        {
+            (*it)->state_ = FREE;
+            (*it)->myMaster_ = 0;
+        }
+        this->slaves_.clear();
+    }
+
+    /**
+        @brief Master sets its slaves free for @ref FREEDOM_COUNT seconds.
+    */
+    void FormationController::forceFreeSlaves()
+    {
+        if(this->state_ != MASTER) return;
+
+        for(std::vector<FormationController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++)
+        {
+            (*it)->state_ = FREE;
+            (*it)->forceFreedom();
+            (*it)->targetPosition_ = this->targetPosition_;
+            (*it)->bShooting_ = true;
+//             (*it)->getControllableEntity()->fire(0);// fire once for fun
+        }
+    }
+
+    void FormationController::loseMasterState()
+    {
+        this->freeSlaves();
+        this->state_ = FREE;
+    }
+
+
+    void FormationController::forceFreedom()
+    {
+        this->freedomCount_ = FREEDOM_COUNT;
+    }
+
+    /**
+        @brief Checks wether caller has been forced free, decrements time to stay forced free.
+        @return true if forced free.
+    */
+    bool FormationController::forcedFree()
+    {
+        if(this->freedomCount_ > 0)
+        {
+            this->freedomCount_--;
+            return true;
+        } else return false;
+    }
+
+
+    /**
+        @brief Call to take the lead of formation (if free, become slave of nearest formation, then, if Slave, become Master)
+    */
+    void FormationController::takeLeadOfFormation()
+    {
+        if (!this->getControllableEntity() || this->state_==MASTER)
+            return;
+
+        //search new Master, then take lead
+        if (this->state_==FREE && this->myMaster_==0)
+        {
+          searchNewMaster();
+        }
+
+        if (this->state_==SLAVE)  //become master of this formation
+        {   
+            this->slaves_=this->myMaster_->slaves_;
+            this->myMaster_->slaves_.clear();
+            this->myMaster_->state_=SLAVE;
+            this->myMaster_->myMaster_=this;
+            
+            //delete myself in slavelist
+            std::vector<FormationController*>::iterator it2 = std::find(this->slaves_.begin(), this->slaves_.end(), this);
+            if (it2 != this->slaves_.end())
+            {
+                 this->slaves_.erase(it2);
+            }
+            //add previous master
+            this->slaves_.push_back(this->myMaster_);
+            //set this as new master
+            for(std::vector<FormationController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++)
+            {
+                 (*it)->myMaster_=this;
+            }
+            this->myMaster_=0;
+            this->state_=MASTER;
+        }
+        /*/debug
+        if (this->state_==SLAVE)
+           {orxout(debug_output) << this << " is slave "<< endl;}
+        else if (this->state_==MASTER)
+           {orxout(debug_output) << this << " is now a master of "<<this->slaves_.size()<<" slaves."<< endl;}
+        if (this->state_==FREE)
+           {orxout(debug_output) << this << " is free "<< endl;}*/
+    }
+    /**
+      @brief if called, half of the formation will attack the originator
+    */
+    void FormationController::masterAttacked(Pawn* originator)
+    {
+       if (this->state_!=MASTER) return;
+       unsigned int i=0;
+       for(std::vector<FormationController*>::reverse_iterator it = slaves_.rbegin(); it != slaves_.rend(); it++)
+       {
+           if ((*it)->state_!=FREE)
+           {
+               (*it)->state_=FREE;
+               (*it)->forceFreedom();
+               (*it)->target_=originator;
+           }
+           i++;
+           if (i>=slaves_.size()/2) break; //half the formation should attack.
+       }
+    }     
+
+
+    /**
+      @brief Sets the new mode. If master, set it for all slaves.
+    */
+    void FormationController::setFormationMode(FormationMode val)
+    {
+        this->formationMode_ = val;
+        if (this->state_ == MASTER)
+        {
+            for(std::vector<FormationController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++)
+            {
+                 (*it)->formationMode_ = val;
+                 if (val == ATTACK)
+                     (*it)->forgetTarget();
+            }
+        }
+    }
+
+    /**
+        @brief Used to continue a "specific master action" for a certain time and resuming normal behaviour after.
+    */
+    void FormationController::specificMasterActionHold()
+    {
+        if(this->state_ != MASTER) return;
+
+        if (specificMasterActionHoldCount_ == 0)
+         {
+            this->specificMasterAction_ = NONE;
+            this->searchNewTarget();
+         }
+        else specificMasterActionHoldCount_--;
+    }
+
+    /**
+        @brief Master initializes a 180 degree turn. Leads to a "specific master action".
+    */
+    void FormationController::turn180Init()
+    {
+        if(this->state_ != MASTER) return;
+
+        Quaternion orient = this->getControllableEntity()->getOrientation();
+
+        this->setTargetPosition(this->getControllableEntity()->getPosition() + 1000.0f*orient*WorldEntity::BACK);
+
+        this->specificMasterActionHoldCount_ = 4;
+
+        this->specificMasterAction_ = TURN180;
+    }
+
+    /**
+        @brief Execute the 180 degree turn. Called within tick.
+    */
+    void FormationController::turn180()
+    {
+            Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, this->targetPosition_);
+
+            this->getControllableEntity()->rotateYaw(-2.0f * sgn(coord.x) * coord.x*coord.x);
+            this->getControllableEntity()->rotatePitch(2.0f * sgn(coord.y) * coord.y*coord.y);
+
+            this->getControllableEntity()->moveFrontBack(SPEED_MASTER);
+    }
+
+    /**
+        @brief Master initializes a spin around its looking direction axis. Leads to a "specific master action".
+    */
+    void FormationController::spinInit()
+    {
+        if(this->state_ != MASTER) return;
+        this->specificMasterAction_ = SPIN;
+        this->specificMasterActionHoldCount_ = 10;
+    }
+
+    /**
+        @brief Execute the spin. Called within tick.
+    */
+    void FormationController::spin()
+    {
+            this->moveToTargetPosition();
+            this->getControllableEntity()->rotateRoll(0.8f);
+    }
+
+  /**
+        @brief A human player gets followed by its nearest master. Initiated by console command, so far intended for demonstration puproses (possible future pickup).
+    */
+    void FormationController::followme()
+    {
+
+        Pawn *humanPawn = NULL;
+        NewHumanController *currentHumanController = NULL;
+        std::vector<FormationController*> allMasters;
+
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        {
+            Controller* controller = 0;
+
+            if (it->getController())
+                controller = it->getController();
+            else if (it->getXMLController())
+                controller = it->getXMLController();
+
+            if (!controller)
+                continue;
+
+            currentHumanController = orxonox_cast<NewHumanController*>(controller);
+
+            if(currentHumanController) humanPawn = *it;
+
+            FormationController *aiController = orxonox_cast<FormationController*>(controller);
+
+            if(aiController && aiController->state_ == MASTER)
+                allMasters.push_back(aiController);
+
+        }
+
+        if((humanPawn != NULL) && (allMasters.size() != 0))
+        {
+                float posHuman = humanPawn->getPosition().length();
+                float distance = 0.0f;
+                float minDistance = FLT_MAX;
+                int index = 0;
+                int i = 0;
+
+                for(std::vector<FormationController*>::iterator it = allMasters.begin(); it != allMasters.end(); it++, i++)
+                    {
+                        if (!FormationController::sameTeam((*it)->getControllableEntity(), humanPawn, (*it)->getGametype())) continue;
+                        distance = posHuman - (*it)->getControllableEntity()->getPosition().length();
+                        if(distance < minDistance) index = i;
+                    }
+                allMasters[index]->followInit(humanPawn);
+            }
+
+    }
+
+
+
+
+
+    /**
+        @brief Master begins to follow a pawn. Is a "specific master action".
+        @param pawn pawn to follow.
+        @param always follows pawn forever if true (false if omitted).
+        @param secondsToFollow seconds to follow the pawn if always is false. Will follow pawn 100 seconds if omitted (set in header).
+    */
+    void FormationController::followInit(Pawn* pawn, const bool always, const int secondsToFollow)
+    {
+        if (pawn == NULL || this->state_ != MASTER)
+            return;
+        this->specificMasterAction_  =  FOLLOW;
+
+        this->setTarget(pawn);
+        if (!always)
+            this->specificMasterActionHoldCount_ = secondsToFollow;
+        else
+            this->specificMasterActionHoldCount_ = INT_MAX; //for now...
+
+    }
+
+   /**
+        @brief Master begins to follow a randomly chosen human player of the same team. Is a "specific master action".
+    */
+    void FormationController::followRandomHumanInit()
+    {
+
+        Pawn *humanPawn = NULL;
+        NewHumanController *currentHumanController = NULL;
+
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        {
+            if (!it->getController())
+                continue;
+
+            currentHumanController = orxonox_cast<NewHumanController*>(it->getController());
+            if(currentHumanController)
+            {
+                if (!FormationController::sameTeam(this->getControllableEntity(), *it, this->getGametype())) continue;
+                humanPawn = *it;
+                break;
+            }
+        }
+
+        if((humanPawn != NULL))
+                this->followInit(humanPawn);
+    }
+
+
+  /**
+        @brief Master follows target with adjusted speed. Called within tick.
+    */
+    void FormationController::follow()
+    {
+        if (this->target_)
+            this->moveToPosition(this->target_->getPosition());
+        else
+            this->specificMasterActionHoldCount_ = 0;
+    }
+
+
+  void FormationController::setTargetPosition(const Vector3& target)
+    {
+        this->targetPosition_ = target;
+        this->bHasTargetPosition_ = true;
+    }
+
+    void FormationController::searchRandomTargetPosition()
+    {
+        this->targetPosition_ = Vector3(rnd(-2000,2000), rnd(-2000,2000), rnd(-2000,2000));
+        this->bHasTargetPosition_ = true;
+    }
+
+    void FormationController::setTargetOrientation(const Quaternion& orient)
+    {
+        this->targetOrientation_=orient;	
+        this->bHasTargetOrientation_=true;
+    }
+
+    void FormationController::setTargetOrientation(Pawn* target)
+    {
+        if (target)
+            setTargetOrientation(target->getOrientation());
+    }
+
+    void FormationController::setTarget(Pawn* target)
+    {
+        this->target_ = target;
+
+        if (target)
+            this->targetPosition_ = target->getPosition();
+    }
+
+    void FormationController::searchNewTarget()
+    {
+        if (!this->getControllableEntity())
+            return;
+
+        this->targetPosition_ = this->getControllableEntity()->getPosition();
+        this->forgetTarget();
+
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        {
+            if (FormationController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(*it), this->getGametype()))
+                continue;
+
+            /* So AI won't choose invisible Spaceships as target */
+            if (!it->getRadarVisibility())
+                continue;
+
+            if (static_cast<ControllableEntity*>(*it) != this->getControllableEntity())
+            {
+                float speed = this->getControllableEntity()->getVelocity().length();
+                Vector3 distanceCurrent = this->targetPosition_ - this->getControllableEntity()->getPosition();
+                Vector3 distanceNew = it->getPosition() - this->getControllableEntity()->getPosition();
+                if (!this->target_ || it->getPosition().squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceNew) / speed / distanceNew.length()) / math::twoPi)
+                        < this->targetPosition_.squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceCurrent) / speed / distanceCurrent.length()) / math::twoPi) + rnd(-250, 250))
+                {
+                    this->target_ = (*it);
+                    this->targetPosition_ = it->getPosition();
+                }
+            }
+        }
+    }
+
+  void FormationController::forgetTarget()
+    {
+        this->target_ = 0;
+        this->bShooting_ = false;
+    }
+
+   void FormationController::targetDied()
+    {
+        this->forgetTarget();
+        this->searchRandomTargetPosition();
+    }
+
+  bool FormationController::sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype)
+    {
+        if (entity1 == entity2)
+            return true;
+
+        int team1 = -1;
+        int team2 = -1;
+
+        Controller* controller = 0;
+        if (entity1->getController())
+            controller = entity1->getController();
+        else
+            controller = entity1->getXMLController();
+        if (controller)
+        {
+            FormationController* ac = orxonox_cast<FormationController*>(controller);
+            if (ac)
+                team1 = ac->getTeam();
+        }
+
+        if (entity2->getController())
+            controller = entity2->getController();
+        else
+            controller = entity2->getXMLController();
+        if (controller)
+        {
+            FormationController* ac = orxonox_cast<FormationController*>(controller);
+            if (ac)
+                team2 = ac->getTeam();
+        }
+
+        TeamDeathmatch* tdm = orxonox_cast<TeamDeathmatch*>(gametype);
+        if (tdm)
+        {
+            if (entity1->getPlayer())
+                team1 = tdm->getTeam(entity1->getPlayer());
+
+            if (entity2->getPlayer())
+                team2 = tdm->getTeam(entity2->getPlayer());
+        }
+
+        Mission* miss = orxonox_cast<Mission*>(gametype);
+        if (miss)
+        {
+            if (entity1->getPlayer())
+                team1 = miss->getTeam(entity1->getPlayer());
+
+            if (entity2->getPlayer())
+                team2 = miss->getTeam(entity2->getPlayer());
+        }
+
+        TeamBaseMatchBase* base = 0;
+        base = orxonox_cast<TeamBaseMatchBase*>(entity1);
+        if (base)
+        {
+            switch (base->getState())
+            {
+                case BaseState::ControlTeam1:
+                    team1 = 0;
+                    break;
+                case BaseState::ControlTeam2:
+                    team1 = 1;
+                    break;
+                case BaseState::Uncontrolled:
+                default:
+                    team1 = -1;
+            }
+        }
+        base = orxonox_cast<TeamBaseMatchBase*>(entity2);
+        if (base)
+        {
+            switch (base->getState())
+            {
+                case BaseState::ControlTeam1:
+                    team2 = 0;
+                    break;
+                case BaseState::ControlTeam2:
+                    team2 = 1;
+                    break;
+                case BaseState::Uncontrolled:
+                default:
+                    team2 = -1;
+            }
+        }
+
+        DroneController* droneController = 0;
+        droneController = orxonox_cast<DroneController*>(entity1->getController());
+        if (droneController && static_cast<ControllableEntity*>(droneController->getOwner()) == entity2)
+            return true;
+        droneController = orxonox_cast<DroneController*>(entity2->getController());
+        if (droneController && static_cast<ControllableEntity*>(droneController->getOwner()) == entity1)
+            return true;
+        DroneController* droneController1 = orxonox_cast<DroneController*>(entity1->getController());
+        DroneController* droneController2 = orxonox_cast<DroneController*>(entity2->getController());
+        if (droneController1 && droneController2 && droneController1->getOwner() == droneController2->getOwner())
+            return true;
+
+        Dynamicmatch* dynamic = orxonox_cast<Dynamicmatch*>(gametype);
+        if (dynamic)
+        {
+            if (dynamic->notEnoughPigs||dynamic->notEnoughKillers||dynamic->notEnoughChasers) {return false;}
+
+            if (entity1->getPlayer())
+                team1 = dynamic->getParty(entity1->getPlayer());
+
+            if (entity2->getPlayer())
+                team2 = dynamic->getParty(entity2->getPlayer());
+
+            if (team1 ==-1 ||team2 ==-1 ) {return false;}
+            else if (team1 == dynamic->chaser && team2 != dynamic->chaser) {return false;}
+            else if (team1 == dynamic->piggy && team2 == dynamic->chaser) {return false;}
+            else if (team1 == dynamic->killer && team2 == dynamic->chaser) {return false;}
+            else return true;
+        }
+
+        return (team1 == team2 && team1 != -1);
+    }
+
+    void FormationController::absoluteMoveToPosition(const Vector3& target)
+    {
+        float minDistance = 40.0f;
+        if (!this->getControllableEntity())
+            return;
+
+        Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
+        float distance = (target - this->getControllableEntity()->getPosition()).length();
+
+            if (this->target_ || distance > minDistance)
+            {
+                // Multiply with ROTATEFACTOR_FREE to make them a bit slower
+                this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x*coord.x);
+                this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y*coord.y);
+                this->getControllableEntity()->moveFrontBack(SPEED_FREE);
+            }
+
+
+        if (distance < minDistance)
+        {
+            this->positionReached();
+        }
+    }
+
+}

Copied: code/trunk/src/orxonox/controllers/FormationController.h (from rev 9015, code/branches/presentation2011/src/orxonox/controllers/FormationController.h)
===================================================================
--- code/trunk/src/orxonox/controllers/FormationController.h	                        (rev 0)
+++ code/trunk/src/orxonox/controllers/FormationController.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -0,0 +1,177 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _FormationController_h__
+#define _FormationController_h__
+
+#include "OrxonoxPrereqs.h"
+
+#include <vector>
+#include "core/Super.h"
+
+#include "util/Math.h"
+#include "core/OrxonoxClass.h"
+#include "controllers/Controller.h"
+#include "worldentities/ControllableEntity.h"
+
+
+namespace orxonox {
+
+  class _OrxonoxExport FormationController : public Controller
+  {
+
+      public:
+      FormationController(BaseObject* creator);
+
+      virtual ~FormationController();
+
+      virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+
+      static void formationflight(const bool form);
+      static void masteraction(const int action);
+      static void followme();
+      static void passivebehaviour(const bool passive);
+      static void formationsize(const int size);
+
+      inline void setFormationFlight(bool formation)
+           { this->formationFlight_ = formation; }
+      inline bool getFormationFlight() const
+           { return this->formationFlight_; }
+
+      inline void setFormationSize(int size)
+           { this->maxFormationSize_ = size; }
+      inline int getFormationSize() const
+           { return this->maxFormationSize_; }
+
+
+      inline void setPassive(bool passive)
+           { this->passive_ = passive; }
+      inline bool getPassive() const
+           { return this->passive_; }
+
+      inline void setTeam(int team)
+           { this->team_ = team; }
+      inline int getTeam() const
+           { return this->team_; }
+
+      /**
+        @brief Mode of the formation, behaviour of slaves
+               Normal-normal behaviour
+               Defend-just defend the master
+               Attack-leave formation, attack every target
+      */
+      enum FormationMode {NORMAL,DEFEND,ATTACK};
+
+      /**
+        @brief Sets the new mode. If master, set it for all slaves.
+      */
+      void setFormationMode(FormationMode val);
+      inline FormationMode getFormationMode() const
+           { return this->formationMode_; }
+
+    protected:
+      bool formationFlight_;
+      bool passive_;
+      int team_;
+      unsigned int maxFormationSize_;
+      int freedomCount_;
+      enum State {SLAVE, MASTER, FREE};
+
+      State state_;
+      std::vector<FormationController*> slaves_;
+      FormationController* myMaster_;
+
+      FormationMode formationMode_;
+
+      enum SpecificMasterAction {NONE, HOLD, SPIN, TURN180, FOLLOW};
+      SpecificMasterAction specificMasterAction_;
+      int specificMasterActionHoldCount_;
+      float speedCounter_; //for speed adjustment when following
+
+      void moveToPosition(const Vector3& target);
+      void moveToTargetPosition();
+      void absoluteMoveToPosition(const Vector3& target);
+      void copyOrientation(const Quaternion& orient);
+      void copyTargetOrientation();
+
+      void removeFromFormation();
+      void unregisterSlave();
+      void searchNewMaster();
+      void commandSlaves();
+      void setNewMasterWithinFormation();
+
+      void freeSlaves();
+      void forceFreeSlaves();
+      void loseMasterState();
+      void forceFreedom();
+      bool forcedFree();
+
+      void takeLeadOfFormation();
+      void masterAttacked(Pawn* originator);
+
+      void specificMasterActionHold();
+      void turn180Init();
+      void spinInit();
+      void spin();
+      void turn180();
+      void followInit(Pawn* pawn, const bool always = false, const int secondsToFollow = 100);
+      void followRandomHumanInit();
+      void follow();
+
+      void setTargetPosition(const Vector3& target);
+      void searchRandomTargetPosition();
+
+      void setTargetOrientation(const Quaternion& orient);
+      void setTargetOrientation(Pawn* target);
+
+      virtual void positionReached() {}
+
+      static bool sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype); // hack
+
+
+      void setTarget(Pawn* target);
+      void searchNewTarget();
+      void forgetTarget();
+
+      void targetDied();
+
+      bool bHasTargetPosition_;
+      Vector3 targetPosition_;
+      bool bHasTargetOrientation_;
+      Quaternion targetOrientation_;
+
+      WeakPtr<Pawn> target_;
+      bool bShooting_;
+  };
+
+
+}
+#endif /* _FormationController_h__ */
+
+

Modified: code/trunk/src/orxonox/controllers/HumanController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/HumanController.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/controllers/HumanController.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -49,6 +49,8 @@
     SetConsoleCommand("HumanController", "rotateYaw",              &HumanController::rotateYaw     ).addShortcut().setAsInputCommand();
     SetConsoleCommand("HumanController", "rotatePitch",            &HumanController::rotatePitch   ).addShortcut().setAsInputCommand();
     SetConsoleCommand("HumanController", "rotateRoll",             &HumanController::rotateRoll    ).addShortcut().setAsInputCommand();
+    SetConsoleCommand("HumanController", "toggleFormationFlight",  &HumanController::toggleFormationFlight).addShortcut().keybindMode(KeybindMode::OnPress);
+    SetConsoleCommand("HumanController", "FFChangeMode",  &HumanController::FFChangeMode).addShortcut().keybindMode(KeybindMode::OnPress);
     SetConsoleCommand("HumanController", __CC_fire_name,           &HumanController::fire          ).addShortcut().keybindMode(KeybindMode::OnHold);
     SetConsoleCommand("HumanController", "reload",                 &HumanController::reload        ).addShortcut();
     SetConsoleCommand("HumanController", __CC_boost_name,          &HumanController::keepBoost     ).addShortcut().keybindMode(KeybindMode::OnHold);
@@ -68,14 +70,13 @@
     HumanController* HumanController::localController_s = 0;
     /*static*/ const float HumanController::BOOSTING_TIME = 0.1f;
 
-    HumanController::HumanController(BaseObject* creator) : Controller(creator)
+    HumanController::HumanController(BaseObject* creator) : FormationController(creator)
     {
         RegisterObject(HumanController);
 
         this->controlPaused_ = false;
         this->boosting_ = false;
         this->boosting_ = false;
-
         HumanController::localController_s = this;
         this->boostingTimeout_.setTimer(HumanController::BOOSTING_TIME, false, createExecutor(createFunctor(&HumanController::terminateBoosting, this)));
         this->boostingTimeout_.stopTimer();
@@ -83,6 +84,10 @@
 
     HumanController::~HumanController()
     {
+        if (HumanController::localController_s) 
+        {
+            HumanController::localController_s->removeFromFormation();
+        }
         HumanController::localController_s = 0;
     }
 
@@ -94,6 +99,13 @@
             if (!camera)
                 orxout(internal_warning) << "HumanController, Warning: Using a ControllableEntity without Camera" << endl;
         }
+
+        // commandslaves when Master of a formation
+        if (HumanController::localController_s && HumanController::localController_s->state_==MASTER)
+        {
+            if (HumanController::localController_s->formationMode_ != ATTACK)
+                HumanController::localController_s->commandSlaves();
+        }
     }
 
     void HumanController::moveFrontBack(const Vector2& value)
@@ -159,7 +171,14 @@
     void HumanController::doFire(unsigned int firemode)
     {
         if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+        {
             HumanController::localController_s->controllableEntity_->fire(firemode);
+            //if human fires, set slaves free. See FormationController::forceFreeSlaves()
+            if (HumanController::localController_s->state_==MASTER && HumanController::localController_s->formationMode_ == NORMAL)
+            {
+                HumanController::localController_s->forceFreeSlaves();
+            }
+        }
     }
 
     void HumanController::reload()
@@ -194,8 +213,8 @@
         {
             this->boosting_ = true;
             this->boostingTimeout_.startTimer();
-            
-            this->controllableEntity_->boost(this->boosting_);
+            if(this->controllableEntity_)
+                this->controllableEntity_->boost(this->boosting_);
 //            orxout() << "Start boosting" << endl;
         }
     }
@@ -208,8 +227,8 @@
     {
         this->boosting_ = false;
         this->boostingTimeout_.stopTimer();
-
-        this->controllableEntity_->boost(this->boosting_);
+        if(this->controllableEntity_)
+            this->controllableEntity_->boost(this->boosting_);
 //        orxout() << "Stop boosting" << endl;
     }
 
@@ -261,6 +280,65 @@
         }
     }
 
+    /**
+    @brief
+       toggle the formation. Not usable, if formationflight is disabled generally (formationFlight_)
+    */
+    void HumanController::toggleFormationFlight()
+    {
+        if (HumanController::localController_s)
+        {
+            if (!HumanController::localController_s->formationFlight_)
+            {
+                return; //dont use when formationFlight is disabled
+            }
+            if (HumanController::localController_s->state_==MASTER)
+            {
+                HumanController::localController_s->loseMasterState();
+                orxout(message) <<"FormationFlight disabled "<< endl;
+            } else //SLAVE or FREE
+            {
+                HumanController::localController_s->takeLeadOfFormation();
+                orxout(message) <<"FormationFlight enabled "<< endl;
+            }
+            
+        }
+
+    }
+
+    /**
+    @brief
+       Switch through the different Modes of formationflight. You must be a master of a formation to use.
+    */
+    void HumanController::FFChangeMode()
+    {
+        if (HumanController::localController_s && HumanController::localController_s->state_==MASTER)
+        {
+            switch (HumanController::localController_s->getFormationMode()) {
+                case NORMAL:
+                    HumanController::localController_s->setFormationMode(DEFEND);
+                    orxout(message) <<"Mode: DEFEND "<< endl;
+                    break;
+                case DEFEND:
+                    HumanController::localController_s->setFormationMode(ATTACK);
+                    orxout(message) <<"Mode: ATTACK "<< endl;
+                    break;
+                case ATTACK:
+                    HumanController::localController_s->setFormationMode(NORMAL);
+                    orxout(message) <<"Mode: NORMAL "<< endl;
+                    break;
+            }
+        }
+    }
+
+
+    //used, when slaves are in DEFEND mode.
+    void HumanController::hit(Pawn* originator, btManifoldPoint& contactpoint, float damage)
+    {
+        if (!this->formationFlight_ || this->state_!=MASTER || this->formationMode_!=DEFEND) return;
+            this->masterAttacked(originator);
+    }
+
     void HumanController::addBots(unsigned int amount)
     {
         if (HumanController::localController_s && HumanController::localController_s->controllableEntity_ && HumanController::localController_s->controllableEntity_->getGametype())

Modified: code/trunk/src/orxonox/controllers/HumanController.h
===================================================================
--- code/trunk/src/orxonox/controllers/HumanController.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/controllers/HumanController.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -33,14 +33,14 @@
 
 #include "tools/Timer.h"
 #include "tools/interfaces/Tickable.h"
-#include "Controller.h"
+#include "FormationController.h"
 
 // tolua_begin
 namespace orxonox
 {
     class _OrxonoxExport HumanController
 // tolua_end
-        : public Controller, public Tickable
+        : public FormationController, public Tickable
     { // tolua_export
         public:
             HumanController(BaseObject* creator);
@@ -73,7 +73,8 @@
                 { return this->boosting_; }
             void keepBoosting(void);
             void terminateBoosting(void);
-            
+                  
+
             static void greet();
             static void switchCamera();
             static void mouseLook();
@@ -84,6 +85,11 @@
             static void toggleGodMode();
             static void myposition();
 
+            static void toggleFormationFlight();
+            static void FFChangeMode();
+            virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage);
+
+
             static void addBots(unsigned int amount);
             static void killBots(unsigned int amount = 0);
 

Modified: code/trunk/src/orxonox/controllers/NewHumanController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/NewHumanController.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/controllers/NewHumanController.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -290,12 +290,14 @@
             HumanController::pitch(Vector2(this->currentPitch_, 0));
         }
         else
-            HumanController::localController_s->getControllableEntity()->fire(firemode);
-
+            HumanController::doFire(firemode); //call for formationflight
     }
 
     void NewHumanController::hit(Pawn* originator, btManifoldPoint& contactpoint, float damage)
     {
+        //Used in HumanController for formationFlight
+        HumanController::hit(originator,contactpoint,damage);
+        
         if (this->showDamageOverlay_ && !this->controlPaused_ && this->controllableEntity_ && !this->controllableEntity_->isInMouseLook())
         {
             Vector3 posA;

Modified: code/trunk/src/orxonox/controllers/NewHumanController.h
===================================================================
--- code/trunk/src/orxonox/controllers/NewHumanController.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/controllers/NewHumanController.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -68,7 +68,10 @@
             virtual void doPauseControl();
             virtual void doResumeControl();
 
+            float getCurrentYaw(){ return this->currentYaw_; }
+            float getCurrentPitch(){ return this->currentPitch_; }
 
+
         protected:
             void updateTarget();
             void alignArrows();

Modified: code/trunk/src/orxonox/controllers/WaypointPatrolController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/WaypointPatrolController.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/controllers/WaypointPatrolController.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -41,7 +41,6 @@
     {
         RegisterObject(WaypointPatrolController);
 
-        //this->team_ = 0;
         this->alertnessradius_ = 500;
 
         this->patrolTimer_.setTimer(rnd(), true, createExecutor(createFunctor(&WaypointPatrolController::searchEnemy, this)));
@@ -52,7 +51,6 @@
         SUPER(WaypointPatrolController, XMLPort, xmlelement, mode);
 
         XMLPortParam(WaypointPatrolController, "alertnessradius", setAlertnessRadius, getAlertnessRadius, xmlelement, mode).defaultValues(500.0f);
-//        XMLPortParam(WaypointPatrolController, "team", setTeam, getTeam, xmlelement, mode).defaultValues(0);
     }
 
     void WaypointPatrolController::tick(float dt)

Modified: code/trunk/src/orxonox/controllers/WaypointPatrolController.h
===================================================================
--- code/trunk/src/orxonox/controllers/WaypointPatrolController.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/controllers/WaypointPatrolController.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -45,11 +45,6 @@
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             virtual void tick(float dt);
 
-           /* inline void setTeam(int team)
-                { this->team_ = team; }
-            inline int getTeam() const
-                { return this->team_; } */
-
             inline void setAlertnessRadius(float radius)
                 { this->alertnessradius_ = radius; }
             inline float getAlertnessRadius() const
@@ -58,7 +53,6 @@
         protected:
             void searchEnemy();
 
-            //int team_;
             float alertnessradius_;
             Timer patrolTimer_;
     };

Modified: code/trunk/src/orxonox/gametypes/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/gametypes/CMakeLists.txt	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/gametypes/CMakeLists.txt	2012-02-15 22:51:58 UTC (rev 9016)
@@ -8,4 +8,6 @@
   Dynamicmatch.cc
   LastManStanding.cc
   LastTeamStanding.cc
+  TeamGametype.cc
+  Mission.cc
 )

Modified: code/trunk/src/orxonox/gametypes/Gametype.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Gametype.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/gametypes/Gametype.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -122,7 +122,7 @@
 
         if (this->gtinfo_->isStartCountdownRunning() && !this->gtinfo_->hasStarted())
             this->gtinfo_->countdownStartCountdown(dt);
-
+			
         if (!this->gtinfo_->hasStarted())
         {
             for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
@@ -130,8 +130,9 @@
                 // Inform the GametypeInfo that the player is ready to spawn.
                 if(it->first->isHumanPlayer() && it->first->isReadyToSpawn())
                     this->gtinfo_->playerReadyToSpawn(it->first);
+                   
+                
             }
-                    
             this->checkStart();
         }
         else if (!this->gtinfo_->hasEnded())
@@ -142,11 +143,14 @@
 
     void Gametype::start()
     {
+         
         this->addBots(this->numberOfBots_);
 
         this->gtinfo_->start();
 
         this->spawnPlayersIfRequested();
+        
+        
     }
 
     void Gametype::end()
@@ -375,7 +379,7 @@
                 if (this->gtinfo_->getStartCountdown() <= 0.0f)
                 {
                     this->gtinfo_->stopStartCountdown();
-                    this->gtinfo_->setStartCountdown(0.0f);;
+                    this->gtinfo_->setStartCountdown(0.0f);
                     this->start();
                 }
             }
@@ -396,6 +400,7 @@
                         if (it->first->isHumanPlayer())
                             hashumanplayers = true;
                     }
+                         
                     if (allplayersready && hashumanplayers)
                     {
                         // If in developer's mode, there is no start countdown.
@@ -407,6 +412,7 @@
                     }
                 }
             }
+            
         }
     }
 
@@ -438,7 +444,7 @@
 
             if(player->isHumanPlayer())
                 this->gtinfo_->playerSpawned(player);
-            
+
             this->playerPostSpawn(player);
         }
         else

Modified: code/trunk/src/orxonox/gametypes/Gametype.h
===================================================================
--- code/trunk/src/orxonox/gametypes/Gametype.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/gametypes/Gametype.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -122,12 +122,9 @@
             inline const std::string& getHUDTemplate() const
                 { return this->gtinfo_->getHUDTemplate(); }
 
-            void addBots(unsigned int amount);
+            virtual void addBots(unsigned int amount);
             void killBots(unsigned int amount = 0);
 
-            inline unsigned int getNumberOfPlayers() const
-                { return this->players_.size(); }
-
             virtual void addTime(float t);
             virtual void removeTime(float t);
 
@@ -150,11 +147,15 @@
               { this->timeLimit_ = t; }
 
             //inline bool getForceSpawn()
-            //  { return this->bForceSpawn_; }       
+            //  { return this->bForceSpawn_; }
 
             virtual void resetTimer();
             virtual void resetTimer(float t);
+            inline unsigned int getNumberOfPlayers()
+              { return this->gtinfo_->getNumberOfPlayers(); }
 
+	
+
         protected:
             virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
 
@@ -191,6 +192,7 @@
             ConsoleCommand* dedicatedAddBots_;
             ConsoleCommand* dedicatedKillBots_;
             /* HACK HACK HACK */
+
     };
 }
 

Copied: code/trunk/src/orxonox/gametypes/Mission.cc (from rev 9015, code/branches/presentation2011/src/orxonox/gametypes/Mission.cc)
===================================================================
--- code/trunk/src/orxonox/gametypes/Mission.cc	                        (rev 0)
+++ code/trunk/src/orxonox/gametypes/Mission.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -0,0 +1,99 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Johannes Ritz
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "Mission.h"
+#include "items/Engine.h"
+#include "controllers/ArtificialController.h"
+
+#include "core/CoreIncludes.h"
+#include "network/Host.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(Mission);
+
+    Mission::Mission(BaseObject* creator) : TeamGametype(creator)
+    {
+        RegisterObject(Mission);
+        this->missionAccomplished_ = false;
+        this->lives_ = 10; // should be 1 as default value
+        this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
+    }
+
+    void Mission::tick(float dt)
+    {
+        SUPER(Mission, tick, dt);
+
+        if (missionAccomplished_)
+        {
+            this->gtinfo_->sendAnnounceMessage("Mission accomplished!");
+            this->end();
+        }
+    }
+
+    void Mission::pawnKilled(Pawn* victim, Pawn* killer)
+    {
+        if (victim && victim->getPlayer() && this->lives_ == 1)
+        {
+            this->missionAccomplished_ = false;
+	    this->end();
+        }
+    }
+
+    void Mission::start()
+    {
+        Gametype::start();
+        this->setTeams();
+
+        this->gtinfo_->sendAnnounceMessage("Your mission has started!");
+    }
+
+    void Mission::end()
+    {
+        Gametype::end();
+	/*if (this->missionAccomplished_) 
+            this->gtinfo_->sendAnnounceMessage("Mission accomplished!");
+	else
+            this->gtinfo_->sendAnnounceMessage("Mission failed!");
+	 * */
+    }
+
+    void Mission::setTeams()
+    {//Set pawn-colours
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
+        {
+            Pawn* pawn = static_cast<Pawn*>(*it);
+            if(!pawn) continue;
+                this->setDefaultObjectColour(pawn);
+        }
+    }
+
+
+
+}

Copied: code/trunk/src/orxonox/gametypes/Mission.h (from rev 9015, code/branches/presentation2011/src/orxonox/gametypes/Mission.h)
===================================================================
--- code/trunk/src/orxonox/gametypes/Mission.h	                        (rev 0)
+++ code/trunk/src/orxonox/gametypes/Mission.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -0,0 +1,64 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Johannes Ritz
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Mission_H__
+#define _Mission_H__
+
+#include "OrxonoxPrereqs.h"
+//#include "Gametype.h"
+#include "TeamGametype.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Mission : public TeamGametype
+    {
+        public:
+            Mission(BaseObject* creator);
+            virtual ~Mission() {}
+
+            virtual void tick(float dt);
+
+            virtual void start();
+            virtual void end();
+            virtual void setTeams();
+            virtual void addBots(unsigned int amount){} //<! overwrite function in order to bypass the addbots command
+            inline void setLives(unsigned int amount)
+                {this->lives_ = amount;}
+            inline unsigned int getLives()
+                {return this->lives_;}
+
+        protected:
+            virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
+            bool missionAccomplished_; //<! indicates if player successfully finsihed the mission;
+            int lives_; //<! amount of player's lives <-> nr. of retries
+
+    };
+}
+
+#endif /* _Mission_H__ */
+

Modified: code/trunk/src/orxonox/gametypes/TeamDeathmatch.h
===================================================================
--- code/trunk/src/orxonox/gametypes/TeamDeathmatch.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/gametypes/TeamDeathmatch.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -55,7 +55,6 @@
             virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn);
 
             int getTeam(PlayerInfo* player);
-
             inline const ColourValue& getTeamColour(int teamnr) const
                 { return this->teamcolours_[teamnr]; }
 

Copied: code/trunk/src/orxonox/gametypes/TeamGametype.cc (from rev 9015, code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.cc)
===================================================================
--- code/trunk/src/orxonox/gametypes/TeamGametype.cc	                        (rev 0)
+++ code/trunk/src/orxonox/gametypes/TeamGametype.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -0,0 +1,334 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Johannes Ritz
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "TeamGametype.h"
+
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "infos/PlayerInfo.h"
+#include "interfaces/TeamColourable.h"
+#include "worldentities/TeamSpawnPoint.h"
+#include "worldentities/pawns/Pawn.h"
+#include "worldentities/ControllableEntity.h"
+#include "controllers/ArtificialController.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(TeamGametype);
+
+    TeamGametype::TeamGametype(BaseObject* creator) : Gametype(creator)
+    {
+        RegisterObject(TeamGametype);
+
+        this->teams_ = 2; //most team gametypes use two different teams
+        this->allowFriendlyFire_ = false;
+        //this->playersPerTeam_ = 0;
+        this->maxPlayers_ = 0; //Value "0": no limit is set.
+        this->setConfigValues();
+    }
+
+    void TeamGametype::setConfigValues()
+    {
+        SetConfigValue(teams_, 2);
+
+        static ColourValue colours[] =
+        {
+            ColourValue(0.2f, 0.2f, 1.0f),
+            ColourValue(1.0f, 0.1f, 0.1f),
+            ColourValue(0.3f, 1.0f, 0.3f),
+            ColourValue(1.0f, 1.0f, 0.0f),
+            ColourValue(0.0f, 1.0f, 1.0f),
+            ColourValue(1.0f, 0.0f, 1.0f),
+            ColourValue(7.0f, 7.0f, 7.0f),
+            ColourValue(2.0f, 2.0f, 2.0f)
+        };
+        static std::vector<ColourValue> defaultcolours(colours, colours + sizeof(colours) / sizeof(ColourValue));
+
+        SetConfigValue(teamcolours_, defaultcolours);
+    }
+
+    void TeamGametype::playerEntered(PlayerInfo* player)
+    {
+        if(player == NULL) return; // catch null pointers
+        Gametype::playerEntered(player);
+        this->findAndSetTeam(player);
+        if( this->players_.size() <= maxPlayers_ || maxPlayers_  ==  0)
+        {
+            this->allowedInGame_[player]= true;
+        }
+        else
+        {
+            this->allowedInGame_[player]= false;
+            orxout() << "not allowed in game: players = " << this->players_.size() << " > maximum: " << maxPlayers_ << endl;
+        }
+    }
+
+    void TeamGametype::findAndSetTeam(PlayerInfo* player)
+    {
+        if(player == NULL) return; // catch null pointers
+        std::vector<unsigned int> playersperteam(this->teams_, 0);
+
+        for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
+            if (it->second < static_cast<int>(this->teams_) && it->second >= 0)
+                playersperteam[it->second]++;
+
+        unsigned int minplayers = static_cast<unsigned int>(-1);
+        size_t minplayersteam = 0;
+        for (size_t i = 0; i < this->teams_; ++i)
+        {
+            if (playersperteam[i] < minplayers)
+            {
+                minplayers = playersperteam[i];
+                minplayersteam = i;
+            }
+        }
+
+        this->teamnumbers_[player] = minplayersteam;
+
+    }
+
+    bool TeamGametype::playerLeft(PlayerInfo* player)
+    {
+        bool valid_player = Gametype::playerLeft(player);
+        if( (this->players_.size() >= maxPlayers_) && (allowedInGame_[player] == true) ) // if there's a "waiting list"
+        {
+            for (std::map<PlayerInfo*, bool>::iterator it = this->allowedInGame_.begin(); it != this->allowedInGame_.end(); ++it)
+            {
+                 if(it->second == false) // waiting player found
+                 {it->second = true; break;} // allow player to enter
+            }
+        }
+
+        if (valid_player)
+        {   // clean up the maps
+            this->teamnumbers_.erase(player);
+            this->allowedInGame_.erase(player);
+        }
+
+
+        return valid_player;
+    }
+
+    void TeamGametype::spawnDeadPlayersIfRequested()
+    {
+        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)\
+        {
+            if(allowedInGame_[it->first] == false)//check if dead player is allowed to enter
+            {
+                continue;
+            }
+            if (it->second.state_ == PlayerState::Dead)
+            {
+                if ((it->first->isReadyToSpawn() || this->bForceSpawn_))
+                {
+                   this->spawnPlayer(it->first);
+                }
+            }
+        }
+    }
+
+
+    bool TeamGametype::allowPawnHit(Pawn* victim, Pawn* originator)
+    {// hit allowed: if victim & originator are foes or if originator doesnot exist or if friendlyfire is allowed
+        return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator || this->allowFriendlyFire_);
+    }
+
+    bool TeamGametype::allowPawnDamage(Pawn* victim, Pawn* originator)
+    {
+        return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator || this->allowFriendlyFire_);
+    }
+
+    bool TeamGametype::allowPawnDeath(Pawn* victim, Pawn* originator)
+    {
+        return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator || this->allowFriendlyFire_);
+    }
+
+    SpawnPoint* TeamGametype::getBestSpawnPoint(PlayerInfo* player) const
+    {
+        int desiredTeamNr = -1;
+        std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
+        if (it_player != this->teamnumbers_.end())
+            desiredTeamNr = it_player->second;
+
+        // Only use spawnpoints of the own team (or non-team-spawnpoints)
+        std::set<SpawnPoint*> teamSpawnPoints = this->spawnpoints_;
+        for (std::set<SpawnPoint*>::iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); )
+        {
+            if ((*it)->isA(Class(TeamSpawnPoint)))
+            {
+                TeamSpawnPoint* tsp = orxonox_cast<TeamSpawnPoint*>(*it);
+                if (tsp && static_cast<int>(tsp->getTeamNumber()) != desiredTeamNr)
+                {
+                    teamSpawnPoints.erase(it++);
+                    continue;
+                }
+            }
+
+            ++it;
+        }
+
+        SpawnPoint* fallbackSpawnPoint = NULL;
+        if (teamSpawnPoints.size() > 0)
+        {
+            unsigned int randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(teamSpawnPoints.size())));
+            unsigned int index = 0;
+            // Get random fallback spawnpoint in case there is no active SpawnPoint.
+            for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); ++it)
+            {
+                if (index == randomspawn)
+                {
+                    fallbackSpawnPoint = (*it);
+                    break;
+                }
+
+                ++index;
+            }
+
+            // Remove all inactive SpawnPoints from the list.
+            for (std::set<SpawnPoint*>::iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); )
+            {
+                if(!(*it)->isActive())
+                {
+                    teamSpawnPoints.erase(it++);
+                    continue;
+                }
+
+                ++it;
+            }
+
+            randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(teamSpawnPoints.size())));
+            index = 0;
+            for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); ++it)
+            {
+                if (index == randomspawn)
+                    return (*it);
+
+                ++index;
+            }
+
+            return fallbackSpawnPoint;
+        }
+
+        return 0;
+    }
+
+    void TeamGametype::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn)
+    {
+        if (!player)
+            return;
+
+        this->setTeamColour(player,pawn);
+    }
+
+    bool TeamGametype::pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2)
+    {
+        if (pawn1 && pawn2)
+        {
+            std::map<PlayerInfo*, int>::const_iterator it1 = this->teamnumbers_.find(pawn1->getPlayer());
+            std::map<PlayerInfo*, int>::const_iterator it2 = this->teamnumbers_.find(pawn2->getPlayer());
+
+            if (it1 != this->teamnumbers_.end() && it2 != this->teamnumbers_.end())
+                return (it1->second == it2->second);
+        }
+        return false;
+    }
+
+    int TeamGametype::getTeam(PlayerInfo* player)
+    {
+        std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
+        if (it_player != this->teamnumbers_.end())
+            return it_player->second;
+        else
+            return -1;
+    }
+
+    void TeamGametype::setTeamColour(PlayerInfo* player, Pawn* pawn)
+    {
+        // Set the team colour
+        std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
+        if (it_player != this->teamnumbers_.end() && it_player->second >= 0 && it_player->second < static_cast<int>(this->teamcolours_.size()))
+        {
+            this->colourPawn(pawn, it_player->second);
+        }
+    }
+
+    /**
+    @brief
+        Colours a pawn depending on the team values set in XML.
+        A pawn is coloured depending on it's team set via XML.
+        If there is a controller the pawn is coloured depending on its team which also can be set via XML.
+    */
+    void TeamGametype::setDefaultObjectColour(Pawn* pawn)
+    {
+        if(pawn == NULL)
+            return;
+
+        int teamnumber = pawn->getTeam();
+
+        if(teamnumber >= 0)
+        {
+            this->colourPawn(pawn, teamnumber); return;
+        }
+        //get Pawn's controller
+        ControllableEntity* entity = orxonox_cast<ControllableEntity*>(pawn);
+
+        Controller* controller = 0;
+        if (entity->getController())
+            controller = entity->getController();
+        else if (entity->getXMLController())
+            controller = entity->getXMLController();
+        else
+            return;
+
+        ArtificialController* artificial =  orxonox_cast<ArtificialController*>(controller);
+        //get Teamnumber - get the data
+        if(artificial == NULL)
+            return;
+        teamnumber= artificial->getTeam();
+
+        //set ObjectColour
+        this->colourPawn(pawn, teamnumber);
+    }
+
+    void TeamGametype::colourPawn(Pawn* pawn, int teamNr)
+    {// catch: no-colouring-case and wrong input
+        if(teamNr < 0 || teamNr+1 > this->teamcolours_.size() ||pawn == NULL) return;
+        pawn->setRadarObjectColour(this->teamcolours_[teamNr]);
+
+        std::set<WorldEntity*> pawnAttachments = pawn->getAttachedObjects();
+        for (std::set<WorldEntity*>::iterator it = pawnAttachments.begin(); it != pawnAttachments.end(); ++it)
+        {
+            if ((*it)->isA(Class(TeamColourable)))
+            {
+                TeamColourable* tc = orxonox_cast<TeamColourable*>(*it);
+                tc->setTeamColour(this->teamcolours_[teamNr]);
+            }
+         }
+    }
+
+}

Copied: code/trunk/src/orxonox/gametypes/TeamGametype.h (from rev 9015, code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.h)
===================================================================
--- code/trunk/src/orxonox/gametypes/TeamGametype.h	                        (rev 0)
+++ code/trunk/src/orxonox/gametypes/TeamGametype.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -0,0 +1,82 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Johannes Ritz
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _TeamGametype_H__
+#define _TeamGametype_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <map>
+#include <vector>
+#include "Gametype.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport TeamGametype : public Gametype
+    {
+        public:
+            TeamGametype(BaseObject* creator);
+            virtual ~TeamGametype() {}
+
+            void setConfigValues();
+
+            virtual void playerEntered(PlayerInfo* player);
+            virtual void findAndSetTeam(PlayerInfo* player);
+            virtual bool playerLeft(PlayerInfo* player);
+            virtual void spawnDeadPlayersIfRequested(); //!< Prevents players to respawn.
+
+            virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0);
+            virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0);
+            virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0);
+
+            virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn);
+
+
+            int getTeam(PlayerInfo* player);
+
+            inline const ColourValue& getTeamColour(int teamnr) const
+                { return this->teamcolours_[teamnr]; }
+
+        protected:
+            virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
+            bool pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2);
+
+            bool allowFriendlyFire_; //!< friendlyfire is per default switched off: friendlyFire_ = false;
+            std::map<PlayerInfo*, int> teamnumbers_;
+            std::vector<ColourValue> teamcolours_;
+            unsigned int teams_; //!< Number  of teams. Value 0 : no teams!
+            //unsigned int playersPerTeam_; //!< Defines Maximum for players per team. Value 0: no maximum!
+            unsigned int maxPlayers_; //!< Defines Maximum for number of players. Value 0 : no maximum!
+            std::map<PlayerInfo*, bool> allowedInGame_; //!< Only those players are allowed to spawn which are listed here as 'true'.
+            void setTeamColour(PlayerInfo* player, Pawn* pawn);
+            void setDefaultObjectColour(Pawn* pawn);
+            void colourPawn(Pawn* pawn, int teamNr);
+    };
+}
+
+#endif /* _TeamGametype_H__ */

Modified: code/trunk/src/orxonox/gametypes/UnderAttack.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/UnderAttack.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/gametypes/UnderAttack.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -48,8 +48,8 @@
         this->destroyer_.setCallback(createFunctor(&UnderAttack::killedDestroyer, this));
         this->gameEnded_ = false;
 
-        this->setHUDTemplate("UnderAttackHUD");
-
+        //this->setHUDTemplate("UnderAttackHUD"); 
+        //This HUD is in conflict with the HUDEnemyHealthBar
         this->setConfigValues();
         this->timesequence_ = static_cast<int>(this->gameTime_);
     }

Modified: code/trunk/src/orxonox/infos/GametypeInfo.cc
===================================================================
--- code/trunk/src/orxonox/infos/GametypeInfo.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/infos/GametypeInfo.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -70,9 +70,9 @@
         
         this->bStarted_ = false;
         this->bEnded_ = false;
-        this->startCountdown_ = 0.0f;
+        this->startCountdown_ = 10.0f;
         this->bStartCountdownRunning_ = false;
-        this->counter_ = 0;
+        this->counter_ = 10;
         this->spawned_ = false;
         this->readyToSpawn_ = false;
 
@@ -163,10 +163,12 @@
     void GametypeInfo::start(void)
     {
         if(this->bStarted_)
-            return;
+           { return;}
         
         this->bStarted_ = true;
         this->changedStarted();
+        
+       
     }
 
     /**

Modified: code/trunk/src/orxonox/infos/GametypeInfo.h
===================================================================
--- code/trunk/src/orxonox/infos/GametypeInfo.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/infos/GametypeInfo.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -118,6 +118,9 @@
 
             inline const std::string& getHUDTemplate() const
                 { return this->hudtemplate_; }
+            
+            inline unsigned int getNumberOfPlayers() const
+                {  return this->spawnedPlayers_.size(); }
 
             void sendAnnounceMessage(const std::string& message);
             void sendAnnounceMessage(const std::string& message, unsigned int clientID);

Modified: code/trunk/src/orxonox/infos/PlayerInfo.cc
===================================================================
--- code/trunk/src/orxonox/infos/PlayerInfo.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/infos/PlayerInfo.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -35,6 +35,7 @@
 #include "gametypes/Gametype.h"
 #include "worldentities/ControllableEntity.h"
 #include "controllers/Controller.h"
+#include "worldentities/pawns/SpaceShip.h"
 
 namespace orxonox
 {
@@ -56,6 +57,7 @@
         this->updateGametypeInfo();
 
         this->registerVariables();
+        
     }
 
     PlayerInfo::~PlayerInfo()
@@ -169,6 +171,11 @@
         }
 
         this->changedControllableEntity();
+		SpaceShip* spaceship = dynamic_cast<SpaceShip*>(entity);
+        if (spaceship != NULL)
+        {
+            spaceship->setRVName(this->getName());
+        }
     }
 
     void PlayerInfo::startTemporaryControl(ControllableEntity* entity)

Modified: code/trunk/src/orxonox/interfaces/RadarViewable.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/RadarViewable.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/interfaces/RadarViewable.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -50,6 +50,7 @@
         , radarObjectShape_(Dot)
         , radarObjectDescription_("staticObject")
         , scale_(1.0f)
+		, RVName("")
     {
         RegisterRootObject(RadarViewable);
 

Modified: code/trunk/src/orxonox/interfaces/RadarViewable.h
===================================================================
--- code/trunk/src/orxonox/interfaces/RadarViewable.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/interfaces/RadarViewable.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -60,6 +60,17 @@
         RadarViewable(BaseObject* creator, const WorldEntity* wePtr);
         virtual ~RadarViewable();
 
+		virtual void setRVName(std::string name)
+			{
+				if (this->RVName != name)
+				{
+					this->RVName = name;
+					this->settingsChanged();
+				}
+			}
+		std::string getRVName() const
+			{ return this->RVName; }
+
         inline void setRadarObjectCamouflage(float camouflage)
             {
                 if( this->radarObjectCamouflage_ != camouflage )
@@ -151,6 +162,7 @@
         std::string radarObjectDescription_;
         ColourValue radarObjectColour_;
         float scale_;
+		std::string RVName;
     };
 }
 

Modified: code/trunk/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/ControllableEntity.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/worldentities/ControllableEntity.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -73,7 +73,6 @@
         this->currentCameraPosition_ = 0;
         this->bMouseLook_ = false;
         this->mouseLookSpeed_ = 200;
-        this->bIsRocket_ = false;
 
         this->server_position_         = Vector3::ZERO;
         this->client_position_         = Vector3::ZERO;
@@ -87,6 +86,7 @@
         this->setConfigValues();
         this->setPriority( Priority::VeryHigh );
         this->registerVariables();
+	this->team_ = -1;
     }
 
     ControllableEntity::~ControllableEntity()
@@ -119,6 +119,7 @@
     {
         SUPER(ControllableEntity, XMLPort, xmlelement, mode);
 
+        XMLPortParam(ControllableEntity, "team", setTeam, getTeam, xmlelement, mode).defaultValues(-1);
         XMLPortParam(ControllableEntity, "hudtemplate", setHudTemplate, getHudTemplate, xmlelement, mode);
         XMLPortParam(ControllableEntity, "camerapositiontemplate", setCameraPositionTemplate, getCameraPositionTemplate, xmlelement, mode);
 

Modified: code/trunk/src/orxonox/worldentities/ControllableEntity.h
===================================================================
--- code/trunk/src/orxonox/worldentities/ControllableEntity.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/worldentities/ControllableEntity.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -162,9 +162,12 @@
             virtual WorldEntity* getTarget()
                 { return this->target_.get(); }
             void setTargetInternal( uint32_t targetID );
-            inline bool getRocket() const
-                { return this-> bIsRocket_; }
 
+	    inline void setTeam(int team)
+	        { this->team_ = team; }
+	    inline float getTeam() const
+	        { return this->team_; }
+
         protected:
             virtual void preDestroy();
 
@@ -182,7 +185,6 @@
             void destroyHud(void);
 
             Ogre::SceneNode* cameraPositionRootNode_;
-            bool bIsRocket_; //Workaround to see, if the controllable entity is a Rocket.
 
         private:
             void registerVariables();
@@ -239,6 +241,8 @@
             WeakPtr<Controller> controller_;
             CameraPosition* reverseCamera_;
             WeakPtr<WorldEntity> target_;
+
+	    int team_ ; //<! teamnumber
     };
 }
 

Modified: code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -269,7 +269,7 @@
     {
     }
 
-    void FpsPlayer::boost() //acctually jump
+    void FpsPlayer::boost(bool bBoost) //acctually jump
     {
         if (this->isFloor_)
         {

Modified: code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.h
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -64,7 +64,7 @@
             inline const std::string& getMeshSource() const
                 { return this->meshSrc_; }
 
-            void boost(); //acctually jump
+            void boost(bool bBoost); //acctually jump
 
             virtual void fire();
 

Modified: code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.cc	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.cc	2012-02-15 22:51:58 UTC (rev 9016)
@@ -128,6 +128,8 @@
 
         XMLPortParam(Pawn, "reloadrate", setReloadRate, getReloadRate, xmlelement, mode).defaultValues(0);
         XMLPortParam(Pawn, "reloadwaittime", setReloadWaitTime, getReloadWaitTime, xmlelement, mode).defaultValues(1.0f);
+   
+        XMLPortParam ( RadarViewable, "RVName", setRVName, getRVName, xmlelement, mode );
     }
 
     void Pawn::registerVariables()
@@ -454,7 +456,7 @@
     {
         SUPER(Pawn, changedActivity);
 
-        this->setRadarVisibility(this->isActive());
+        this->setRadarVisibility(this->isVisible());
     }
 
     void Pawn::changedVisibility(void)

Modified: code/trunk/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.h	2012-02-12 17:24:32 UTC (rev 9015)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.h	2012-02-15 22:51:58 UTC (rev 9016)
@@ -53,6 +53,7 @@
             inline bool isAlive() const
                 { return this->bAlive_; }
 
+
             virtual void setHealth(float health);
             inline void addHealth(float health)
                 { this->setHealth(this->health_ + health); }
@@ -193,6 +194,7 @@
             virtual PickupCarrier* getCarrierParent(void) const
                 { return NULL; }
 
+
             float health_;
             float maxHealth_;
             float initialHealth_;




More information about the Orxonox-commit mailing list