Index: code/branches/presentationFS16/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/presentationFS16/src/orxonox/CMakeLists.txt	(revision 11206)
+++ code/branches/presentationFS16/src/orxonox/CMakeLists.txt	(revision 11207)
@@ -66,5 +66,5 @@
     infos/PlayerInfo.h
     sound/SoundManager.h
-    controllers/ScriptController.h
+    controllers/NewScriptController.h
     overlays/CampaignMenu.h
   PCH_FILE
Index: code/branches/presentationFS16/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/branches/presentationFS16/src/orxonox/OrxonoxPrereqs.h	(revision 11206)
+++ code/branches/presentationFS16/src/orxonox/OrxonoxPrereqs.h	(revision 11207)
@@ -98,4 +98,5 @@
     class HumanController;
     class ScriptController;
+    class NewScriptController;
     class WaypointController;
     class WaypointPatrolController;
Index: code/branches/presentationFS16/src/orxonox/controllers/CMakeLists.txt
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/CMakeLists.txt	(revision 11206)
+++ code/branches/presentationFS16/src/orxonox/controllers/CMakeLists.txt	(revision 11207)
@@ -5,5 +5,4 @@
   ArtificialController.cc
   AIController.cc
-  ScriptController.cc
   WaypointController.cc
   WaypointPatrolController.cc
@@ -19,3 +18,5 @@
   FightingController.cc
   MasterController.cc
+  NewScriptController.cc
 )
+ADD_SUBDIRECTORY(scriptTasks)
Index: code/branches/presentationFS16/src/orxonox/controllers/ControllerDirector.cc
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/ControllerDirector.cc	(revision 11206)
+++ code/branches/presentationFS16/src/orxonox/controllers/ControllerDirector.cc	(revision 11207)
@@ -6,5 +6,5 @@
 
 #include "ControllerDirector.h"
-#include "ScriptController.h"
+#include "NewScriptController.h"
 #include "core/CoreIncludes.h"
 
@@ -64,5 +64,5 @@
     {
        /* Output a message confirming that the function was called */
-       orxout(verbose)<<"test takecontrol."<< endl;
+       orxout()<<"test takecontrol."<< endl;
 
        /* First, we set up a new controller to attach to the unit that
@@ -74,5 +74,5 @@
        {
          /* Create a scriptcontroller object */
-         ScriptController *newctrl = new ScriptController(this->context_);
+         NewScriptController *newctrl = new NewScriptController(this->context_);
 
          /* Make the player we were given its slave */
@@ -105,4 +105,6 @@
         * the next time it is triggered */
        ctrlid += 1;
+
+        orxout()<<"swag"<< endl;
     } 
 
@@ -112,5 +114,5 @@
         this->player_ = nullptr;
 
-        orxout(verbose) << "Preparation to take Control!" << endl; 
+        orxout() << "Preparation to take Control!" << endl; 
 
         // Check whether it is a player trigger and extract pawn from it
@@ -121,9 +123,13 @@
 
             // Check if there actually was a player returned.
