Index: code/branches/AI_HS15/data/levels/AITest.oxw
===================================================================
--- code/branches/AI_HS15/data/levels/AITest.oxw	(revision 10672)
+++ code/branches/AI_HS15/data/levels/AITest.oxw	(revision 10673)
@@ -32,10 +32,10 @@
 
     <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="-1000,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
+    <SpawnPoint team=0 position="-2000,-1000,3000" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
     
     <?lua
       for i = 0, 5, 1 do
     ?>
-    <SpaceShip position="<?lua print(1600+i*200) ?>,3000, 2000 ?>" lookat="0,0,0">
+    <SpaceShip position="<?lua print(1600+i*200) ?>,<?lua print(3000-i*500) ?>, -1500 ?>" lookat="0,0,0">
       <templates>
         <Template link=spaceshipassff />
Index: code/branches/AI_HS15/src/orxonox/controllers/AIController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/AIController.cc	(revision 10672)
+++ code/branches/AI_HS15/src/orxonox/controllers/AIController.cc	(revision 10673)
@@ -205,12 +205,17 @@
         float maxrand = 100.0f / ACTION_INTERVAL;
         ControllableEntity* controllable = this->getControllableEntity();
-        if (this->state_ == SLAVE)
-        {
-            Vector3 desiredAbsolutePosition = this->myMaster_->getControllableEntity()->getWorldPosition() + this->myMaster_->getControllableEntity()->getWorldOrientation()*desiredRelativePosition_;
-            
-            orxonox::WeakPtr<MovableEntity> waypoint = new MovableEntity(this->center_->getContext());
-            waypoint->setPosition(desiredAbsolutePosition);
-            
-            this->addWaypoint(waypoint);
+        if (this->state_ == SLAVE && controllable && this->mode_ == DEFAULT)
+        {
+            
+            if (this->myMaster_ && this->myMaster_->getControllableEntity() && desiredRelativePosition_){
+                Vector3 desiredAbsolutePosition = this->myMaster_->getControllableEntity()->getWorldPosition() + this->myMaster_->getControllableEntity()->getWorldOrientation()* (*desiredRelativePosition_);
+                this->moveToPosition (desiredAbsolutePosition);
+                //WorldEntity* waypoint = new WorldEntity(this->getContext());
+                //waypoint->setPosition(desiredAbsolutePosition);
+            
+                //this->addWaypoint(waypoint);
+            
+            }
+          
         }
         //DOES: Either move to the waypoint or search for a Point of interest
Index: code/branches/AI_HS15/src/orxonox/controllers/AIController.h
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/AIController.h	(revision 10672)
+++ code/branches/AI_HS15/src/orxonox/controllers/AIController.h	(revision 10673)
@@ -30,9 +30,11 @@
 #define _AIController_H__
 
-#include "OrxonoxPrereqs.h"
+#include "OrxonoxPrereqs.h" 
 
+#include "util/Math.h"
 #include "tools/Timer.h"
 #include "tools/interfaces/Tickable.h"
 #include "ArtificialController.h"
+
 
 namespace orxonox
@@ -55,6 +57,5 @@
             Timer actionTimer_; //<! Regularly calls action().
             std::vector<WeakPtr<AIController> > enemies_, allies_;
-            Vector3* desiredRelativePosition_;
-            Vector3* currentRelativePosition_;
+           
     };
 }
Index: code/branches/AI_HS15/src/orxonox/controllers/FormationController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/FormationController.cc	(revision 10672)
+++ code/branches/AI_HS15/src/orxonox/controllers/FormationController.cc	(revision 10673)
@@ -712,16 +712,21 @@
         switch (this->formationMode_){
             case ATTACK:
-            for(std::vector<FormationController*>::iterator it = slaves_.begin(), float i = 0; it != slaves_.end(); it++, ++i)
-            {
-                (*it)->desiredPosition_ = new Vector3 ((i-slaves_.size()/2)*200, 0, 0);
-                
-            }
-            break;
-            case NORMAL:
-
-            break;
-            case DEFEND:
-
-            break;
+            {
+                float i = 0;
+                for(std::vector<FormationController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++)
+                {
+                    (*it)->desiredRelativePosition_ = new Vector3 ((i-slaves_.size()/2)*200, 0, 0);
+                    i++;
+                }
+                break;
+            }
+            case NORMAL: 
+            {
+                break;
+            }
+            case DEFEND: 
+            {
+                break;
+            }
         }
        
Index: code/branches/AI_HS15/src/orxonox/controllers/FormationController.h
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/FormationController.h	(revision 10672)
+++ code/branches/AI_HS15/src/orxonox/controllers/FormationController.h	(revision 10673)
@@ -73,6 +73,6 @@
       @brief If master, set the desired position of slaves (Vector2) for all the slaves.
       */
-      inline void setDesiredPositionOfSlaves();
-      
+      void setDesiredPositionOfSlaves();
+
       inline void setPassive(bool passive)
            { this->passive_ = passive; }
@@ -106,4 +106,5 @@
 
   protected:
+      Vector3* desiredRelativePosition_;
       bool formationFlight_;
       bool passive_;
