[Orxonox-commit 7575] r12180 - in code/branches/Merge_HS18: . data/gui/layouts data/gui/scripts data/levels data/levels/templates data/overlays src/modules/flappyorx src/modules/towerdefense src/orxonox/controllers src/orxonox/gametypes

merholzl at orxonox.net merholzl at orxonox.net
Tue Dec 11 14:52:30 CET 2018


Author: merholzl
Date: 2018-12-11 14:52:30 +0100 (Tue, 11 Dec 2018)
New Revision: 12180

Added:
   code/branches/Merge_HS18/data/levels/MapExample.oxw
   code/branches/Merge_HS18/data/levels/emptyLevel22.oxw
   code/branches/Merge_HS18/data/levels/templates/MapExample.oxt
   code/branches/Merge_HS18/data/overlays/MapExampleHUD.oxo
   code/branches/Merge_HS18/src/orxonox/controllers/SMCoord.cc
   code/branches/Merge_HS18/src/orxonox/controllers/SMCoord.h
   code/branches/Merge_HS18/src/orxonox/controllers/StoryModeController.cc
   code/branches/Merge_HS18/src/orxonox/controllers/StoryModeController.h
   code/branches/Merge_HS18/svn-commit.tmp
Modified:
   code/branches/Merge_HS18/
   code/branches/Merge_HS18/data/gui/layouts/CampaignMenu.layout
   code/branches/Merge_HS18/data/gui/scripts/CampaignMenu.lua
   code/branches/Merge_HS18/data/levels/StoryModeMap.oxw
   code/branches/Merge_HS18/data/levels/templates/StoryMode.oxt
   code/branches/Merge_HS18/data/levels/templates/StoryModeEscort.oxt
   code/branches/Merge_HS18/data/overlays/StoryModeHUD.oxo
   code/branches/Merge_HS18/src/modules/flappyorx/FlappyOrxShip.cc
   code/branches/Merge_HS18/src/modules/towerdefense/TowerDefense.cc
   code/branches/Merge_HS18/src/modules/towerdefense/TowerDefenseSelecter.cc
   code/branches/Merge_HS18/src/orxonox/controllers/CMakeLists.txt
   code/branches/Merge_HS18/src/orxonox/gametypes/StoryMode.cc
Log:
World Map merging

Index: code/branches/Merge_HS18
===================================================================
--- code/branches/Merge_HS18	2018-12-11 13:21:47 UTC (rev 12179)
+++ code/branches/Merge_HS18	2018-12-11 13:52:30 UTC (rev 12180)

Property changes on: code/branches/Merge_HS18
___________________________________________________________________
Modified: svn:mergeinfo
## -29,6 +29,7 ##
 /code/branches/SuperOrxoBros_FS18:11820-12030
 /code/branches/TixyTaxyTorxy_HS18:12039-12178
 /code/branches/Waypoints_HS17:11496-11773
+/code/branches/WorldMap_HS18:12036-12179
 /code/branches/ai:6592-7033
 /code/branches/ai2:8721-8880
 /code/branches/bigships:8137-8588
Modified: code/branches/Merge_HS18/data/gui/layouts/CampaignMenu.layout
===================================================================
--- code/branches/Merge_HS18/data/gui/layouts/CampaignMenu.layout	2018-12-11 13:21:47 UTC (rev 12179)
+++ code/branches/Merge_HS18/data/gui/layouts/CampaignMenu.layout	2018-12-11 13:52:30 UTC (rev 12180)
@@ -6,6 +6,10 @@
         <Property name="MaxSize" value="{{1,0},{1,0}}" />
         <Property name="Area" value="{{0,0},{0,0},{1.0,0},{1.0,0}}" />
         <Property name="BackgroundEnabled" value="False" />
+              
+
+        
+
         <Window name="Mission1Text" type="MenuWidgets/Button">
             <Property name="Text" value="Mission One" />
             <Property name="Visible" value="False" />
@@ -12,6 +16,7 @@
             <Property name="Area" value="{{0.1,0},{0.6,0},{0.3,0},{0.65,0}}" />
             <Event function="CampaignMenu.Mission1Button_clicked" name="Clicked" />
         </Window>
+
         <Window name="Mission1Button" type="MenuWidgets/JuuButton">
             <Property name="Visible" value="False" />
             <Property name="MaxSize" value="{{1,0},{1,0}}" />
@@ -18,20 +23,23 @@
             <Property name="Area" value="{{0.1,0},{0.75,0},{0.25,0},{0.95,0}}" />
             <Event function="CampaignMenu.Mission1Button_clicked" name="Clicked" />
         </Window>
+
         <Window name="Mission2Text" type="MenuWidgets/Button">
             <Property name="Text" value="Fight in our Back" />
-            <Property name="Visible" value="False" />
+            <Property name="Visible" value="True" />
             <Property name="Area" value="{{0.35,0},{0.6,0},{0.55,0},{0.65,0}}" />
             <Property name="Disabled" value="True" />
             <Event function="CampaignMenu.Mission2Button_clicked" name="Clicked" />
         </Window>
