Index: code/branches/plehmannFS16/src/orxonox/controllers/CMakeLists.txt
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/CMakeLists.txt	(revision 11152)
+++ code/branches/plehmannFS16/src/orxonox/controllers/CMakeLists.txt	(revision 11165)
@@ -19,3 +19,5 @@
   FightingController.cc
   MasterController.cc
+  NewScriptController.cc
+  Task.cc
 )
Index: code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.cc
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.cc	(revision 11165)
+++ code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.cc	(revision 11165)
@@ -0,0 +1,54 @@
+/*
+ *   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() : isRunning_(false)
+    {
+        RegisterObject(DebugTask);
+    }
+    DebugTask::DebugTask(float startTime) : isRunning_(false)
+    {
+        RegisterObject(DebugTask);
+        startTime_ = startTime;
+    }
+
+
+    
+
+}
Index: code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.h
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.h	(revision 11165)
+++ code/branches/plehmannFS16/src/orxonox/controllers/DebugTask.h	(revision 11165)
@@ -0,0 +1,52 @@
+/*
+ *   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"
+
+namespace orxonox
+{
+    class _OrxonoxExport Task : public Task
+    {
+        public:
+            DebugTask();
+            DebugTask(float startTime)
+            virtual ~Task();
+
+            virtual void tick(float dt) override;
+
+        private:
+
+    };
+}
+
+#endif /* _DebugTask_H__ */
Index: code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.cc
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.cc	(revision 11165)
+++ code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.cc	(revision 11165)
@@ -0,0 +1,137 @@
+/*
+ *   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 "Task.h"
+#include "infos/PlayerInfo.h"
+#include "core/CoreIncludes.h"
+#include "worldentities/ControllableEntity.h"
+#include "core/LuaState.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;
+
+    }
+
+    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_);
+         
+        /* 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(false);
+        
+        // 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(ScriptController, tick, dt);
+
+        /* 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 */
+        if(this->taskList_->size() > 0 && this->taskList_->front().getStartTime() <= scTime_)
+        { /* Execute the next event on the list */
+          activeTasks_->push_back(taskList_->front());
+          taskList_->pop();
+        }
+
+        /* Update the local timers in this object */
+        scTime_ += dt;
+
+        /* tick active tasks and delete completed tasks */
+        for(std::vector<Task>::iterator it = activeTasks_->begin(); it != activeTasks_->end(); it++)
+        {
+          it->tick(dt);
+          if ( !(it->getIsRunning()) )
+          {
+            activeTasks_->erase(it);
+            it--;
+          }
+
+        }
+
+    }
+
+
+    void NewScriptController::createAndAddTask(Task newTask)
+    {
+      taskList_->push(newTask);
+    }
+
+
+}
Index: code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.h
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.h	(revision 11165)
+++ code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.h	(revision 11165)
@@ -0,0 +1,86 @@
+/*
+ *   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 "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
+
+
+
+    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
+            // tolua_begin 
+
+            void createAndAddTask(Task newTask);
+
+        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_;
+
+            /* List of events to walk through */
+            std::queue<Task>* taskList_;
+
+
+            /*List of Tasks currently active */
+            std::vector<Task>* activeTasks_;
+
+            /* Time since the creation of this ScriptController object */
+            float scTime_;  
+
+
+    };// tolua_export
+} // tolua_export
+
+#endif /* _NewScriptController_H__ */
Index: code/branches/plehmannFS16/src/orxonox/controllers/Task.cc
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/Task.cc	(revision 11165)
+++ code/branches/plehmannFS16/src/orxonox/controllers/Task.cc	(revision 11165)
@@ -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:
+ *      Paul Lehmann
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#include "Task.h"
+
+#include "infos/PlayerInfo.h"
+#include "controllers/ArtificialController.h"
+#include "tools/interfaces/Tickable.h"
+
+namespace orxonox
+{
+   
+    RegisterClass(Task);
+
+    Task::Task() : isRunning_(false)
+    {
+        RegisterObject(Task);
+    }
+
+    
+
+}
Index: code/branches/plehmannFS16/src/orxonox/controllers/Task.h
===================================================================
--- code/branches/plehmannFS16/src/orxonox/controllers/Task.h	(revision 11165)
+++ code/branches/plehmannFS16/src/orxonox/controllers/Task.h	(revision 11165)
@@ -0,0 +1,64 @@
+/*
+ *   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 "controllers/ArtificialController.h"
+#include "tools/interfaces/Tickable.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Task : public Tickable
+    {
+        public:
+            Task();
+            virtual ~Task();
+
+            virtual void tick(float dt) override;
+
+            void setIsRunning(bool shouldBeRunning)
+                {isRunning_ = shouldBeRunning;}
+
+            bool getIsRunning()
+                {return isRunning_;}
+
+            float getStartTime()
+                {return startTime_;}
+
+        private:
+
+        	bool isRunning_;
+
+        	float startTime_;
+
+    };
+}
+
+#endif /* _Task_H__ */
