Index: code/branches/plehmannFS16/data/gui/scripts/testscript.lua
===================================================================
--- code/branches/plehmannFS16/data/gui/scripts/testscript.lua	(revision 11141)
+++ code/branches/plehmannFS16/data/gui/scripts/testscript.lua	(revision 11152)
@@ -23,18 +23,17 @@
 if ctrl ~= nil then
 
-  ctrl:eventScheduler("mal", xl,yl,zl, xl,yl,zl, 2)
-  ctrl:eventScheduler("idle", 1)
-  ctrl:eventScheduler("ral", xl, yl, zl, 3, 3000, 0, math.pi)
-  ctrl:eventScheduler("idle", 1)
-  ctrl:eventScheduler("mal", 0,0,1000, xl,yl,zl, 3)
-  ctrl:eventScheduler("idle", 1)
-  ctrl:eventScheduler("chl", xl, yl, zl, xr, yr, zr, 2)
-  ctrl:eventScheduler("idle", 1)
-  ctrl:eventScheduler("mal", xr + 600,yr,zr, xr,yr,zr, 4)
-  ctrl:eventScheduler("idle", 1)
-  ctrl:eventScheduler("chl", xr, yr, zr, xl, yl, zl, 3)
-  ctrl:eventScheduler("idle", 1)
-  ctrl:eventScheduler("spi", xm,ym,zm, 0,0,0, 4)
-  ctrl:eventScheduler("idle", 1)
+  ctrl:eventScheduler("mal", xl,yl,zl, xl,yl,zl, 10)
+  -- ctrl:eventScheduler("ral", xl, yl, zl, 3, 3000, 0, math.pi)
+  -- ctrl:eventScheduler("idle", 1)
+  -- ctrl:eventScheduler("mal", 0,0,1000, xl,yl,zl, 3)
+  -- ctrl:eventScheduler("idle", 1)
+  -- ctrl:eventScheduler("chl", xl, yl, zl, xr, yr, zr, 2)
+  -- ctrl:eventScheduler("idle", 1)
+  -- ctrl:eventScheduler("mal", xr + 600,yr,zr, xr,yr,zr, 4)
+  -- ctrl:eventScheduler("idle", 1)
+  -- ctrl:eventScheduler("chl", xr, yr, zr, xl, yl, zl, 3)
+  -- ctrl:eventScheduler("idle", 1)
+  -- ctrl:eventScheduler("spi", xm,ym,zm, 0,0,0, 4)
+  -- ctrl:eventScheduler("idle", 1)
 
 end
Index: code/branches/plehmannFS16/data/levels/scriptController.oxw
===================================================================
--- code/branches/plehmannFS16/data/levels/scriptController.oxw	(revision 11141)
+++ code/branches/plehmannFS16/data/levels/scriptController.oxw	(revision 11152)
@@ -54,6 +54,25 @@
     </StaticEntity>
 
+
+    <StaticEntity position  = "3000,0,0" mass=10000 collisionType=static >
+      <attached>
+        <Model mesh="cube_green.mesh" mass=10 position="0,0,0" scale=10 />
+      </attached>
+    </StaticEntity>
+
+    <StaticEntity position  = "2000,0,0" mass=10000 collisionType=static >
+      <attached>
+        <Model mesh="cube_green.mesh" mass=10 position="0,0,0" scale=10 />
+      </attached>
+    </StaticEntity>
+
+    <StaticEntity position  = "2500,500,0" mass=10000 collisionType=static >
+      <attached>
+        <Model mesh="cube_green.mesh" mass=10 position="0,0,0" scale=10 />
+      </attached>
+    </StaticEntity>
+
 <!-- ControllerDirector waits for the event takeControl to attach a new Controller -->
-    <ControllerDirector position="0,0,0" scriptname="presentation">
+    <ControllerDirector position="0,0,0" scriptname="testscript">
         <events>
             <takeControl>
Index: code/branches/plehmannFS16/src/orxonox/controllers/ScriptController.cc
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/ScriptController.cc	(revision 11141)
+++ code/branches/plehmannFS16/src/orxonox/controllers/ScriptController.cc	(revision 11152)
@@ -34,8 +34,9 @@
   * Command             | Abbreviation | Parameter 1          | '' 2     | '' 3    | '' 4                 | '' 5     | '' 6     | '' 7
   *
-  * "Move And Look"     | mal          | GoTo X Coordinate    | '' Y ''  | '' Z '' | LookAt X Coordinate  |  '' Y '' |  '' Y '' | Duration
-  * "Rotate And Look"   | ral          | GoTo X Coordinate    | '' Y ''  | '' Z '' | Axis (1=x, 2=z, 3=z) |     -    |     -    | Duration
-  * "Spiral"            | spi          | GoTo X Coordinate    | '' Y ''  | '' Z '' |          -           |     -    |     -    | Duration
-  * "Transition Look"   | chl          | From X Coordinate    | '' Y ''  | '' Z '' | To X Coordinate      |  '' Y '' |  '' Y '' | Duration
+  * "Move And Look"     | mal          | GoTo X Coordinate    |  '' Y ''  | '' Z '' | LookAt X Coordinate  |  '' Y '' |  '' Y '' | Duration
+  * "Rotate And Look"   | ral          | GoTo X Coordinate    |  '' Y ''  | '' Z '' | Axis (1=x, 2=y, 3=z) |     -    |     -    | Duration
+  * "Spiral"            | spi          | GoTo X Coordinate    |  '' Y ''  | '' Z '' |          -           |     -    |     -    | Duration
+  * "Transition Look"   | chl          | From X Coordinate    |  '' Y ''  | '' Z '' | To X Coordinate      |  '' Y '' |  '' Y '' | Duration
+  * "rotate round X crd"| rotX         | anchor coordinate    | angle(rad)|    -    |                      |          |          | Duration
   * "Idle (Do nothing)" | idle         | Duration
   */
@@ -90,5 +91,5 @@
         /* Output some debugging information */
         orxout(verbose) << "ScriptController: Taking control" << endl;
-        orxout(verbose) << "This-pointer: " << this << endl;
+        orxout(verbose) << "This-pointer: " << this << endl; 
 
         /* Set the controller ID (the argument here should be nonzero) */
@@ -103,10 +104,9 @@
          */
         this->entity_->setDestroyWhenPlayerLeft(false);
-        // uncomment the next line because i just did that for debug
-        //this->player_->pauseControl();
+        this->player_->stopTemporaryControl();
         this->entity_->setController(this);
         this->setControllableEntity(this->entity_);
-        this->entity_->mouseLook();
-        this->entity_->setVisible(false);
+        //this->entity_->mouseLook();
+        //this->entity_->setVisible(false);
         
         // TODO take the human Controllers control  dont forget to give it back in the destructor
@@ -204,7 +204,105 @@
         {
           // Abbreviation for "spiral" (rotation + translation)
-          if (this->currentEvent.fctName == "spi") {
-
-            // Need to know a perpendicular basis to the translation vector:
+          if (this->currentEvent.fctName == "spi") 
+          {
+              spi(dl); // call the external function
+          }
+
+          // Abbreviation for "rotate and look"
+          else if (this->currentEvent.fctName == "ral")
+          { 
+              ral(dl);  
+          }
+          else if( this->currentEvent.fctName == "mal" )
+          {
+              mal(dl);
+          }
+          else if( this->currentEvent.fctName == "chl" )
+          {
+              chl(dl);
+          }
+
+
+          /* Force mouse look */
+          if( this->entity_->isInMouseLook() == false )
+            this->entity_->mouseLook();
+        }
+    }
+
+    void ScriptController::eventScheduler(std::string instruction, 
+      float x1, float y1, float z1, 
+      float x2, float y2, float z2, 
+      float duration, float executionTime)
+    {
+      /* put data (from LUA) into time-sorted eventList*/ 
+      /* Nimmt den befehl und die argumente aus luascript und ertellt einen
+       * struct pro event, diese structs werden sortiert nach eventTime
+       */
+      struct event tmp;
+
+      /* Fill the structure with all the provided information */
+      tmp.fctName = instruction;
+
+      //tmp.x1 = x1; tmp.y1 = y1; tmp.z1 = z1;
+      //tmp.x2 = x2; tmp.y2 = y2; tmp.z2 = z2;
+      tmp.v1 = Vector3(x1,y1,z1);
+      tmp.v2 = Vector3(x2,y2,z2);
+
+      // the parameters are not required to be vector coordinates!
+      // for convenience they are however stored twice if they have some kind of different meaning
+      tmp.a = x1;
+      tmp.b = y1;
+      tmp.c = z1;
+      tmp.d = x2;
+      tmp.e = y2;
+      tmp.f = z2;
+
+      tmp.duration = duration;
+
+      /* This is kind of a hack. If we hit the function idle all we want to do is
+         advance event execution time, not schedule anything */
+      if (instruction == "idle") {
+        tmp.eventTime = this->prevEventTime;
+        this->prevEventTime += x1;
+        return;
+      } else {
+        tmp.eventTime = this->prevEventTime;
+        this->prevEventTime += duration;
+      }
+
+      /* Add the created event to the event list */
+      if(eventList.size()==0)
+      { /* The list is still empty, just add it */
+        orxout(verbose) << "eventList empty (01)" << endl;
+        eventList.insert(eventList.begin(), tmp);
+        this->eventno += 1;
+        return; /* Nothing more to do, the event was added */
+      }
+
+      /* Event was not added yet since the list was not empty. Walk through
+       * the list of events and add it so that the events are correctly in
+       * order.
+       */
+      for (std::vector<event>::iterator it=eventList.begin(); it<eventList.end(); it++)
+      { if(tmp.eventTime < it->eventTime)
+        { eventList.insert(it,tmp);
+          this->eventno += 1;
+          //orxout()<<"new event added"<<endl;
+          return;
+        }
+      }
+
+      /* If the event was still not added here, it belongs in the end of the list */
+      eventList.insert(eventList.end(), tmp);
+      this->eventno += 1;
+
+    }
+
+    // Event Functions
+
+    void ScriptController::spi(float dl) 
+    {
+    
+                // Need to know a perpendicular basis to the translation vector:
             // Given (a, b, c) we chose (b, -a, 0)norm and (0, c, -b)norm
             // Currently we set a fix rotational radius of 400
@@ -224,9 +322,9 @@
             delete ortho1;
             delete ortho2;
-          }
-
-          // Abbreviation for "rotate and look"
-          if (this->currentEvent.fctName == "ral")
-          { 
+
+    }
+
+    void ScriptController::ral(float dl)
+    {
             // Specify the axis
             Vector3 a;
@@ -253,7 +351,9 @@
             /* Look at the specified position */
             this->entity_->lookAt(this->currentEvent.v1);
-          }
-          else if( this->currentEvent.fctName == "mal" )
-          {
+      
+    }
+
+    void ScriptController::mal(float dl)
+    {
             /* Set the position to the correct place in the trajectory */
             this->entity_->setPosition( (1-dl)*startpos + dl * this->currentEvent.v1);
@@ -261,85 +361,18 @@
             /* Look at the specified position */
             this->entity_->lookAt(this->currentEvent.v2);
-          }
-          else if( this->currentEvent.fctName == "chl" )
-          {
+
+    }
+
+    void ScriptController::chl(float dl)
+    {
             /* Sweep the look from v1 to v2 */
             this->entity_->lookAt( (1-dl)*this->currentEvent.v1 + 
               dl * this->currentEvent.v2 );
-          }
-
-
-          /* Force mouse look */
-          if( this->entity_->isInMouseLook() == false )
-            this->entity_->mouseLook();
-        }
-    }
-
-    void ScriptController::eventScheduler(std::string instruction, 
-      float x1, float y1, float z1, 
-      float x2, float y2, float z2, 
-      float duration, float executionTime)
-    {
-      /* put data (from LUA) into time-sorted eventList*/ 
-      /* Nimmt den befehl und die argumente aus luascript und ertellt einen
-       * struct pro event, diese structs werden sortiert nach eventTime
-       */
-      struct event tmp;
-
-      /* Fill the structure with all the provided information */
-      tmp.fctName = instruction;
-
-      //tmp.x1 = x1; tmp.y1 = y1; tmp.z1 = z1;
-      //tmp.x2 = x2; tmp.y2 = y2; tmp.z2 = z2;
-      tmp.v1 = Vector3(x1,y1,z1);
-      tmp.v2 = Vector3(x2,y2,z2);
-
-      // the parameters are not required to be vector coordinates!
-      // for convenience they are however stored twice if they have some kind of different meaning
-      tmp.a = x1;
-      tmp.b = y1;
-      tmp.c = z1;
-      tmp.d = x2;
-      tmp.e = y2;
-      tmp.f = z2;
-
-      tmp.duration = duration;
-
-      /* This is kind of a hack. If we hit the function idle all we want to do is
-         advance event execution time, not schedule anything */
-      if (instruction == "idle") {
-        tmp.eventTime = this->prevEventTime;
-        this->prevEventTime += x1;
-        return;
-      } else {
-        tmp.eventTime = this->prevEventTime;
-        this->prevEventTime += duration;
-      }
-
-      /* Add the created event to the event list */
-      if(eventList.size()==0)
-      { /* The list is still empty, just add it */
-        orxout(verbose) << "eventList empty (01)" << endl;
-        eventList.insert(eventList.begin(), tmp);
-        this->eventno += 1;
-        return; /* Nothing more to do, the event was added */
-      }
-
-      /* Event was not added yet since the list was not empty. Walk through
-       * the list of events and add it so that the events are correctly in
-       * order.
-       */
-      for (std::vector<event>::iterator it=eventList.begin(); it<eventList.end(); it++)
-      { if(tmp.eventTime < it->eventTime)
-        { eventList.insert(it,tmp);
-          this->eventno += 1;
-          //orxout()<<"new event added"<<endl;
-          return;
-        }
-      }
-
-      /* If the event was still not added here, it belongs in the end of the list */
-      eventList.insert(eventList.end(), tmp);
-      this->eventno += 1;
+
+    }
+
+    void ScriptController::rotX(float dl)
+    {
+
 
     }
Index: code/branches/plehmannFS16/src/orxonox/controllers/ScriptController.h
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/ScriptController.h	(revision 11141)
+++ code/branches/plehmannFS16/src/orxonox/controllers/ScriptController.h	(revision 11152)
@@ -128,4 +128,22 @@
             //Vector3 lookAtPosition;
 
+
+            /* private member functions */
+
+            /*spiral event*/
+            void spi(float dl);
+
+            /* rotate and look event */
+            void ral(float dl);
+
+            /* move and look event */
+            void mal(float dl);
+
+            /* transition look event */
+            void chl(float dl);
+
+            /* rotate around x-coordinate event */
+            void rotX(float dl);
+
     };// tolua_export
 } // tolua_export
