Index: code/branches/plehmannFS16/data/gui/scripts/testscript.lua
===================================================================
--- code/branches/plehmannFS16/data/gui/scripts/testscript.lua	(revision 11166)
+++ code/branches/plehmannFS16/data/gui/scripts/testscript.lua	(revision 11167)
@@ -18,10 +18,12 @@
 
 -- Get a local pointer to a scriptcontroller
-local ctrl = orxonox.ScriptController:getScriptController()
+local ctrl = orxonox.NewScriptController:getNewScriptController()
 
 -- If it worked, call its "movetoposition" function
 if ctrl ~= nil then
 
-  ctrl:eventScheduler("mal", xl,yl,zl, xl,yl,zl, 10)
+
+    ctrl:debugOut()
+  --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)
Index: code/branches/plehmannFS16/src/orxonox/controllers/CMakeLists.txt
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/CMakeLists.txt	(revision 11166)
+++ code/branches/plehmannFS16/src/orxonox/controllers/CMakeLists.txt	(revision 11167)
@@ -5,5 +5,5 @@
   ArtificialController.cc
   AIController.cc
-  ScriptController.cc
+  
   WaypointController.cc
   WaypointPatrolController.cc
Index: code/branches/plehmannFS16/src/orxonox/controllers/ControllerDirector.cc
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/ControllerDirector.cc	(revision 11166)
+++ code/branches/plehmannFS16/src/orxonox/controllers/ControllerDirector.cc	(revision 11167)
@@ -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 */
@@ -112,5 +112,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
@@ -125,5 +125,5 @@
         else
         {
-            orxout(verbose) << "ControllerDirector::preparationToTakeControl " 
+            orxout() << "ControllerDirector::preparationToTakeControl " 
               << "Not a player trigger, can't extract pawn from it.." << endl;
             return false;
Index: code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.cc
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.cc	(revision 11166)
+++ code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.cc	(revision 11167)
@@ -39,16 +39,14 @@
     RegisterClass(DebugTask);
 
-    DebugTask::DebugTask() : isRunning_(false)
+    DebugTask::DebugTask(Context* context) : isRunning_(false)
     {
         RegisterObject(DebugTask);
     }
-    DebugTask::DebugTask(float startTime) : isRunning_(false)
+
+    DebugTask::Tick(float dt)
     {
-        RegisterObject(DebugTask);
-        startTime_ = startTime;
+
+    	orxout() << "*" << endl;
     }
 
-
-    
-
 }
Index: code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.h
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.h	(revision 11166)
+++ code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.h	(revision 11167)
@@ -39,7 +39,9 @@
     {
         public:
-            DebugTask();
-            DebugTask(float startTime)
+            DebugTask(Context* context);
             virtual ~Task();
+
+            //this function needs to be called otherwise the task is never carriedout
+            initialize()
 
             virtual void tick(float dt) override;
Index: code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.cc
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.cc	(revision 11166)
+++ code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.cc	(revision 11167)
@@ -61,28 +61,38 @@
 
 
-        /* Set default values for all variables */
-        /* - pointers to zero */
+        // Set default values for all variables 
+        // - pointers to zero 
         this->player_ = nullptr;
         this->entity_ = nullptr;
 
-        /* - times */
+        // - times
         this->scTime_ = 0.0f;
+
+        //taskList_->push(new DebugTask);
 
     }
 
