Index: code/branches/ScriptableController_HS17/src/libraries/core/BaseObject.h
===================================================================
--- code/branches/ScriptableController_HS17/src/libraries/core/BaseObject.h	(revision 11562)
+++ code/branches/ScriptableController_HS17/src/libraries/core/BaseObject.h	(revision 11583)
@@ -193,5 +193,4 @@
             static void loadAllEventStates(Element& xmlelement, XMLPort::Mode mode, BaseObject* object, Identifier* identifier);
 
-            virtual void registerToScriptableController(ScriptableController *controller) {}
 
         protected:
Index: code/branches/ScriptableController_HS17/src/orxonox/Level.cc
===================================================================
--- code/branches/ScriptableController_HS17/src/orxonox/Level.cc	(revision 11562)
+++ code/branches/ScriptableController_HS17/src/orxonox/Level.cc	(revision 11583)
@@ -172,5 +172,4 @@
     {
         this->objects_.push_back(object);
-        object->registerToScriptableController(this->controller_.get());
     }
 
@@ -208,10 +207,4 @@
         orxout(internal_info) << "player entered level (id: " << player->getClientID() << ", name: " << player->getName() << ')' << endl;
         player->switchGametype(this->getGametype());
-
-        if(player->isHumanPlayer() && player->isLocalPlayer())
-        {
-            this->getScriptableController()->setPlayer(player);
-            this->controller_->runScript(this->level_script_);
-        }
     }
 
Index: code/branches/ScriptableController_HS17/src/orxonox/Level.h
===================================================================
--- code/branches/ScriptableController_HS17/src/orxonox/Level.h	(revision 11562)
+++ code/branches/ScriptableController_HS17/src/orxonox/Level.h	(revision 11583)
@@ -60,4 +60,7 @@
                 { return this->controller_.get(); }
 
+            inline const std::string &getScript(void)
+                { return this->level_script_; }
+
 
         private:
Index: code/branches/ScriptableController_HS17/src/orxonox/gamestates/GSLevel.cc
===================================================================
--- code/branches/ScriptableController_HS17/src/orxonox/gamestates/GSLevel.cc	(revision 11562)
+++ code/branches/ScriptableController_HS17/src/orxonox/gamestates/GSLevel.cc	(revision 11583)
@@ -100,4 +100,5 @@
         if (GameMode::isMaster())
         {
+            orxout(user_info) << "Load level" << std::endl;
             this->loadLevel();
         }
@@ -113,4 +114,5 @@
             ModifyConsoleCommand(__CC_startMainMenu_name).activate();
         }
+        orxout(user_info) << "All loaded" << std::endl;
 
         if (GameMode::isStandalone())
Index: code/branches/ScriptableController_HS17/src/orxonox/infos/GametypeInfo.cc
===================================================================
--- code/branches/ScriptableController_HS17/src/orxonox/infos/GametypeInfo.cc	(revision 11562)
+++ code/branches/ScriptableController_HS17/src/orxonox/infos/GametypeInfo.cc	(revision 11583)
@@ -43,4 +43,6 @@
 #include "interfaces/GametypeMessageListener.h"
 #include "interfaces/NotificationListener.h"
+#include "scriptablecontroller/scriptable_controller.h"
+#include "Level.h"
 
 #include "PlayerInfo.h"
@@ -310,6 +312,11 @@
         {
             if(this->hasStarted() && !this->hasEnded())
-
                 this->setSpawnedHelper(player, true);
+        }
+
+        if(player->isHumanPlayer() && player->isLocalPlayer())
+        {
+            this->getLevel()->getScriptableController()->setPlayer(player);
+            this-getLevel()->getScriptableController()->runScript(this->getLevel()->getScript());
         }
     }
Index: code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller.cc
===================================================================
--- code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller.cc	(revision 11562)
+++ code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller.cc	(revision 11583)
@@ -3,4 +3,5 @@
 #include "luatb.h"
 #include "infos/PlayerInfo.h"
+#include "core/command/Executor.h"
 
 namespace orxonox
@@ -11,4 +12,8 @@
 {
     int ret;
+
+    // Not having a script specified at all is not an error
+    if(file_path.empty())
+        return 0;
 
     // Create a lua object
@@ -45,6 +50,4 @@
     this->apis_.push_back(std::unique_ptr<ScriptableControllerAPI>(api));
 
-    // Only the caller knows, when the end-of-life of the script is reached,
-    // so we give him control over when to destroy it.
     return 0;
 }