-            if( this->player_ == nullptr) return false;
+            if( this->player_ == nullptr) {
+            orxout()<<"swag control"<< endl;
+
+              return false;
+            }
         }
         else
         {
-            orxout(verbose) << "ControllerDirector::preparationToTakeControl " 
+            orxout() << "ControllerDirector::preparationToTakeControl " 
               << "Not a player trigger, can't extract pawn from it.." << endl;
             return false;
Index: code/branches/presentationFS16/src/orxonox/controllers/ControllerDirector.h
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/ControllerDirector.h	(revision 11206)
+++ code/branches/presentationFS16/src/orxonox/controllers/ControllerDirector.h	(revision 11207)
@@ -27,4 +27,10 @@
  */
 
+/*
+@todo:
+
+in the take control or preparationToTakeControl functions remove the former controller and store it somewhere so it can be put back later.
+
+*/
 #ifndef _ControllerDirector_H__
 #define _ControllerDirector_H__
Index: code/branches/presentationFS16/src/orxonox/controllers/NewScriptController.cc
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/NewScriptController.cc	(revision 11207)
+++ code/branches/presentationFS16/src/orxonox/controllers/NewScriptController.cc	(revision 11207)
@@ -0,0 +1,293 @@
+/*
+ *   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:
+ *      Paul Lehmann
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+ /*
+  * Currently available lua commands:
+  *
+  * IMPORTANT: ALL COMMANDS DO REQUIRE 7 PARAMETERS TO BE PROVIDED. FILL UP WITH ZEROES IN UNIMPORTANT PLACES.
+  *
+  * 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=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
+  */
+
+#include "NewScriptController.h"
+
+#include "scriptTasks/DebugTask.h"
+#include "scriptTasks/stringOutTask.h"
+#include "scriptTasks/MoveToTask.h"
+#include "scriptTasks/Task.h"
+#include "infos/PlayerInfo.h"
+#include "core/CoreIncludes.h"
+#include "worldentities/ControllableEntity.h"
+#include "core/LuaState.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+    RegisterClass(NewScriptController);
+
+    NewScriptController::NewScriptController(Context* context) : ArtificialController(context)
+    {
+        RegisterObject(NewScriptController);
+
+
+        // Set default values for all variables 
+        // - pointers to zero 
+        this->player_ = nullptr;
+        this->entity_ = nullptr;
+
+        // - times
+        this->scTime_ = 0.0f;
+
+        this->context_ = context;
+
+        
+    }
+
+
+
+    void NewScriptController::takeControl(int ctrlid)
+    {
+        // Output some debugging information 
+        orxout(verbose) << "NewScriptController: Taking control" << endl;
+        orxout(verbose) << "This-pointer: " << this << endl; 
+
+
+        // Store the entity pointer in a private variable
+        this->entity_ = this->player_->getControllableEntity();
+        assert(this->entity_);
+
+        this->ctrlid_ = ctrlid;
+        if (this->ctrlid_ == 0)
+        {
+          this->ctrlid_ = 1;
+        }
+         
+        // Add the controller here to this entity. Apparently this still leaves
+        // any preexisting human controllers in place. 
+         
+        this->entity_->setDestroyWhenPlayerLeft(false);
+        this->player_->stopTemporaryControl();
+        this->entity_->setController(this);
+        this->setControllableEntity(this->entity_);
+        this->entity_->mouseLook();
+        this->entity_->setVisible(true);
+        
+        // TODO take the human Controllers control  dont forget to give it back in the destructor
+    }
+
+
+    void NewScriptController::tick(float dt)
+    {
+        // Call the tick function of the classes we derive from 
+        SUPER(NewScriptController, tick, dt);
+
+
+        // If this controller has no entity entry, do nothing 
+        if( !(this->entity_) ) return;
+
+        if(!this->taskList_.empty())
+        {
+           orxout() << scTime_ << endl;
+
+           orxout() << taskList_.size() << endl;
+
+
+          if(this->taskList_.front()->getStartTime() < this->scTime_)
+          {
+              activeTasks_.push_back(this->taskList_.front());
+              this->taskList_.pop_front();
+          }
+        }
+        else
+        {
+          orxout() << "no tasks in taskList_" << endl;
+        }
+
+        std::vector<Task*>::iterator it = activeTasks_.begin();
+        while (it != activeTasks_.end() )
+        {
+          if( !((*it)->update(dt)) )
+          {
+            (*(*it)).destroyLater();
+            it = activeTasks_.erase(it);
+          }
+          else
+          {
+            it++;
+          }
+
+        }
+
+
+
+        scTime_ += dt;
+    }
+
+    void NewScriptController::debugOut(float startTime)
+    {
+
+      DebugTask* task = new DebugTask(context_);
+
+      task->initialize(startTime);
+
+      bool inserted = false;
+
+      if(taskList_.empty())
+      {
+        taskList_.push_front(task);
+        inserted = true;
+      }
+
+      else
+      {
+        for (std::list<Task*>::iterator it = taskList_.begin(); it != taskList_.end(); it++) // insert sorted by starttime
+        {
+          orxout() << "debugOutTask" << endl;
+
+          if(task->getStartTime() < (*it)->getStartTime() )
+          {
+            taskList_.insert(it, task);
+            inserted = true;
+            break;
+          }
+        }
+      }
+
+      if (!inserted)
+      {
+        taskList_.push_back(task);
+      }
+      
+    }
+
+    void NewScriptController::stringOut(float startTime, std::string output)
+    {
+
+      stringOutTask* task = new stringOutTask(context_);
+
+      task->initialize(startTime, output);
+
+      bool inserted = false;
+
+      if(taskList_.empty())
+      {
+        taskList_.push_front(task);
+        inserted = true;
+      }
+
+      else
+      {
+        for (std::list<Task*>::iterator it = taskList_.begin(); it != taskList_.end(); it++) // insert sorted by starttime
+        {
+          orxout() << "stringOutTask" << endl;
+
+          if(task->getStartTime() < (*it)->getStartTime() )
+          {
+            taskList_.insert(it, task);
+            inserted = true;
+            break;
+          }
+        }
+      }
+
+      if (!inserted)
+      {
+        taskList_.push_back(task);
+      }
+
+    }
+
+    void NewScriptController::moveTo(float startTime, float x, float y, float z, float velocity)
+    {
+
+      MoveToTask* task = new MoveToTask(context_);
+
+      Vector3 destination = Vector3(x,y,z);
+
+      task->initialize(startTime, player_, destination, velocity);
+
+      bool inserted = false;
+
+      if(taskList_.empty())
+      {
+        taskList_.push_front(task);
+        inserted = true;
+      }
+
+      else
+      {
+        for (std::list<Task*>::iterator it = taskList_.begin(); it != taskList_.end(); it++) // insert sorted by starttime
+        {
+          orxout() << "stringOutTask" << endl;
+
+          if(task->getStartTime() < (*it)->getStartTime() )
+          {
+            taskList_.insert(it, task);
+            inserted = true;
+            break;
+          }
+        }
+      }
+
+      if (!inserted)
+      {
+        taskList_.push_back(task);
+      }
+
+    }
+
+    NewScriptController* NewScriptController::getNewScriptController() 
+    {
+      /* Output a message that confirms this function was called */
+      orxout() << "Great success!" << std::endl;
+
+      /* Debugging: print all the scriptcontroller object pointers */
+      for(NewScriptController* controller : ObjectList<NewScriptController>())
+      { orxout() << "Have object in list: " << controller << endl; }
+
+      /* Find the first one with a nonzero ID */
+      for(NewScriptController* controller : ObjectList<NewScriptController>())
+      { 
+        // TODO: do some selection here. Currently just returns the first one
+        if( controller->getID() > 0 )
+        { orxout() << "Controller to return: " << controller << endl;
+          return controller;
+        }
+      
+      }
+      return nullptr;
+    }
+
+}
Index: code/branches/presentationFS16/src/orxonox/controllers/NewScriptController.h
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/NewScriptController.h	(revision 11207)
+++ code/branches/presentationFS16/src/orxonox/controllers/NewScriptController.h	(revision 11207)
@@ -0,0 +1,125 @@
+/*
+ *   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:
+ *      Paul Lehmann
+ *   Co-authors:
+ *      ...
+ *
+ *
+ *
+ */
+
+#ifndef _NewScriptController_H__
+#define _NewScriptController_H__
+
+#include "scriptTasks/DebugTask.h"
+#include "scriptTasks/stringOutTask.h"
+#include "scriptTasks/MoveToTask.h"
+#include "scriptTasks/Task.h"
+#include "OrxonoxPrereqs.h"                 /* die ganzen tolua, kopiert aus Dock.h*/
+#include "ArtificialController.h"
+#include "core/EventIncludes.h"
+
+
+
+namespace orxonox  // tolua_export
+{  // tolua_export
+
+    /**
+    @brief
+
+    A scriptController to carry out tasks on an entity.
+    The tasks are provided as a lua script.
+    The commands which are exported to lua have to create the specified task, initialze it and add it to the TaskList.
+
+    Important add the export comment after functions that need to be accessed from the lua script.
+
+    @todo
+
+    take away the human controller and put it back into place when this controller is deleted.
+    This is probably better done in the controller director class.
+
+    remove the startTimes of the tasks so that the lua script is just carried out one task after the other.
+    to avoid problems when to tasks are carried out simultainiously.
+
+    also the velocity while the controller is taking control is kept and hinders the tasks.
+
+    the moveToTask does not work right.
+    */
+
+    class _OrxonoxExport NewScriptController // tolua_export 
+       : public ArtificialController, public Tickable
+    {  // tolua_export
+        public:
+            NewScriptController(Context* context);
+            virtual ~NewScriptController() { }
+
+            void takeControl(int ctrlid);
+            void setPlayer(PlayerInfo* player) { this->player_ = player; }
+           
+            virtual void tick(float dt) override;
+
+            // LUA interface
+
+            void debugOut(float startTime);// tolua_export
+
+            void stringOut(float startTime, std::string output);// tolua_export
+
+            void moveTo(float startTime, float x, float y, float z, float velocity);// tolua_export
+
+            static NewScriptController* getNewScriptController();// tolua_export 
+
+            int getID() { return ctrlid_; }// tolua_export 
+
+            void printDebug() {orxout() << "fffff" << endl;} // tolua_export
+
+        private:
+            // Information about the player that this ScriptController will
+            // control 
+            // - Player pointer 
+            PlayerInfo* player_;
+
+            // - Entity pointer, this is for convenience and will be the same as 
+            //   player_->getControllableEntity() 
+            ControllableEntity* entity_;
+
+            // Controller ID, defaults to 0 and is set using takeControl() 
+            int ctrlid_;
+
+            // List of events to walk through sorted by starting times
+            std::list<Task*> taskList_;
+
+            //List of Tasks currently active 
+            std::vector<Task*> activeTasks_;
+
+            // Time since the creation of this ScriptController object
+            float scTime_;  
+
+
+            // context of the Controller to create the tasks
+            Context* context_;
+
+
+    };// tolua_export
+} // tolua_export
+
+#endif /* _NewScriptController_H__ */
Index: code/branches/presentationFS16/src/orxonox/controllers/ScriptController.cc
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/ScriptController.cc	(revision 11206)
+++ code/branches/presentationFS16/src/orxonox/controllers/ScriptController.cc	(revision 11207)
@@ -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
   */