+        
         <Window name="Mission2Button" type="MenuWidgets/JuuButton">
-            <Property name="Visible" value="False" />
+            <Property name="Visible" value="True" />
             <Property name="MaxSize" value="{{1,0},{1,0}}" />
             <Property name="Area" value="{{0.4,0},{0.7,0},{0.5,0},{0.85,0}}" />
             <Property name="Disabled" value="True" />
             <Event function="CampaignMenu.Mission2Button_clicked" name="Clicked" />
         </Window>
+
         <Window name="Mission3Text" type="MenuWidgets/Button">
             <Property name="Text" value="Pirate Attack" />
             <Property name="Visible" value="False" />
@@ -46,6 +54,7 @@
             <Property name="Disabled" value="True" />
             <Event function="CampaignMenu.Mission3Button_clicked" name="Clicked" />
         </Window>
+
         <Window name="Mission4Text" type="MenuWidgets/Button">
             <Property name="Text" value="Trip to Area 51" />
             <Property name="Visible" value="False" />
@@ -60,6 +69,7 @@
             <Property name="Disabled" value="True" />
             <Event function="CampaignMenu.Mission4Button_clicked" name="Clicked" />
         </Window>
+
         <Window name="Mission5Text" type="MenuWidgets/Button">
             <Property name="Text" value="Area 51 under Fire" />
             <Property name="Visible" value="False" />
@@ -74,6 +84,7 @@
             <Property name="Disabled" value="True" />
             <Event function="CampaignMenu.Mission5Button_clicked" name="Clicked" />
         </Window>
+
         <Window name="Mission6Text" type="MenuWidgets/Button">
             <Property name="Text" value="Escape the Bastards" />
             <Property name="Visible" value="False" />
@@ -84,8 +95,10 @@
         <Window name="Mission6Button" type="MenuWidgets/JuuButton">
             <Property name="Visible" value="False" />
             <Property name="MaxSize" value="{{1,0},{1,0}}" />
+            
             <Property name="Area" value="{{0.6,0},{0.17,0},{0.65,0},{0.27,0}}" />
-            <Property name="Disabled" value="True" />
+            
+            <Property name="Disabled" value="True" /> 
             <Event function="CampaignMenu.Mission6Button_clicked" name="Clicked" />
         </Window>
         <Window name="Mission7Text" type="MenuWidgets/Button">
@@ -95,6 +108,7 @@
             <Event function="CampaignMenu.Mission7Button_clicked" name="Clicked" />
             <Property name="Area" value="{{0.4,0},{0.025,0},{0.6,0},{0.075,0}}" />
         </Window>
+
         <Window name="Mission7Button" type="MenuWidgets/JuuButton">
             <Property name="Visible" value="False" />
             <Property name="MaxSize" value="{{1,0},{1,0}}" />
@@ -116,6 +130,7 @@
             <Property name="Disabled" value="True" />
             <Event function="CampaignMenu.Mission8Button_clicked" name="Clicked" />
         </Window>
+
         <Window name="Mission9Text" type="MenuWidgets/Button">
             <Property name="Text" value="Retaliation" />
             <Property name="Visible" value="False" />
@@ -130,6 +145,7 @@
             <Property name="Disabled" value="True" />
             <Event function="CampaignMenu.Mission9Button_clicked" name="Clicked" />
         </Window>
+
         <Window name="CampaignMenuBackButton" type="MenuWidgets/Button">
             <Property name="Text" value="Back" />
             <Property name="MaxSize" value="{{1,0},{1,0}}" />
@@ -136,6 +152,8 @@
             <Property name="Area" value="{{0.75,0},{0.9,0},{0.95,0},{0.95,0}}" />
             <Event function="CampaignMenu.CampaignMenuBackButton_clicked" name="Clicked" />
         </Window>
+
+
         <Window name="CampaignMenuCongratulation" type="MenuWidgets/StaticText">
             <Property name="Text" value="Campaign Completed!!!" />
             <Property name="Visible" value="False" />
@@ -145,5 +163,6 @@
             <Property name="MaxSize" value="{{2,1},{2,1}}" />
             <Property name="Area" value="{{0.4,0},{0.15,0},{0.6,0},{0.2,0}}" />
         </Window>
+        
     </Window>
 </GUILayout>
\ No newline at end of file

Modified: code/branches/Merge_HS18/data/gui/scripts/CampaignMenu.lua
===================================================================
--- code/branches/Merge_HS18/data/gui/scripts/CampaignMenu.lua	2018-12-11 13:21:47 UTC (rev 12179)
+++ code/branches/Merge_HS18/data/gui/scripts/CampaignMenu.lua	2018-12-11 13:52:30 UTC (rev 12180)
@@ -2,6 +2,7 @@
 
 local P = createMenuSheet("CampaignMenu")
 
+
 function P:onShow()
     P:updateButtons()
 end