@@ -55,79 +58,30 @@
 }
 
-void ScriptableController::registerWorldEntity(int id, WorldEntity *obj)
+void ScriptableController::registerWorldEntity(std::string id, WorldEntity *entity)
 {
-    orxout(user_info) << "WorldEntity registered (id: " << id << ")" << std::endl;
-    this->worldEntities_[id] = obj;
+    this->worldEntities_[id] = entity;
 }
 
-void ScriptableController::registerControllableEntity(int id, ControllableEntity *obj)
+void ScriptableController::registerControllableEntity(std::string id, ControllableEntity *entity)
 {
-    orxout(user_info) << "ControllableEntity registered (id: " << id << ")" << std::endl;
-    this->worldEntities_[id] = obj;
+    this->worldEntities_[id] = entity;
 }
 
-WorldEntity *ScriptableController::getWorldEntityByID(int id) const
+WorldEntity *ScriptableController::getWorldEntityByID(std::string id) const
 {
-    if(id == 0)
+    if(id == "player" || id == "Player" || id == "PLAYER")
         return this->player_->getControllableEntity();
 
-    auto obj = this->worldEntities_.find(id);
-    return obj != this->worldEntities_.end() ? obj->second : nullptr;
+    auto entity = this->worldEntities_.find(id);
+    return entity != this->worldEntities_.end() ? entity->second : nullptr;
 }
 
-ControllableEntity *ScriptableController::getControllableEntityByID(int id) const
+ControllableEntity *ScriptableController::getControllableEntityByID(std::string id) const
 {
-    if(id == 0)
+    if(id == "player" || id == "Player" || id == "PLAYER")
         return this->player_->getControllableEntity();
 
-    auto obj = this->controllabelEntities_.find(id);
-    return obj != this->controllabelEntities_.end() ? obj->second : nullptr;
-}
-
-void ScriptableController::addNearObjectHandler(int obj1, int obj2, double distance, std::function<void (int,int)> callback)
-{
-    orxout(user_info) << "NearObject registering (id 1: " << obj1 << ", id 2: " << obj2 << ")" << std::endl;
-
-    WorldEntity *entity1 = this->getWorldEntityByID(obj1);
-    WorldEntity *entity2 = this->getWorldEntityByID(obj2);
-
-    NearObjectHandler *handler1 = new NearObjectHandler(entity2, distance, callback);
-    NearObjectHandler *handler2 = new NearObjectHandler(entity1, distance, callback);
-
-    this->nearObjectHandlers_[entity1].push_front(std::unique_ptr<NearObjectHandler>(handler1));
-    this->nearObjectHandlers_[entity2].push_front(std::unique_ptr<NearObjectHandler>(handler2));
-
-    handler1->otherHandler_ = this->nearObjectHandlers_[entity2].begin();
-    handler2->otherHandler_ = this->nearObjectHandlers_[entity1].begin();
-}
-
-void ScriptableController::objectMoved(WorldEntity *obj)
-{
-    // Temp
-    return;
-
-    auto &nearObjectHandlers = this->nearObjectHandlers_[obj];
-    auto handler = nearObjectHandlers.begin();
-    while(handler != nearObjectHandlers.end())
-    {
-        WorldEntity *other = (*handler)->otherObject_;
-        if((obj->getPosition() - other->getPosition()).length() < (*handler)->distance_)
-        {
-            (*handler)->callback_(obj->getID(), other->getID());
-
-            auto otherHandler = (*handler)->otherHandler_;
-            handler = nearObjectHandlers.erase(handler);
-            if(nearObjectHandlers.empty())
-                this->nearObjectHandlers_.erase(obj);
-
-            this->nearObjectHandlers_[other].erase(otherHandler);
-            if(this->nearObjectHandlers_[other].empty())
-                this->nearObjectHandlers_.erase(other);
-        }
-        else
-        {
-            handler++;
-        }
-    }
+    auto entity = this->controllabelEntities_.find(id);
+    return entity != this->controllabelEntities_.end() ? entity->second : nullptr;
 }
 
Index: code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller.h
===================================================================
--- code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller.h	(revision 11562)
+++ code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller.h	(revision 11583)
@@ -11,4 +11,5 @@
 #include "worldentities/WorldEntity.h"
 #include "worldentities/ControllableEntity.h"