+
+
     void NewScriptController::takeControl(int ctrlid)
     {
-        /* Output some debugging information */
+        // Output some debugging information 
         orxout(verbose) << "NewScriptController: Taking control" << endl;
         orxout(verbose) << "This-pointer: " << this << endl; 
 
 
-        /* Store the entity pointer in a private variable */
+        // Store the entity pointer in a private variable
         this->entity_ = this->player_->getControllableEntity();
         assert(this->entity_);
+
+        this->ctrlid_ = ctrlid;
+        if (ctrlid_ == 0)
+        {
+          ctrlid_ = 1;
+        }
          
-        /* Add the controller here to this entity. Apparently this still leaves
-         * any preexisting human controllers in place. 
-         */
+        // Add the controller here to this entity. Apparently this still leaves
+        // any preexisting human controllers in place. 
+         
         this->entity_->setDestroyWhenPlayerLeft(false);
         this->player_->stopTemporaryControl();
@@ -98,21 +108,22 @@
     void NewScriptController::tick(float dt)
     {
-        /* Call the tick function of the classes we derive from */
-        SUPER(ScriptController, tick, 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 controller has no entity entry, do nothing 
         if( !(this->entity_) ) return;
 
-        /* See if time has come for the next event to be run */
+        // See if time has come for the next event to be run 
         if(this->taskList_->size() > 0 && this->taskList_->front().getStartTime() <= scTime_)
-        { /* Execute the next event on the list */
+        { // Execute the next event on the list 
           activeTasks_->push_back(taskList_->front());
           taskList_->pop();
         }
 
-        /* Update the local timers in this object */
+        // Update the local timers in this object 
         scTime_ += dt;
 
-        /* tick active tasks and delete completed tasks */
+        // tick active tasks and delete completed tasks 
         for(std::vector<Task>::iterator it = activeTasks_->begin(); it != activeTasks_->end(); it++)
         {
@@ -125,5 +136,5 @@
 
         }
-
+*/
     }
 
@@ -134,4 +145,30 @@
     }
 
+    void NewScriptController::debugOut()
+    {
+      orxout() << "NewScriptController: Taking control" << endl;
+    }
+
+    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/plehmannFS16/src/orxonox/controllers/NewScriptController.h
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.h	(revision 11166)
+++ code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.h	(revision 11167)
@@ -57,25 +57,35 @@
             // tolua_begin 
 
+            void debugOut();
+
+            static NewScriptController* getNewScriptController();
+
+            int getID() { return ctrlid_; }
+
+            //tolua_end
+
             void createAndAddTask(Task newTask);
 
         private:
-            /* Information about the player that this ScriptController will
-             * control */
-            /* - Player pointer */
+            // 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() 
-             */
+            // - Entity pointer, this is for convenience and will be the same as 
+            //   player_->getControllableEntity() 
             ControllableEntity* entity_;
 
-            /* List of events to walk through */
+            // Controller ID, defaults to 0 and is set using takeControl() 
+            int ctrlid_;
+
+            // List of events to walk through 
             std::queue<Task>* taskList_;
 
 
-            /*List of Tasks currently active */
+            //List of Tasks currently active 
             std::vector<Task>* activeTasks_;
 
-            /* Time since the creation of this ScriptController object */
+            // Time since the creation of this ScriptController object
             float scTime_;  
 
Index: code/branches/plehmannFS16/src/orxonox/controllers/ScriptController.h
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/ScriptController.h	(revision 11166)
+++ code/branches/plehmannFS16/src/orxonox/controllers/ScriptController.h	(revision 11167)
@@ -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();
 
@@ -146,6 +145,6 @@
             void rotX(float dl);
 
-    };// tolua_export
-} // tolua_export
+    };
+} 
 
 #endif /* _ScriptController_H__ */
Index: code/branches/plehmannFS16/src/orxonox/controllers/Task.cc
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/Task.cc	(revision 11166)
+++ code/branches/plehmannFS16/src/orxonox/controllers/Task.cc	(revision 11167)
@@ -31,5 +31,5 @@
 
 #include "infos/PlayerInfo.h"
-#include "controllers/ArtificialController.h"
+//#include "controllers/ArtificialController.h"
 #include "tools/interfaces/Tickable.h"
 
@@ -39,10 +39,23 @@
     RegisterClass(Task);
 
-    Task::Task() : isRunning_(false)
+    Task::Task(Context* context) : isRunning_(false)
     {
         RegisterObject(Task);
+        startTime_ = -1;
+    }
+    Task::~Task()
+    {
+
+    }
+/*
+    Task::initialize(float startTime)
+    {
+    	startTime_ = startTime;
+    }
+*/
+    void Task::tick(float dt)
+    {
+
     }
 
-    
-
 }
Index: code/branches/plehmannFS16/src/orxonox/controllers/Task.h
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/Task.h	(revision 11166)
+++ code/branches/plehmannFS16/src/orxonox/controllers/Task.h	(revision 11167)
@@ -31,5 +31,5 @@
 
 #include "infos/PlayerInfo.h"
-#include "controllers/ArtificialController.h"
+//#include "controllers/ArtificialController.h"
 #include "tools/interfaces/Tickable.h"
 
@@ -39,6 +39,9 @@
     {
         public:
-            Task();
+            Task(Context* context);
             virtual ~Task();
+
+            //this function needs to be called otherwise the task is never carriedout
+            //initialize();
 
             virtual void tick(float dt) override;