@@ -32,11 +33,13 @@
         label:setProperty("Visible","True")
     end
 end
-
+--Updated Buttons der levels
 function P.updateButton(index, button)
+    --Wenn genuegend Levels vorhanden sind, wird der Butten angezeigt
     if (P.shouldDisplayButton(index)) then
         button:setProperty("Visible", "True")
 
+        --wenn genuegend levels bestanden sind, wird er benutzbar
         if (P.shouldEnableButton(index)) then
             button:setProperty("Disabled", "False")
         end
@@ -43,6 +46,10 @@
     end
 end
 
+function P.Test(e)
+     orxonox.execute("startMainMenu")
+end
+
 function P.shouldDisplayButton(index)
     local size = orxonox.LevelManager:getInstance():getNumberOfCampaignMissions()
     return index < size
@@ -68,9 +75,15 @@
     return -1
 end
 
+
+
+
 function P.Mission1Button_clicked(e)
     P.loadLevel(P.FindLevel(0))
 end
+function P.KeyPressed(e)
+    P.loadLevel(P.FindLevel(0))
+end
 
 function P.Mission2Button_clicked(e)
     P.loadLevel(P.FindLevel(1))
@@ -109,6 +122,11 @@
     hideAllMenuSheets()
 end
 
+function P.loadMap()
+    orxonox.execute("changeGame  dynamicMatch.oxw")
+     hideAllMenuSheets()
+end
+
 function P.FindLevel(index)
     local filename = orxonox.LevelManager:getInstance():getCampaignMission(index)
     local level = nil

Copied: code/branches/Merge_HS18/data/levels/MapExample.oxw (from rev 12179, code/branches/WorldMap_HS18/data/levels/MapExample.oxw)
===================================================================
--- code/branches/Merge_HS18/data/levels/MapExample.oxw	                        (rev 0)
+++ code/branches/Merge_HS18/data/levels/MapExample.oxw	2018-12-11 13:52:30 UTC (rev 12180)
@@ -0,0 +1,62 @@
+
+
+<LevelInfo
+ name = "MapExample"
+ description = "Shows a little map that should be understandable. Choose your level with right/left/space"
+ screenshot = "emptylevel.png"
+/>
+<!-- Some stuff which is needed to work -->
+<?lua
+  
+  include("templates/lodInformation.oxt")
+  include("templates/spaceshipAssff.oxt")
+  include("MapExampleHUD.oxo") 
+  include("stats.oxo")  
+  include("templates/MapExample.oxt")
+  
+?>
+<Level
+gametype = StoryMode
+>
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+  <Scene
+    ambientlight = "0.2, 0.2, 0.2"
+    skybox       = "Orxonox/Starbox"
+  >
+    <!-- Here we initiate the Storymodecontroller which basically keeps track at which game we want to look at at the moment. 
+    The Controller has a model attached which is set to invisible, but it's needed as an anchor. We set the cameraposition inhere too. -->
+    <StoryModeController position="0,0,0" collisionType="dynamic" mass=42000000 >
+      <attached>
+        <Model position="0,0,0" mesh="assff.mesh" scale=20  visible="false" />
+      </attached>
+      <CameraPosition position="0,0,0" direction="0, -1, 0" drag=false />
+      <collisionShapes>
+        <BoxCollisionShape position="0,0,0" halfExtents="3,1,10" />
+      </collisionShapes>
+    </StoryModeController>
+    <!-- Creates a few static entitys. Theire position will be important. Maybe you want to note them when you plan your own map. -->
+    <StaticEntity position="550,300,0" direction="0,0,-1" >
+      <attached>
+        <!-- Model 1: Will be linked to the model Map -->
+        <Billboard colour="1,0,0.05" position="0,0,0"  material="Flares/lensflare" scale=0.5 />
+        <Model position="0,0,20" mesh="ETH.mesh" scale=10  visible="true" lookat="550,300,21"/>
+        <!-- Model 2: linked to pong -->
+        <Billboard colour="1,1,0.05" position="50,0,0"  material="Flares/lensflare" scale=0.5 />
+        <Model position="50,0,20" mesh="PacmanGelb.mesh" scale=10  visible="true" lookat="100,0,20" />
+        <!-- Model 3: linked to Towerdefense -->
+        <Billboard colour="0,1,0.05" position="100,0,0"  material="Flares/lensflare" scale=0.5 />
+        <Model position="100,0,20"  lookat = "100,50,20" mesh="Tower.mesh" scale=10  visible="true" />
+        <!-- Model 4: linked to Orxobrows -->
+        <Billboard colour="1,1,1" position="150,0,0"  material="Flares/lensflare" scale=0.5 />
+        <Model position="150,0,20" mesh="orxo.mesh" scale=5 lookat="150,0,-120"  visible="true" />
+      </attached>
+    </StaticEntity>
+    <!-- some Stuff which is needed to work -->
+    <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 position="000.000, 000.000, 1000.000" orientation="0, 0, 0, 1" spawnclass=StoryModeController pawndesign=MapExample />
+  </Scene>
+</Level>
+