+#include "tools/Timer.h"
 
 struct lua_State;
@@ -20,36 +21,18 @@
 {
 public:
-    struct NearObjectHandler
-    {
-        NearObjectHandler(WorldEntity *otherObject, double distance, std::function<void (int, int)> callback)
-            : otherObject_(otherObject), distance_(distance), callback_(callback)
-        {}
-
-        WorldEntity *otherObject_;
-        double distance_;
-        std::function<void (int, int)> callback_;
-        std::list<std::unique_ptr<NearObjectHandler> >::iterator otherHandler_;
-    };
-
     int runScript(const std::string &file_path);
 
     void setPlayer(PlayerInfo *player);
-    void registerWorldEntity(int id, WorldEntity *obj);
-    void registerControllableEntity(int id, ControllableEntity *obj);
+    void registerWorldEntity(std::string id, WorldEntity *entity);
+    void registerControllableEntity(std::string id, ControllableEntity *entity);
 
-    WorldEntity *getWorldEntityByID(int id) const;
-    ControllableEntity *getControllableEntityByID(int id) const;
-
-    void addNearObjectHandler(int obj1, int obj2, double distance, std::function<void (int, int)> callback);
-
-    void objectMoved(WorldEntity *obj);
+    WorldEntity *getWorldEntityByID(std::string id) const;
+    ControllableEntity *getControllableEntityByID(std::string id) const;
 
 private:
     std::list<std::unique_ptr<ScriptableControllerAPI> > apis_;
     PlayerInfo *player_;
-    std::map<int, WorldEntity*> worldEntities_;
-    std::map<int, ControllableEntity*> controllabelEntities_;
-
-    std::map<WorldEntity*, std::list<std::unique_ptr<NearObjectHandler> > > nearObjectHandlers_;
+    std::map<std::string, WorldEntity*> worldEntities_;
+    std::map<std::string, ControllableEntity*> controllabelEntities_;
 
     void printLuaError(lua_State *lua);
Index: code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller_api.cc
===================================================================
--- code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller_api.cc	(revision 11562)
+++ code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller_api.cc	(revision 11583)
@@ -17,8 +17,12 @@
     LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::registerAfterTimeout)>::registerFunction<&ScriptableControllerAPI::registerAfterTimeout>(this, lua, "registerAfterTimeout");
     LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::registerAtNearObject)>::registerFunction<&ScriptableControllerAPI::registerAtNearObject>(this, lua, "registerAtNearObject");
+    LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::registerAtNearPoint)>::registerFunction<&ScriptableControllerAPI::registerAtNearPoint>(this, lua, "registerAtNearPoint");
     LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::registerAtAreaEnter)>::registerFunction<&ScriptableControllerAPI::registerAtAreaEnter>(this, lua, "registerAtAreaEnter");
     LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::registerAtAreaLeave)>::registerFunction<&ScriptableControllerAPI::registerAtAreaLeave>(this, lua, "registerAtAreaLeave");
-    LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::registerAtObjectDestroyed)>::registerFunction<&ScriptableControllerAPI::registerAtObjectDestroyed>(this, lua, "registerAtObjectDestroyed");
-    LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::registerAtPickup)>::registerFunction<&ScriptableControllerAPI::registerAtPickup>(this, lua, "registerAtPickup");
+//    LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::registerAtObjectDestroyed)>::registerFunction<&ScriptableControllerAPI::registerAtObjectDestroyed>(this, lua, "registerAtObjectDestroyed");
+//    LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::registerAtPickup)>::registerFunction<&ScriptableControllerAPI::registerAtPickup>(this, lua, "registerAtPickup");
+
+    // Checks for area enter, area leave and near object events
+    this->areaCheckTimer.setTimer(0.5, true, createExecutor(createFunctor(&ScriptableControllerAPI::checkAreas, this)), false);
 }
 
@@ -39,27 +43,99 @@
 }
 
-int ScriptableControllerAPI::registerAtNearObject(std::function<void (int, int)> callback, int obj1, int obj2, double distance)
+void ScriptableControllerAPI::registerAtNearObject(std::function<void (std::string, std::string)> callback, std::string id1, std::string id2, double distance)
 {
-    //this->controller_->addNearObjectHandler(obj1, obj1, distance, callback);
+    WorldEntity *entity1 = this->controller_->getWorldEntityByID(id1);
+    WorldEntity *entity2 = this->controller_->getWorldEntityByID(id2);
+
+    if(entity1 != nullptr && entity2 != nullptr)
+        this->nearObjectHandlers_.push_front(NearObjectHandler(entity1, entity2, id1, id2, distance, callback));
 }
 
