Index: code/trunk/src/orxonox/controllers/ControllerDirector.cc
===================================================================
--- code/trunk/src/orxonox/controllers/ControllerDirector.cc	(revision 10294)
+++ code/trunk/src/orxonox/controllers/ControllerDirector.cc	(revision 10622)
@@ -41,4 +41,5 @@
     {
         SUPER(ControllerDirector, XMLPort, xmlelement, mode);
+        XMLPortParam(ControllerDirector, "scriptname", setScriptName, getScriptName, xmlelement, mode).defaultValues("testscript");
 
         orxout(verbose)<< "ControllerDirector::XMLPort " 
@@ -83,5 +84,5 @@
        else
          return;
-       
+
        /* Set up a luastate to use for running the scripts */
        LuaState * ls = new LuaState();
@@ -98,6 +99,6 @@
         * variable "newctrlid" defined, which means it can make use of it.
         */
-
-       ls->doFile("testscript.lua");
+       std::string scr = this->scriptname_ + ".lua";
+       ls->doFile(scr);
 
        /* Increase the controller ID so we have a different one for
Index: code/trunk/src/orxonox/controllers/ControllerDirector.h
===================================================================
--- code/trunk/src/orxonox/controllers/ControllerDirector.h	(revision 10294)
+++ code/trunk/src/orxonox/controllers/ControllerDirector.h	(revision 10622)
@@ -47,4 +47,7 @@
             virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
 
+            inline void setScriptName(const std::string& name) { this->scriptname_ = name; }
+            inline const std::string& getScriptName() const { return this->scriptname_; }
+
 
             /* Take over control of a given object */
@@ -55,5 +58,6 @@
             //void setNewController(Controller * controller);
 
-        private:
+        protected:
+            std::string scriptname_;   
             PlayerInfo* player_;
             ControllableEntity* entity_; 
Index: code/trunk/src/orxonox/controllers/FormationController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/FormationController.cc	(revision 10294)
+++ code/trunk/src/orxonox/controllers/FormationController.cc	(revision 10622)
@@ -955,4 +955,6 @@
     bool FormationController::sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype)
     {
+
+
         if (entity1 == entity2)
             return true;
@@ -984,5 +986,5 @@
         }
 
-        TeamDeathmatch* tdm = orxonox_cast<TeamDeathmatch*>(gametype);
+        TeamGametype* tdm = orxonox_cast<TeamGametype*>(gametype);
         if (tdm)
         {
@@ -992,14 +994,4 @@
             if (entity2->getPlayer())
                 team2 = tdm->getTeam(entity2->getPlayer());
-        }
-
-        Mission* miss = orxonox_cast<Mission*>(gametype);
-        if (miss)
-        {
-            if (entity1->getPlayer())
-                team1 = miss->getTeam(entity1->getPlayer());
-
-            if (entity2->getPlayer())
-                team2 = miss->getTeam(entity2->getPlayer());
         }
 
Index: code/trunk/src/orxonox/controllers/ScriptController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/ScriptController.cc	(revision 10294)
+++ code/trunk/src/orxonox/controllers/ScriptController.cc	(revision 10622)
@@ -21,9 +21,23 @@
  *
  *   Author:
- *      Fabian 'x3n' Landau
+ *      ...
  *   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=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
+  * "Idle (Do nothing)" | idle         | Duration
+  */
 
 #include "ScriptController.h"
@@ -32,5 +46,6 @@
 #include "worldentities/ControllableEntity.h"
 #include "core/LuaState.h"
-#include <cmath>
+#include "core/LuaState.h"
+#include "util/Math.h"
 
 namespace orxonox
@@ -66,4 +81,7 @@
         this->eventno = 0;
 
+        /* - First "previous event" scheduled at t=0 */
+        /* - Needed for automatically updating event times */
+        this->prevEventTime = 0;
     }
 
@@ -178,13 +196,64 @@
 
         /* Get a variable that specifies how far along the trajectory
-         * we are 
+         * we are currently.
          */
         float dl = eventTime / currentEvent.duration; 
 
-        /* Depending  */
+        /* Depending on command */
         /* Do some moving */
         if( this->processing )
-        { 
-          if( this->currentEvent.fctName == "mal" )
+        {
+          // Abbreviation for "spiral" (rotation + translation)
+          if (this->currentEvent.fctName == "spi") {
+
+            // 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
+            // TODO: Add an option to adjust radius of spiral movement
+            Vector3 direction = this->currentEvent.v1 - startpos;
+
+            Vector3* ortho1 = new Vector3(direction.y, -direction.x, 0);
+            float absOrtho1 = sqrt(direction.y * direction.y + direction.x * direction.x);
+            *ortho1 = 400 * cos(2 * math::pi * dl) * (*ortho1)/absOrtho1;
+
+            Vector3* ortho2 = new Vector3(0, direction.z, -direction.y);
+            float absOrtho2 = sqrt(direction.y * direction.y + direction.z * direction.z);
+            *ortho2 = 400 * sin(2 * math::pi * dl) * (*ortho2)/absOrtho2;
+
+            this->entity_->setPosition( (1-dl)*startpos + dl * this->currentEvent.v1 + *ortho1 + *ortho2);
+
+            delete ortho1;
+            delete ortho2;
+          }
+
+          // Abbreviation for "rotate and look"
+          if (this->currentEvent.fctName == "ral")
+          { 
+            // Specify the axis
+            Vector3* a;
+              switch ((int) currentEvent.d) {
+                case 3:
+                  a = new Vector3(this->currentEvent.v1.x + this->currentEvent.e*cos(2*math::pi*dl),
+                                  this->currentEvent.v1.y + this->currentEvent.e*sin(2*math::pi*dl),
+                                  this->currentEvent.v1.z);
+                break;
+                case 2:
+                  a = new Vector3(this->currentEvent.v1.x + this->currentEvent.e*sin(2*math::pi*dl),
+                                  this->currentEvent.v1.y,
+                                  this->currentEvent.v1.z + this->currentEvent.e*cos(2*math::pi*dl));
+                break;
+                case 1:
+                  a = new Vector3(this->currentEvent.v1.x,
+                                  this->currentEvent.v1.y + this->currentEvent.e*sin(2*math::pi*dl),
+                                  this->currentEvent.v1.z + this->currentEvent.e*cos(2*math::pi*dl));
+                break;
+              }
+
+            this->entity_->setPosition(*a);
+
+            /* Look at the specified position */
+            this->entity_->lookAt(this->currentEvent.v1);
+          }
+          else if( this->currentEvent.fctName == "mal" )
           {
             /* Set the position to the correct place in the trajectory */
@@ -193,7 +262,4 @@
             /* Look at the specified position */
             this->entity_->lookAt(this->currentEvent.v2);
-
-            /* Update look at position */
-            //this->lookAtPosition = this->currentEvent.v2;
           }
           else if( this->currentEvent.fctName == "chl" )
@@ -224,12 +290,31 @@
       /* 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;
-      tmp.eventTime = executionTime;
-
-      orxout(verbose) << tmp.fctName << endl;
+
+      /* 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 */
Index: code/trunk/src/orxonox/controllers/ScriptController.h
===================================================================
--- code/trunk/src/orxonox/controllers/ScriptController.h	(revision 10294)
+++ code/trunk/src/orxonox/controllers/ScriptController.h	(revision 10622)
@@ -21,5 +21,5 @@
  *
  *   Author:
- *      Fabian 'x3n' Landau
+ *      ...
  *   Co-authors:
  *      ...
@@ -45,6 +45,12 @@
         std::string fctName;
 
+        /** Final position we want to be at **/
         Vector3 v1;
+
+        /** Where we are looking **/
         Vector3 v2;
+
+        /** The parameters are additionally stored as a set of 6 numerical values **/
+        float a, b, c, d, e, f;
 
         /** Time span of the event */
@@ -69,8 +75,8 @@
             // LUA interface
             // tolua_begin 
-            void eventScheduler(std::string instruction, 
-              float x1, float y1, float z1, 
-              float x2, float y2, float z2, 
-              float duration, float executionTime);
+            void eventScheduler(std::string instruction = "", 
+              float x1 = 0, float y1 = 0, float z1 = 0, 
+              float x2 = 0, float y2 = 0, float z2 = 0, 
+              float duration = 0, float executionTime = 0);
 
             static ScriptController* getScriptController();
@@ -116,4 +122,7 @@
             Vector3 startpos;
 
+            /* Time of the previously scheduled event */
+            float prevEventTime;
+
             /* - Position to look at during that transition */
             //Vector3 lookAtPosition;
Index: code/trunk/src/orxonox/controllers/testscript.lua
===================================================================
--- code/trunk/src/orxonox/controllers/testscript.lua	(revision 10294)
+++ code/trunk/src/orxonox/controllers/testscript.lua	(revision 10622)
@@ -1,1 +1,1 @@
-print	('1: Hello World')
+print ('1: Hello World')