Modified: code/branches/Merge_HS18/data/levels/StoryModeMap.oxw
===================================================================
--- code/branches/Merge_HS18/data/levels/StoryModeMap.oxw	2018-12-11 13:21:47 UTC (rev 12179)
+++ code/branches/Merge_HS18/data/levels/StoryModeMap.oxw	2018-12-11 13:52:30 UTC (rev 12180)
@@ -10,6 +10,7 @@
   include("stats.oxo")
   include("StoryModeHUD.oxo")
   include("templates/lodInformation.oxt")
+  include("templates/spaceshipAssff.oxt")
   include("templates/StoryMode.oxt")
 ?>
 
@@ -20,6 +21,9 @@
   <templates>
     <Template link=lodtemplate_default />
   </templates>
+
+   
+
   <?lua include("includes/notifications.oxi") ?>
 
   <Scene
@@ -26,18 +30,30 @@
     ambientlight = "0.2, 0.2, 0.2"
     skybox       = "Orxonox/Starbox"
   >
+   
+    
+    
+    
 
-
-    <StaticEntity position="0,0,0" direction="0,0,0" >
+    <StaticEntity position="0,0,0" direction="0,0,-1" >
       <attached>
 
-        <Model position="600,370,0" mesh="planets/moon.mesh" scale=100 />
+        <Model name="a" position="550,300,0" mesh="planets/moon.mesh" scale=100 visible="true" />
+        <Billboard colour="1,0,0.05" position="550,300,-80"  material="Flares/lensflare" scale=4.5 />
+
+        <Model name="a" position="600,370,0" mesh="planets/moon.mesh" scale=100 visible="true" />
+         
+        
+         <Model position="550,300,0" mesh="assff.mesh" scale=20  visible="false" orientation="-0.015,0.091,0.038,-0.995"/>
+        
         <Billboard colour="1,1,0.05" position="600,370,-80"  material="Flares/lensflare" scale=4.5 />
-  
-        <Model position="100,350,-250" mesh="planets/moon.mesh" scale=100  />
+       
+
+        <Model position="100,350,-250" mesh="planets/moon.mesh" scale=100  visible="true"/>
+         
         <Billboard colour="1,1,0.05" position="100,350,-330"  material="Flares/lensflare" scale=4.5 />
 
-        <Model position="-600,250,-500" mesh="planets/moon.mesh" scale=100 />
+        <Model position="-600,250,-500" mesh="planets/moon.mesh" scale=100 visible="true"/>
         <Billboard colour="1,1,0.05" position="-600,250,-580"  material="Flares/lensflare" scale=5 />
 
         <Model position="-1000,50,-750" mesh="planets/moon.mesh" scale=100 />
@@ -61,10 +77,13 @@
       </attached>
     </StaticEntity>
 
+    
+
     <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 position="000.000, 000.000, 1000.000" orientation="0, 0, 0, -1" pawndesign=StoryMode />
+    <SpawnPoint position="000.000, 000.000, 1000.000" orientation="0, 0, 0, -1" spawnclass=StoryMode pawndesign=StoryMode />
     
+    
   </Scene>
 </Level>
 

Copied: code/branches/Merge_HS18/data/levels/emptyLevel22.oxw (from rev 12179, code/branches/WorldMap_HS18/data/levels/emptyLevel22.oxw)
===================================================================
--- code/branches/Merge_HS18/data/levels/emptyLevel22.oxw	                        (rev 0)
+++ code/branches/Merge_HS18/data/levels/emptyLevel22.oxw	2018-12-11 13:52:30 UTC (rev 12180)
@@ -0,0 +1,50 @@
+<LevelInfo
+ name = "Empty level22"
+ description = "A level with absolutely nothing in it."
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+?>
+
+<?lua
+  include("templates/spaceshipEscort.oxt")
+?>
+
+<Level>
+  <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"/>
+    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />
+    
+    <SpaceShip position="300,0,0" lookat="0,0,0" team=3>
+    <templates>
+        <Template link=spaceshipescort />
+    </templates>
+    <controller>
+        <StoryModeController accuracy=10 team=3>
+            <waypoints>
+                <Model mesh="cube.mesh" scale=8 position="300,0,0" />
+                <Model mesh="cube.mesh" scale=8 position="300,500,0" />
+                <Model mesh="cube.mesh" scale=8 position="0,500,0" />
+                <StaticEntity position="0,0,0" />
+            </waypoints>
+        </StoryModeController>
+    </controller>
+</SpaceShip>
+  </Scene>
+  
+</Level>
+

Copied: code/branches/Merge_HS18/data/levels/templates/MapExample.oxt (from rev 12179, code/branches/WorldMap_HS18/data/levels/templates/MapExample.oxt)
===================================================================
--- code/branches/Merge_HS18/data/levels/templates/MapExample.oxt	                        (rev 0)
+++ code/branches/Merge_HS18/data/levels/templates/MapExample.oxt	2018-12-11 13:52:30 UTC (rev 12180)
@@ -0,0 +1,5 @@
+<Template name=MapExample>
+  <StoryModeController
+   hudtemplate            = MapExampleH
+  />
+</Template>