-int ScriptableControllerAPI::registerAtAreaEnter(std::function<void (int)> callback, int obj, int x, int y, int z, int dx, int dy, int dz)
+void ScriptableControllerAPI::registerAtNearPoint(std::function<void (std::string)> callback, std::string id, double x, double y, double z, double distance)
 {
+    WorldEntity *entity = this->controller_->getWorldEntityByID(id);
 
+    if(entity != nullptr)
+        this->nearPointHandlers_.push_front(NearPointHandler(entity, id, x, y, z, distance, callback));
 }
 
-int ScriptableControllerAPI::registerAtAreaLeave(std::function<void (int)> callback, int obj, int x, int y, int z, int dx, int dy, int dz)
+void ScriptableControllerAPI::registerAtAreaEnter(std::function<void (std::string)> callback, std::string id, int x, int y, int z, int dx, int dy, int dz)
 {
+    WorldEntity *entity = this->controller_->getWorldEntityByID(id);
 
+    if(entity != nullptr)
+        this->areaHandlers_.push_front(AreaHandler(entity, id, x, y, z, dx, dy, dz, true, callback));
 }
 
-int ScriptableControllerAPI::registerAtObjectDestroyed(std::function<void (int)> callback, int obj)
+void ScriptableControllerAPI::registerAtAreaLeave(std::function<void (std::string)> callback, std::string id, int x, int y, int z, int dx, int dy, int dz)
 {
+    WorldEntity *entity = this->controller_->getWorldEntityByID(id);
 
+    if(entity != nullptr)
+        this->areaHandlers_.push_front(AreaHandler(entity, id, x, y, z, dx, dy, dz, false, callback));
 }
 
-int ScriptableControllerAPI::registerAtPickup(std::function<void (int)> callback, int pickup_id)
+void ScriptableControllerAPI::checkAreas()
 {
+    // Near object
+    auto near_obj_handler = this->nearObjectHandlers_.begin();
+    while(near_obj_handler != this->nearObjectHandlers_.end())
+    {
+        if((near_obj_handler->entity1_->getPosition() - near_obj_handler->entity2_->getPosition()).length() < near_obj_handler->distance_)
+        {
+            near_obj_handler->callback_(near_obj_handler->id1_, near_obj_handler->id2_);
+            near_obj_handler = this->nearObjectHandlers_.erase(near_obj_handler);
+        }
+        else
+        {
+            near_obj_handler++;
+        }
+    }
 
+    // Near point
+    auto near_point_handler = this->nearPointHandlers_.begin();
+    while(near_point_handler != this->nearPointHandlers_.end())
+    {
+        if((near_point_handler->entity_->getPosition() - near_point_handler->point_).length() < near_point_handler->distance_)
+        {
+            near_point_handler->callback_(near_point_handler->id_);
+            near_point_handler = this->nearPointHandlers_.erase(near_point_handler);
+        }
+        else
+        {
+            near_point_handler++;
+        }
+    }
+
+    // Areas
+    auto area_handler = this->areaHandlers_.begin();
+    while(area_handler != this->areaHandlers_.end())
+    {
+        if(area_handler->entity_->getPosition() > area_handler->start_point_ &&
+           area_handler->entity_->getPosition() < area_handler->end_point_)
+        {
+            if(area_handler->atEnter_)
+            {
+                area_handler->callback_(area_handler->id_);
+                area_handler = this->areaHandlers_.erase(area_handler);
+            }
+            else
+            {
+                area_handler++;
+            }
+        }
+        else
+        {
+            if(!area_handler->atEnter_)
+            {
+                area_handler->callback_(area_handler->id_);
+                area_handler = this->areaHandlers_.erase(area_handler);
+            }
+            else
+            {
+                area_handler++;
+            }
+        }
+    }
 }
 
Index: code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller_api.h
===================================================================
--- code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller_api.h	(revision 11562)
+++ code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller_api.h	(revision 11583)
@@ -4,6 +4,6 @@
 #include <functional>
 #include "core/CoreIncludes.h"
-
-// TODO Is pos int or double?
+#include "tools/Timer.h"
+#include "OgreVector3.h"
 
 struct lua_State;