@@ -46,5 +47,4 @@
 #include "worldentities/ControllableEntity.h"
 #include "core/LuaState.h"
-#include "core/LuaState.h"
 #include "util/Math.h"
 
@@ -90,5 +90,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,9 +103,11 @@
          */
         this->entity_->setDestroyWhenPlayerLeft(false);
-        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
     }
 
@@ -201,7 +203,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
@@ -221,9 +321,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;
@@ -250,7 +350,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);
@@ -258,85 +360,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/presentationFS16/src/orxonox/controllers/ScriptController.h
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/ScriptController.h	(revision 11206)
+++ code/branches/presentationFS16/src/orxonox/controllers/ScriptController.h	(revision 11207)
@@ -36,6 +36,6 @@
 
 
-namespace orxonox  // tolua_export
-{  // tolua_export
+namespace orxonox  
+{  
 
     /** Structure to describe a single event */
@@ -61,7 +61,7 @@
     }; 
 
-    class _OrxonoxExport ScriptController // tolua_export 
+    class _OrxonoxExport ScriptController  
        : public ArtificialController, public Tickable
-    {  // tolua_export
+    {  
         public:
             ScriptController(Context* context);
@@ -73,6 +73,5 @@
             virtual void tick(float dt) override;
 
-            // LUA interface
-            // tolua_begin 
+           
             void eventScheduler(std::string instruction = "", 
               float x1 = 0, float y1 = 0, float z1 = 0, 
@@ -84,5 +83,5 @@
             int getID() { return ctrlid_; }
 
-            // tolua_end
+           
             const Vector3& getPosition();
 
@@ -128,6 +127,24 @@
             //Vector3 lookAtPosition;
 
-    };// tolua_export
-} // tolua_export
+
+            /* 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);
+
+    };
+} 
 
 #endif /* _ScriptController_H__ */
Index: code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/CMakeLists.txt
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/CMakeLists.txt	(revision 11207)
+++ code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/CMakeLists.txt	(revision 11207)
@@ -0,0 +1,6 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  Task.cc
+  DebugTask.cc
+  stringOutTask.cc
+  MoveToTask.cc
+)
Index: code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/DebugTask.cc
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/DebugTask.cc	(revision 11207)
+++ code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/DebugTask.cc	(revision 11207)
@@ -0,0 +1,62 @@
+/*
+ *   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:
+ *      Paul Lehmann
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#include "DebugTask.h"
+
+#include "infos/PlayerInfo.h"
+#include "controllers/ArtificialController.h"
+#include "tools/interfaces/Tickable.h"
+
+namespace orxonox
+{
+   
+    RegisterClass(DebugTask);
+
+    DebugTask::DebugTask(Context* context): Task(context)
+    {
+        RegisterObject(DebugTask);
+        counter = 0;
+    }
+
+    bool DebugTask::update(float dt)
+    {
+    	orxout() << "*" << endl;
+
+    	if (counter == 10)
+    	{
+    		return false;
+    	}
+    	else
+    	{
+    		counter++;
+    		return true;
+    	}
+    }
+
+}
Index: code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/DebugTask.h
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/DebugTask.h	(revision 11207)
+++ code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/DebugTask.h	(revision 11207)
@@ -0,0 +1,57 @@
+/*
+ *   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:
+ *      Paul Lehmann
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _DebugTask_H__
+#define _DebugTask_H__
+
+#include "infos/PlayerInfo.h"
+#include "controllers/ArtificialController.h"
+#include "tools/interfaces/Tickable.h"
+#include "Task.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport DebugTask : public Task
+    {
+        public:
+            DebugTask(Context* context);
+            virtual ~DebugTask(){}
+
+            void initialize(float startTime)
+                {this->startTime_ = startTime;}
+
+            virtual bool update(float dt) override;
+
+        private:
+
+            int counter;
+
+    };
+}
+
+#endif /* _DebugTask_H__ */
Index: code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/MoveToTask.cc
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/MoveToTask.cc	(revision 11207)
+++ code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/MoveToTask.cc	(revision 11207)
@@ -0,0 +1,80 @@
+/*
+ *   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:
+ *      Paul Lehmann
+ *   Co-authors:
+ *      ..
+ *
+ */
+
+
+#include "MoveToTask.h"
+
+#include "infos/PlayerInfo.h"
+#include "controllers/ArtificialController.h"
+
+namespace orxonox
+{
+   
+    RegisterClass(MoveToTask);
+
+    MoveToTask::MoveToTask(Context* context): Task(context)
+    {
+        RegisterObject(MoveToTask);
+    }
+
+    void MoveToTask::initialize(float startTime, PlayerInfo* player, Vector3 destination, float velocity)
+    {
+        this->startTime_ = startTime;
+        this->player_ = player;
+        this->entity_ = this->player_->getControllableEntity();
+        this->destination_ = destination;
+        this->velocity_ = velocity;
+        this->entity_->setVelocity( Vector3(0,0,0) );
+        // unit vector in the direction of travel
+        this->direction_ = (destination - this->entity_->getPosition() )/( (destination - this->entity_->getPosition() ).length() );
+
+    }
+
+    bool MoveToTask::update(float dt)
+    {
+
+        /* Look at the specified position */
+        this->entity_->lookAt(this->destination_);  
+
+        this->entity_->setPosition(this->entity_->getPosition() + velocity_ * dt * direction_);
+
+        //this->entity_->setVelocity( Vector3(0,0,0) );
+
+        orxout() << (this->entity_->getPosition() - destination_ ).length() << endl;
+
+        if ((this->entity_->getPosition() - destination_ ).length() > 30)
+        {
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+
+}
Index: code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/MoveToTask.h
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/MoveToTask.h	(revision 11207)
+++ code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/MoveToTask.h	(revision 11207)
@@ -0,0 +1,72 @@
+/*
+ *   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:
+ *      Paul Lehmann
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _MoveToTask_H__
+#define _MoveToTask_H__
+
+#include "infos/PlayerInfo.h"
+#include "controllers/ArtificialController.h"
+#include "tools/interfaces/Tickable.h"
+#include "Task.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport MoveToTask : public Task
+    {
+        public:
+            MoveToTask(Context* context);
+            virtual ~MoveToTask(){}
+
+            void initialize(float startTime, PlayerInfo* player, Vector3 destination, float velocity);
+
+            virtual bool update(float dt) override;
+
+        private:
+
+            std::string output_;
+
+            // Information about the player that this ScriptController will
+            // control 
+            // - Player pointer 
+            PlayerInfo* player_;
+
+            // - Entity pointer, this is for convenience and will be the same as 
+            //   player_->getControllableEntity() 
+            ControllableEntity* entity_;
+
+            Vector3 direction_;
+
+            Vector3 destination_;
+
+            // velocitz in m/s
+            float velocity_;
+
+    };
+}
+
+#endif /* _MoveToTask_H__ */
Index: code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/Task.cc
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/Task.cc	(revision 11207)
+++ code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/Task.cc	(revision 11207)
@@ -0,0 +1,51 @@
+/*
+ *   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:
+ *      Paul Lehmann
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#include "Task.h"
+
+#include "infos/PlayerInfo.h"
+#include "tools/interfaces/Tickable.h"
+
+namespace orxonox
+{
+   
+    RegisterClass(Task);
+
+    Task::Task(Context* context) : BaseObject(context)
+    {
+        RegisterObject(Task);
+        startTime_ = -1;
+    }
+
+    void Task::initialize(float startTime)
+    {
+    	startTime_ = startTime;
+    }
+
+}
Index: code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/Task.h
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/Task.h	(revision 11207)
+++ code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/Task.h	(revision 11207)
@@ -0,0 +1,61 @@
+/*
+ *   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:
+ *      Paul Lehmann
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Task_H__
+#define _Task_H__
+
+#include "infos/PlayerInfo.h"
+#include "tools/interfaces/Tickable.h"
+//#include "core/class/OrxonoxClass.h"
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Task : public BaseObject {
+   
+        public:
+            Task(Context* context);
+            virtual ~Task(){}
+
+            //this function needs to be called otherwise the task is never carried out
+            void initialize(float startTime);
+
+            //important return true while the task is running and false to stop it!!!
+            virtual bool update(float dt) {return false;} 
+
+            float getStartTime()
+                {return startTime_;}
+
+       //private:
+
+        	float startTime_;
+
+    };
+}
+
+#endif /* _Task_H__ */
Index: code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/stringOutTask.cc
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/stringOutTask.cc	(revision 11207)
+++ code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/stringOutTask.cc	(revision 11207)
@@ -0,0 +1,51 @@
+/*
+ *   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:
+ *      Paul Lehmann
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#include "stringOutTask.h"
+
+#include "infos/PlayerInfo.h"
+#include "controllers/ArtificialController.h"
+
+namespace orxonox
+{
+   
+    RegisterClass(stringOutTask);
+
+    stringOutTask::stringOutTask(Context* context): Task(context)
+    {
+        RegisterObject(stringOutTask);
+    }
+
+    bool stringOutTask::update(float dt)
+    {
+    	orxout() << output_ << endl;
+        return false;
+    }
+
+}
Index: code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/stringOutTask.h
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/stringOutTask.h	(revision 11207)
+++ code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/stringOutTask.h	(revision 11207)
@@ -0,0 +1,57 @@
+/*
+ *   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:
+ *      Paul Lehmann
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _stringOutTask_H__
+#define _stringOutTask_H__
+
+#include "infos/PlayerInfo.h"
+#include "controllers/ArtificialController.h"
+#include "tools/interfaces/Tickable.h"
+#include "Task.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport stringOutTask : public Task
+    {
+        public:
+            stringOutTask(Context* context);
+            virtual ~stringOutTask(){}
+
+            void initialize(float startTime, std::string output)
+                {this->startTime_ = startTime; this->output_ = output;}
+
+            virtual bool update(float dt) override;
+
+        private:
+
+            std::string output_;
+
+    };
+}
+
+#endif /* _stringOutTask_H__ */