Modified: code/branches/Merge_HS18/data/levels/templates/StoryMode.oxt
===================================================================
--- code/branches/Merge_HS18/data/levels/templates/StoryMode.oxt	2018-12-11 13:21:47 UTC (rev 12179)
+++ code/branches/Merge_HS18/data/levels/templates/StoryMode.oxt	2018-12-11 13:52:30 UTC (rev 12180)
@@ -1,5 +1,5 @@
 <Template name=StoryMode>
-  <Pawn
+  <StoryModeController
    hudtemplate            = StoryModeMap
   />
 </Template>

Modified: code/branches/Merge_HS18/data/levels/templates/StoryModeEscort.oxt
===================================================================
--- code/branches/Merge_HS18/data/levels/templates/StoryModeEscort.oxt	2018-12-11 13:21:47 UTC (rev 12179)
+++ code/branches/Merge_HS18/data/levels/templates/StoryModeEscort.oxt	2018-12-11 13:52:30 UTC (rev 12180)
@@ -42,7 +42,7 @@
       <MultiStateEngine position="-7.6, 0, 0" template=spaceshipescortengine />
     </engines>
     <attached>
-      <Model position="0,0,0" yaw=90 pitch=0 roll=0 scale=4 mesh="escortShip.mesh" />
+      <Model position="0,0,0" yaw=90 pitch=0 roll=0 scale=20 mesh="escortShip.mesh" />
       <Model position="0,0,0" yaw=180 pitch=90 roll=0 scale=4 mesh="escortWeapon.mesh" />
 <!--Model mesh="cube.mesh" mass=10 position="0,0,3" scale3D="10,4,8" />
 <Model mesh="cube.mesh" mass=10 position="12.6,-2,3" scale3D="2.8,2.8,11" />

Copied: code/branches/Merge_HS18/data/overlays/MapExampleHUD.oxo (from rev 12179, code/branches/WorldMap_HS18/data/overlays/MapExampleHUD.oxo)
===================================================================
--- code/branches/Merge_HS18/data/overlays/MapExampleHUD.oxo	                        (rev 0)
+++ code/branches/Merge_HS18/data/overlays/MapExampleHUD.oxo	2018-12-11 13:52:30 UTC (rev 12180)
@@ -0,0 +1,16 @@
+
+<Template name="MapExampleH">
+  <OverlayGroup name = "spaceshiphud" scale = "1, 1">
+
+     <GUIOverlay
+      name = "CampaignMenu"
+      guiname = "CampaignMenu"
+      visible = "false"
+    />
+
+  </OverlayGroup>
+</Template>
+  <Template name="spectatorhud">
+  <OverlayGroup name = "spectatorhud" scale = "1, 1">
+  </OverlayGroup>
+</Template>

Modified: code/branches/Merge_HS18/data/overlays/StoryModeHUD.oxo
===================================================================
--- code/branches/Merge_HS18/data/overlays/StoryModeHUD.oxo	2018-12-11 13:21:47 UTC (rev 12179)
+++ code/branches/Merge_HS18/data/overlays/StoryModeHUD.oxo	2018-12-11 13:52:30 UTC (rev 12180)
@@ -10,3 +10,7 @@
 
   </OverlayGroup>
 </Template>
+  <Template name="spectatorhud">
+  <OverlayGroup name = "spectatorhud" scale = "1, 1">
+  </OverlayGroup>
+</Template>

Modified: code/branches/Merge_HS18/src/modules/flappyorx/FlappyOrxShip.cc
===================================================================
--- code/branches/Merge_HS18/src/modules/flappyorx/FlappyOrxShip.cc	2018-12-11 13:21:47 UTC (rev 12179)
+++ code/branches/Merge_HS18/src/modules/flappyorx/FlappyOrxShip.cc	2018-12-11 13:52:30 UTC (rev 12180)
@@ -37,6 +37,7 @@
 #include "core/XMLPort.h"
 #include "graphics/Camera.h"
 #include "graphics/ParticleSpawner.h"
+#include "worldentities/pawns/SpaceShip.h"
 #include <math.h> 
 #include <ctime>
 

Modified: code/branches/Merge_HS18/src/modules/towerdefense/TowerDefense.cc
===================================================================
--- code/branches/Merge_HS18/src/modules/towerdefense/TowerDefense.cc	2018-12-11 13:21:47 UTC (rev 12179)
+++ code/branches/Merge_HS18/src/modules/towerdefense/TowerDefense.cc	2018-12-11 13:52:30 UTC (rev 12180)
@@ -271,8 +271,11 @@
 
         if (hasStarted() == false || player_ == nullptr)
         {
+            orxout(internal_warning) << "Heere" << endl;
             return;
         }