@@ -13,4 +13,5 @@
 
 class ScriptableController;
+class WorldEntity;
 
 class ScriptableControllerAPI
@@ -24,17 +25,65 @@
     void orxPrint(std::string msg);
     void registerAfterTimeout(std::function<void (void)> callback, double timeout);
-    int registerAtNearObject(std::function<void(int, int)> callback, int obj1, int obj2, double distance);
-    int registerAtAreaEnter(std::function<void (int)> callback, int obj, int x, int y, int z, int dx, int dy, int dz);
-    int registerAtAreaLeave(std::function<void (int)> callback, int obj, int x, int y, int z, int dx, int dy, int dz);
-    int registerAtObjectDestroyed(std::function<void (int)> callback, int obj);
-    int registerAtPickup(std::function<void (int)> callback, int pickup_id);
 
-    int destroyObject(int obj);
-    void removeObject(int obj);
-    int setObjectPosition(int obj, double x, double y, double z);
+    void registerAtNearObject(std::function<void(std::string, std::string)> callback, std::string id1, std::string id2, double distance);
+    void registerAtNearPoint(std::function<void (std::string)> callback, std::string id, double x, double y, double z, double distance);
+    void registerAtAreaEnter(std::function<void (std::string)> callback, std::string obj, int x, int y, int z, int dx, int dy, int dz);
+    void registerAtAreaLeave(std::function<void (std::string)> callback, std::string obj, int x, int y, int z, int dx, int dy, int dz);
+
+    void registerAtObjectDestroyed(std::function<void (std::string)> callback, std::string obj);
+    void registerAtPickup(std::function<void (int)> callback, int pickup_id);
+
+    void destroyObject(std::string obj);
+    void removeObject(std::string obj);
+    void setObjectPosition(std::string obj, double x, double y, double z);
 
 private:
+    struct NearObjectHandler
+    {
+        NearObjectHandler(WorldEntity *entity1, WorldEntity *entity2, std::string id1, std::string id2, double distance, std::function<void (std::string, std::string)> callback)
+            : entity1_(entity1), entity2_(entity2), id1_(id1), id2_(id2), distance_(distance), callback_(callback)
+        {}
+
+        WorldEntity *entity1_, *entity2_;
+        std::string id1_, id2_;
+        double distance_;
+        std::function<void (std::string, std::string)> callback_;
+    };
+
+    struct NearPointHandler
+    {
+        NearPointHandler(WorldEntity *entity, std::string id, double x, double y, double z, double distance, std::function<void (std::string)> callback)
+            : entity_(entity), id_(id), point_(x, y, z), distance_(distance), callback_(callback)
+        {}
+
+        WorldEntity *entity_;
+        std::string id_;
+        Vector3 point_;
+        double distance_;
+        std::function<void (std::string)> callback_;
+    };
+
+    struct AreaHandler
+    {
+        AreaHandler(WorldEntity *entity, std::string id, double x, double y, double z, double dx, double dy, double dz, bool atEnter, std::function<void (std::string)> callback)
+            : entity_(entity), id_(id), start_point_(x, y, z), atEnter_(atEnter), callback_(callback)
+        { this-> end_point_ = this->start_point_ + Vector3(dx, dy, dz); }
+
+        WorldEntity *entity_;
+        std::string id_;
+        Vector3 start_point_, end_point_;
+        bool atEnter_;
+        std::function<void (std::string)> callback_;
+    };
+
+
     lua_State *lua_;
     ScriptableController *controller_;
+    std::list<NearObjectHandler> nearObjectHandlers_;
+    std::list<NearPointHandler> nearPointHandlers_;
+    std::list<AreaHandler> areaHandlers_;
+    Timer areaCheckTimer;
+
+    void checkAreas(void);
 };
 
Index: code/branches/ScriptableController_HS17/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/branches/ScriptableController_HS17/src/orxonox/worldentities/ControllableEntity.cc	(revision 11562)
+++ code/branches/ScriptableController_HS17/src/orxonox/worldentities/ControllableEntity.cc	(revision 11583)
@@ -39,4 +39,5 @@
 
 #include "Scene.h"
+#include "Level.h"
 #include "infos/PlayerInfo.h"
 #include "controllers/NewHumanController.h"
@@ -68,5 +69,4 @@
         this->camera_ = nullptr;
         this->xmlcontroller_ = nullptr;
