Index: code/branches/ScriptableController/src/orxonox/controllers/ControllerDirector.cc
===================================================================
--- code/branches/ScriptableController/src/orxonox/controllers/ControllerDirector.cc	(revision 10057)
+++ code/branches/ScriptableController/src/orxonox/controllers/ControllerDirector.cc	(revision 10059)
@@ -91,5 +91,5 @@
        tmp << "newctrlid = " << ctrlid;
        std::string todo = tmp.str();
-
+       
        /* Run the string using the luastate created earlier */
        ls->doString(todo);
Index: code/branches/ScriptableController/src/orxonox/controllers/ScriptController.cc
===================================================================
--- code/branches/ScriptableController/src/orxonox/controllers/ScriptController.cc	(revision 10057)
+++ code/branches/ScriptableController/src/orxonox/controllers/ScriptController.cc	(revision 10059)
@@ -125,4 +125,7 @@
     void ScriptController::tick(float dt)
     {
+
+        
+
         /* If this controller has no entity entry, do nothing */
         if( !(this->entity_) )
@@ -152,4 +155,6 @@
     void ScriptController::moveToPosition_beta(float x, float y, float z )
     {
+
+        orxout()<<"moveToPosition_beta executed"<<endl;
         //const Vector3 local = this->getPosition();
         const Vector3 target = Vector3(100*x,100*y,100*z);
@@ -158,8 +163,20 @@
        
         
-        this->entity_->lookAt(target);
-        this->entity_->moveFrontBack(-1000*target.length());      
-
-  
+        //this->entity_->lookAt(target);
+        //this->entity_->moveFrontBack(-1000*target.length());      
+
+        if(this->entity_!=NULL)
+            orxout()<<"not-NULL-entity"<<endl;
+
+        if(this->player_!=NULL)
+            orxout()<<"not-NULL-player"<<endl;
+
+        orxout() << this->player_->getClientID() << endl; // IMPOSSIBLE TO ACCESS this->player AND this->entity
+        
+        //this->entity_ = this->player_->getClientID();//getControllableEntity();
+
+            //if(this->entity_==this->player_->getControllableEntity())
+            //orxout()<<"same entity"<<endl;
+
         /* This works fine */
         orxout()<<x<<"  "<<y<<"  "<<z<<endl;
@@ -168,4 +185,5 @@
     void ScriptController::eventScheduler(std::string instruction, float x, float y, float z, float executionTime)
     {
+
 
         /*put data (from LUA) into time-sorted eventList*/ 
@@ -178,23 +196,32 @@
         tmp.eventTime=executionTime;
 
-        for(unsigned int i=0;i<eventList.size();i++)
+        orxout()<<tmp.fctName<<endl;
+
+        if(eventList.size()==0)
         {
-            if(tmp.eventTime<eventList[i].eventTime)
+            orxout()<<"eventList empty (01)"<<endl;
+            eventList.insert(eventList.begin(), tmp);
+            orxout()<<"first event added"<<endl;
+        }
+
+
+       for (std::vector<event>::iterator it=eventList.begin(); it<eventList.end(); it++)
             {
-                std::vector<event>::iterator it = eventList.begin();
-
-                eventList.insert(it+(i+1),tmp);
-                break;
+
+                if(tmp.eventTime<it->eventTime)
+                {
+                    eventList.insert(it,tmp);
+                    orxout()<<"new event added"<<endl;
+                }
+
             }
-            if(i==eventList.size()-1)
-            {
-                std::vector<event>::iterator it = eventList.end();
-
-                eventList.insert(it,tmp);
-
-            }
-
-        }
-        
+
+       
+       if(eventList.size()==0)
+            orxout()<<"eventList empty"<<endl;
+
+        else
+            orxout()<<"eventList is not empty"<<endl;
+
         
     }
Index: code/branches/ScriptableController/src/orxonox/controllers/ScriptController.h
===================================================================
--- code/branches/ScriptableController/src/orxonox/controllers/ScriptController.h	(revision 10057)
+++ code/branches/ScriptableController/src/orxonox/controllers/ScriptController.h	(revision 10059)
@@ -64,4 +64,6 @@
             void setPlayer(PlayerInfo* player) { this->player_ = player; }
            
+           
+
             //void set_luasrc(std::string);
             //void set_controlled(ControllableEntity*);