+
+        orxout(internal_warning) << "2" << endl;
         timeUntilNextWave_ -= dt;
         timeSinceLastSpawn_ += dt;
 
@@ -279,6 +282,7 @@
         //build/upgrade tower at selecter position
         if (selecter != nullptr && selecter->buildTower_ == true)
         {
+             orxout(internal_warning) << "3" << endl;
             selecter->buildTower_ = false;
 
             if (getField(selecter->selectedPos_)->canUpgrade() == true)

Modified: code/branches/Merge_HS18/src/modules/towerdefense/TowerDefenseSelecter.cc
===================================================================
--- code/branches/Merge_HS18/src/modules/towerdefense/TowerDefenseSelecter.cc	2018-12-11 13:21:47 UTC (rev 12179)
+++ code/branches/Merge_HS18/src/modules/towerdefense/TowerDefenseSelecter.cc	2018-12-11 13:52:30 UTC (rev 12180)
@@ -107,6 +107,7 @@
 
     void TowerDefenseSelecter::moveFrontBack(const Vector2& value)
     {
+        
         if (value.x > 0)
         {
             moveUpPressed_ = true;

Modified: code/branches/Merge_HS18/src/orxonox/controllers/CMakeLists.txt
===================================================================
--- code/branches/Merge_HS18/src/orxonox/controllers/CMakeLists.txt	2018-12-11 13:21:47 UTC (rev 12179)
+++ code/branches/Merge_HS18/src/orxonox/controllers/CMakeLists.txt	2018-12-11 13:52:30 UTC (rev 12180)
@@ -1,5 +1,7 @@
 ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   Controller.cc
+  StoryModeController.cc
+  SMCoord.cc
   HumanController.cc
   NewHumanController.cc
   ArtificialController.cc
@@ -19,6 +21,7 @@
   FightingController.cc
   MasterController.cc
   ArrowController.cc;
-  AutonomousDroneController.cc;
+  AutonomousDroneController.cc;	
+  StoryModeController.cc;
 	
 )

Copied: code/branches/Merge_HS18/src/orxonox/controllers/SMCoord.cc (from rev 12179, code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.cc)
===================================================================
--- code/branches/Merge_HS18/src/orxonox/controllers/SMCoord.cc	                        (rev 0)
+++ code/branches/Merge_HS18/src/orxonox/controllers/SMCoord.cc	2018-12-11 13:52:30 UTC (rev 12180)
@@ -0,0 +1,91 @@
+/*
+ *   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:
+ *      Joel Lingg
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "SMCoord.h"
+
+namespace orxonox {
+  SMCoord::SMCoord() {
+    set(0);
+  }
+
+  SMCoord::~SMCoord() {
+
+  }
+
+  SMCoord::SMCoord(int x) {
+    set(x);
+  }
+
+  //sets the index. the boundaries neeed to set higher when you want more games.
+  void SMCoord::set(int index) {
+    if (index < 0) {
+      this -> index = 0;
+    } else if (index > 3) {
+      this -> index = 3;
+    } else {
+      this -> index = index;
+    }
+  }
+  //Returns the 3dcoordinate of the symbol which is choosen at the moment
+  Vector3 SMCoord::get3dcoordinate() {
+    Vector3 coord;
+    switch (this -> index) {
+    case 0:
+      coord.x = 550;
+      coord.y = 300;
+      coord.z = 0;
+      break;
+    case 1:
+      coord.x = 600;
+      coord.y = 300;
+      coord.z = 0;
+      break;
+    case 2:
+      coord.x = 650;
+      coord.y = 300;
+      coord.z = 0;
+      break;
+    case 3:
+      coord.x = 700;
+      coord.y = 300;
+      coord.z = 0;
+      break;
+
+    default:
+      coord.x = 550;
+      coord.y = 300;
+      coord.z = 0;
+      break;
+    }
+    return coord;
+  }
+
+  int SMCoord::getIndex() {
+    return this -> index;
+  }
+}
\ No newline at end of file

Copied: code/branches/Merge_HS18/src/orxonox/controllers/SMCoord.h (from rev 12179, code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.h)
===================================================================
--- code/branches/Merge_HS18/src/orxonox/controllers/SMCoord.h	                        (rev 0)
+++ code/branches/Merge_HS18/src/orxonox/controllers/SMCoord.h	2018-12-11 13:52:30 UTC (rev 12180)
@@ -0,0 +1,48 @@
+/*
+ *   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:
+ *      Joel Lingg
+ *   Co-authors:
+ *      ...
+ *
+ */
+#ifndef _SMCoord_H__
+#define _SMCoord_H__
+
+#include "core/CoreIncludes.h"
+#include "gametypes/Deathmatch.h"
+
+namespace orxonox {
+
+  class _OrxonoxExport SMCoord {
+    public: SMCoord();
+    SMCoord(int x);
+    void set(int index);
+    virtual int getIndex();
+    virtual Vector3 get3dcoordinate();
+    virtual~SMCoord();
+
+    private: int index;
+  };
+
+}
+#endif
\ No newline at end of file

Copied: code/branches/Merge_HS18/src/orxonox/controllers/StoryModeController.cc (from rev 12179, code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.cc)
===================================================================
--- code/branches/Merge_HS18/src/orxonox/controllers/StoryModeController.cc	                        (rev 0)
+++ code/branches/Merge_HS18/src/orxonox/controllers/StoryModeController.cc	2018-12-11 13:52:30 UTC (rev 12180)
@@ -0,0 +1,170 @@
+/*
+ *   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:
+ *      Joel Lingg
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "StoryModeController.h"
+
+namespace orxonox {
+  RegisterClass(StoryModeController);
+
+  StoryModeController::StoryModeController(Context * context): SpaceShip(context) {
+
+    RegisterObject(StoryModeController);
+
+    //initiate all variables according to our needs
+    selectedPos_ = new SMCoord(0);
+    moveForward_ = false;
+    moveBackward_ = false;
+    boostPressed_ = false;
+    init_ = true;
+    dtime_ = 50;
+    time_ = dtime_ + 1;
+    updatePosition();
+
+  }
+  StoryModeController::~StoryModeController() {
+    delete selectedPos_;
+    selectedPos_ = nullptr;
+
+  }
+
+  //Pre:selectedPos_ needs to be defined
+  // Post: the position of the camera will be updated
+  void StoryModeController::updatePosition() {
+    Vector3 pos = selectedPos_ -> get3dcoordinate();
+    setPosition(pos);
+  }
+
+  //Pre: @index integer
+  //post: our new position is updated in selectedPos_
+  void StoryModeController::setLocation(int index) {
+    selectedPos_ -> set(index);
+  }
+
+  //Function which is repeated anz dt.
+  void StoryModeController::tick(float dt) {
+    //Passing arguments to SpaceShip
+    SUPER(StoryModeController, tick, dt);
+
+    Camera * camera = this -> getCamera();
+
+    if (init_ && camera != nullptr) {
+      camera -> setPosition(0, 0, 200);
+      camera -> setOrientation(Vector3::UNIT_Z, Degree(0));
+      init_ = false;
+    }
+
+    //As I dont want to update positions every time (to prevent multiple key presses) time_ is raised untill a sertain dtime_
+    time_++;
+    if (time_ >= dtime_) {
+
+      time_ = 0;
+
+      if (moveForward_ == true) {
+        moveForward_ = false;
+        selectedPos_ -> set(selectedPos_ -> getIndex() + 1);
+        updatePosition();
+      }
+
+      if (moveBackward_ == true) {
+        moveBackward_ = false;
+        selectedPos_ -> set(selectedPos_ -> getIndex() - 1);
+        updatePosition();
+      }
+
+      if (boostPressed_ == true) {
+        boostPressed_ = false;
+        chooseGame();
+      }
+
+      //updates the cameraposition
+      if (camera != nullptr) {
+
+        camera -> setPosition(0, 0, 200);
+        camera -> setOrientation(Vector3::UNIT_Z, Degree(0));
+
+      }
+    }
+
+  }
+
+  //Post: The game is choosen acording to the index in selectedPos_. This one must be extended if more games want to be loaded
+  void StoryModeController::chooseGame() {
+    int ind = selectedPos_ -> getIndex();
+    std::string name = "changeGame ";
+    switch (ind) {
+    case 0:
+      name = name + "gallery.oxw";
+      break;
+    case 1:
+      name = name + "pong.oxw";
+      break;
+    case 2:
+      name = name + "towerDefense.oxw";
+      break;
+    case 3:
+      name = name + "SOB.oxw";
+      break;
+
+    default:
+      name = name + "MapExample.oxw";
+      break;
+    }
+    CommandExecutor::execute(name);
+
+  }
+
+  //decides if we move left or right
+  void StoryModeController::moveRightLeft(const Vector2 & value) {
+    if (!moveForward_ && !moveBackward_ && !boostPressed_) {
+      if (value.x > 0) {
+        moveForward_ = false;
+        moveBackward_ = true;
+      } else {
+        moveBackward_ = false;
+        moveForward_ = true;
+      }
+    }
+
+  }
+
+  //decides to choose the game
+  void StoryModeController::boost(bool bBoost) {
+    if (!moveForward_ && !moveBackward_ && !boostPressed_) {
+      boostPressed_ = true;
+    }
+  }
+
+  //Some functions I didn't use, but can be used to enhance your map. Just orientate at the function above
+  void StoryModeController::rotateYaw(const Vector2 & value) {}
+  void StoryModeController::rotatePitch(const Vector2 & value) {}
+  void StoryModeController::rotateRoll(const Vector2 & value) {}
+  void StoryModeController::moveFrontBack(const Vector2 & value) {}
+  void StoryModeController::fire(unsigned int a) {}
+  void StoryModeController::fired(unsigned int b) {}
+
+}
\ No newline at end of file

Copied: code/branches/Merge_HS18/src/orxonox/controllers/StoryModeController.h (from rev 12179, code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.h)
===================================================================
--- code/branches/Merge_HS18/src/orxonox/controllers/StoryModeController.h	                        (rev 0)
+++ code/branches/Merge_HS18/src/orxonox/controllers/StoryModeController.h	2018-12-11 13:52:30 UTC (rev 12180)
@@ -0,0 +1,106 @@
+/*
+ *   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:
+ *      Joel Lingg
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _StoryModeController_H__
+#define _StoryModeController_H__
+
+#include "OrxonoxPrereqs.h"
+#include "core/EventIncludes.h"
+#include "core/command/Executor.h"
+#include "core/config/ConfigValueIncludes.h"
+#include "core/XMLPort.h"
+#include <vector>
+#include "tools/interfaces/Tickable.h"
+#include "worldentities/ControllableEntity.h"
+#include "worldentities/pawns/SpaceShip.h"
+
+
+#include "core/CoreIncludes.h"
+
+#include "graphics/Camera.h"
+#include "SMCoord.h"
+//#include "core/XMLPort.h"
+//#include "gamestates/GSLevel.h"
+
+//#include <gtest/gtest.h>
+#include "core/class/Identifier.h"
+#include "core/class/IdentifierManager.h"
+//#include "core/command/ConsoleCommandIncludes.h"
+#include "core/command/CommandExecutor.h"
+#include "core/object/Destroyable.h"
+#include "core/module/ModuleInstance.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport StoryModeController : public SpaceShip
+    {
+        public:
+            // Implementation of a Controller needs the two following lines
+            StoryModeController(Context* context);
+            virtual ~StoryModeController();
+            //  As we extend SpaceShip but just are interested in the moment of function 
+            // calling, we mark all the functions of spaceship to be override
+            virtual void tick(float dt) override;            
+            virtual void moveFrontBack(const Vector2& value) override;
+            virtual void moveRightLeft(const Vector2& value) override;
+            virtual void rotateYaw(const Vector2& value) override;
+            virtual void rotatePitch(const Vector2& value) override;
+            virtual void rotateRoll(const Vector2& value) override;
+            void fire(unsigned int firemode);
+            virtual void fired(unsigned int firemode) override;
+            virtual void boost(bool bBoost) override;
+            
+
+            
+        private:
+            //Add to function to set and update the Position. As setPosition isn't available, we used setLocation
+            virtual void setLocation(int index);
+            virtual void updatePosition();  
+
+            //According to the position, this function starts the game.
+            virtual void chooseGame();
+
+             SMCoord* selectedPos_; 
+
+             //Variables to keep track of time
+            float time_;
+            int dtime_;
+
+            //Bools which get true as soon as the event they are named after has occured
+            bool moveRight_ ;
+            bool moveLeft_ ;                                        
+            bool moveForward_;
+            bool moveBackward_;                     
+            bool boostPressed_;
+            bool init_;
+            
+
+    };
+}
+
+#endif /* _WaypointController_H__ */

Modified: code/branches/Merge_HS18/src/orxonox/gametypes/StoryMode.cc
===================================================================
--- code/branches/Merge_HS18/src/orxonox/gametypes/StoryMode.cc	2018-12-11 13:21:47 UTC (rev 12179)
+++ code/branches/Merge_HS18/src/orxonox/gametypes/StoryMode.cc	2018-12-11 13:52:30 UTC (rev 12180)
@@ -46,6 +46,7 @@
     
     StoryMode::StoryMode(Context* context) : Gametype(context)
     {
+        
         RegisterObject(StoryMode);
 
         this->gtinfo_ = new GametypeInfo(context);
@@ -64,7 +65,7 @@
 */
     void StoryMode::exit()
     {
-        orxout() << "s funktioniert"<< endl;
+      
         for (StoryMode* mission : ObjectList<StoryMode>())
         { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would end ALL missions!
             mission->end();

Copied: code/branches/Merge_HS18/svn-commit.tmp (from rev 12179, code/branches/WorldMap_HS18/svn-commit.tmp)
===================================================================
--- code/branches/Merge_HS18/svn-commit.tmp	                        (rev 0)
+++ code/branches/Merge_HS18/svn-commit.tmp	2018-12-11 13:52:30 UTC (rev 12180)
@@ -0,0 +1,13 @@
+
+--This line, and those below, will be ignored--
+
+M    data/gui/layouts/CampaignMenu.layout
+M    data/gui/scripts/CampaignMenu.lua
+M    data/levels/NC_StoryModeLevel.oxw
+M    data/levels/StoryModeMap.oxw
+M    data/levels/StoryModeMapDev.oxw
+M    data/levels/templates/StoryMode.oxt
+M    src/modules/towerdefense/TowerDefense.cc
+M    src/modules/towerdefense/TowerDefenseSelecter.cc
+M    src/orxonox/controllers/StoryModeController.cc
+M    src/orxonox/controllers/StoryModeController.h



More information about the Orxonox-commit mailing list