-        //this->controller_ = nullptr;
         this->reverseCamera_ = nullptr;
         this->bDestroyWhenPlayerLeft_ = false;
@@ -127,4 +127,7 @@
         XMLPortObject(ControllableEntity, CameraPosition, "camerapositions", addCameraPosition, getCameraPosition, xmlelement, mode);
         XMLPortObject(ControllableEntity, Controller,     "controller",      setXMLController,  getXMLController,  xmlelement, mode);
+
+        if(!this->id_.empty() && this->getLevel() != nullptr)
+            this->getLevel()->getScriptableController()->registerControllableEntity(this->id_, this);
     }
 
@@ -338,9 +341,4 @@
     }
 
-    void ControllableEntity::registerToScriptableController(ScriptableController *controller)
-    {
-        controller->registerControllableEntity(this->id_, this);
-    }
-
     void ControllableEntity::setPlayer(PlayerInfo* player)
     {
Index: code/branches/ScriptableController_HS17/src/orxonox/worldentities/ControllableEntity.h
===================================================================
--- code/branches/ScriptableController_HS17/src/orxonox/worldentities/ControllableEntity.h	(revision 11562)
+++ code/branches/ScriptableController_HS17/src/orxonox/worldentities/ControllableEntity.h	(revision 11583)
@@ -176,5 +176,4 @@
                 { return this->team_; }
 
-            virtual void registerToScriptableController(ScriptableController *controller) override;
 
         protected:
Index: code/branches/ScriptableController_HS17/src/orxonox/worldentities/MobileEntity.cc
===================================================================
--- code/branches/ScriptableController_HS17/src/orxonox/worldentities/MobileEntity.cc	(revision 11562)
+++ code/branches/ScriptableController_HS17/src/orxonox/worldentities/MobileEntity.cc	(revision 11583)
@@ -115,5 +115,4 @@
 
         this->node_->setPosition(position);
-        this->getLevel()->getScriptableController()->objectMoved(this);
     }
 
Index: code/branches/ScriptableController_HS17/src/orxonox/worldentities/WorldEntity.cc
===================================================================
--- code/branches/ScriptableController_HS17/src/orxonox/worldentities/WorldEntity.cc	(revision 11562)
+++ code/branches/ScriptableController_HS17/src/orxonox/worldentities/WorldEntity.cc	(revision 11583)
@@ -44,4 +44,5 @@
 #include "core/XMLPort.h"
 #include "Scene.h"
+#include "Level.h"
 #include "collisionshapes/WorldEntityCollisionShape.h"
 #include "scriptablecontroller/scriptable_controller.h"
@@ -185,5 +186,6 @@
         XMLPortObject(WorldEntity, CollisionShape, "collisionShapes", attachCollisionShape, getAttachedCollisionShape, xmlelement, mode);
 
-        orxout(user_info) << "ID loaded" << std::endl;
+        if(!this->id_.empty() && this->getLevel() != nullptr)
+            this->getLevel()->getScriptableController()->registerWorldEntity(this->id_, this);
     }
 
@@ -280,10 +282,4 @@
     }
 
-    void WorldEntity::registerToScriptableController(ScriptableController *controller)
-    {
-        orxout(user_info) << "Registering object to SC (" << this->id_ << ")" << std::endl;
-        controller->registerWorldEntity(this->id_, this);
-    }
-
     /**
     @brief
Index: code/branches/ScriptableController_HS17/src/orxonox/worldentities/WorldEntity.h
===================================================================
--- code/branches/ScriptableController_HS17/src/orxonox/worldentities/WorldEntity.h	(revision 11562)
+++ code/branches/ScriptableController_HS17/src/orxonox/worldentities/WorldEntity.h	(revision 11583)
@@ -111,11 +111,9 @@
             virtual void changedVisibility(void) override;
 
-            inline int getID(void)
+            inline std::string getID(void)
                 { return this->id_; }
 
-            inline void setID(int id)
+            inline void setID(std::string id)
                 { this->id_ = id; }
-
-            virtual void registerToScriptableController(ScriptableController *controller) override;
 
             virtual void setPosition(const Vector3& position) = 0;
@@ -450,5 +448,5 @@
 
             btRigidBody*  physicalBody_; //!< Bullet rigid body. Everything physical is applied to this instance.
-            int           id_;           //!< Used by the ScriptableController to identify objects
+            std::string   id_;           //!< Used by the ScriptableController to identify objects
 
         private:
