Index: code/branches/ScriptableController_HS17/src/libraries/core/BaseObject.h
===================================================================
--- code/branches/ScriptableController_HS17/src/libraries/core/BaseObject.h	(revision 11517)
+++ code/branches/ScriptableController_HS17/src/libraries/core/BaseObject.h	(revision 11518)
@@ -58,4 +58,5 @@
     class Gametype;
     class Level;
+    class ScriptableController;
 
     /// The BaseObject is the parent of all classes representing an instance in the game.
@@ -191,4 +192,6 @@
 
             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/CMakeLists.txt
===================================================================
--- code/branches/ScriptableController_HS17/src/orxonox/CMakeLists.txt	(revision 11517)
+++ code/branches/ScriptableController_HS17/src/orxonox/CMakeLists.txt	(revision 11518)
@@ -52,4 +52,5 @@
 ADD_SUBDIRECTORY(items)
 ADD_SUBDIRECTORY(overlays)
+ADD_SUBDIRECTORY(scriptablecontroller)
 ADD_SUBDIRECTORY(sound)
 ADD_SUBDIRECTORY(weaponsystem)
Index: code/branches/ScriptableController_HS17/src/orxonox/Level.cc
===================================================================
--- code/branches/ScriptableController_HS17/src/orxonox/Level.cc	(revision 11517)
+++ code/branches/ScriptableController_HS17/src/orxonox/Level.cc	(revision 11518)
@@ -42,4 +42,5 @@
 #include "overlays/OverlayGroup.h"
 #include "LevelManager.h"
+#include "scriptablecontroller/scriptable_controller.h"
 
 namespace orxonox
@@ -79,6 +80,14 @@
         XMLPortParam(Level, "gametype", setGametypeString, getGametypeString, xmlelement, mode).defaultValues("Gametype");
 
+        XMLPortParamLoadOnly(Level, "script", setScript, xmlelement, mode);
+
         XMLPortObject(Level, MeshLodInformation, "lodinformation", addLodInfo, getLodInfo, xmlelement, mode);
         XMLPortObjectExtended(Level, BaseObject, "", addObject, getObject, xmlelement, mode, true, false);
+
+        if(this->level_script_ != "")
+        {
+            this->controller_.reset(new ScriptableController());
+            this->controller_->runScript(this->level_script_);
+        }
     }
 
@@ -168,4 +177,6 @@
     {
         this->objects_.push_back(object);
+        if(this->controller_.get() != nullptr)
+            object->registerToScriptableController(this->controller_.get());
     }
 
Index: code/branches/ScriptableController_HS17/src/orxonox/Level.h
===================================================================
--- code/branches/ScriptableController_HS17/src/orxonox/Level.h	(revision 11517)
+++ code/branches/ScriptableController_HS17/src/orxonox/Level.h	(revision 11518)
@@ -42,4 +42,6 @@
 namespace orxonox
 {
+    class ScriptableController;
+
     class _OrxonoxExport Level : public BaseObject, public Synchronisable, public Context
     {
@@ -78,7 +80,10 @@
             void networkcallback_applyXMLFile();
 
+            inline void setScript(const std::string &script)
+                { this->level_script_ = script; }
+
+
             std::string                    pluginsString_;
             std::list<PluginReference*>    plugins_;
-
             std::string                    gametype_;
             std::string                    xmlfilename_;
@@ -86,4 +91,7 @@
             std::list<BaseObject*>         objects_;
             std::map<std::string,MeshLodInformation*>  lodInformation_;
+
+            std::unique_ptr<ScriptableController> controller_;
+            std::string                           level_script_;
     };
 }
Index: code/branches/ScriptableController_HS17/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/branches/ScriptableController_HS17/src/orxonox/worldentities/ControllableEntity.cc	(revision 11517)
+++ code/branches/ScriptableController_HS17/src/orxonox/worldentities/ControllableEntity.cc	(revision 11518)
@@ -44,4 +44,5 @@
 #include "worldentities/CameraPosition.h"
 #include "overlays/OverlayGroup.h"
+#include "scriptablecontroller/scriptable_controller.h"
 
 namespace orxonox
@@ -337,4 +338,9 @@
     }
 
+    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 11517)
+++ code/branches/ScriptableController_HS17/src/orxonox/worldentities/ControllableEntity.h	(revision 11518)
@@ -175,4 +175,6 @@
             inline int getTeam() const
                 { return this->team_; }
+
+            virtual void registerToScriptableController(ScriptableController *controller) override;
 
         protected:
Index: code/branches/ScriptableController_HS17/src/orxonox/worldentities/WorldEntity.cc
===================================================================
--- code/branches/ScriptableController_HS17/src/orxonox/worldentities/WorldEntity.cc	(revision 11517)
+++ code/branches/ScriptableController_HS17/src/orxonox/worldentities/WorldEntity.cc	(revision 11518)
@@ -45,4 +45,5 @@
 #include "Scene.h"
 #include "collisionshapes/WorldEntityCollisionShape.h"
+#include "scriptablecontroller/scriptable_controller.h"
 
 namespace orxonox
@@ -79,4 +80,5 @@
         this->parentID_ = OBJECTID_UNKNOWN;
         this->bDeleteWithParent_ = true;
+        this->id_ = -1;
 
         this->node_->setPosition(Vector3::ZERO);
@@ -160,4 +162,5 @@
         XMLPortParamTemplate(WorldEntity, "scale3D",     setScale3D,     getScale3D,     xmlelement, mode, const Vector3&);
         XMLPortParam        (WorldEntity, "scale",       setScale,       getScale,       xmlelement, mode);
+        XMLPortParamLoadOnly(WorldEntity, "id",          setID,                xmlelement, mode);
         XMLPortParamLoadOnly(WorldEntity, "lookat",      lookAt_xmlport,       xmlelement, mode);
         XMLPortParamLoadOnly(WorldEntity, "direction",   setDirection_xmlport, xmlelement, mode);
@@ -275,4 +278,9 @@
     }
 
+    void WorldEntity::registerToScriptableController(ScriptableController *controller)
+    {
+        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 11517)
+++ code/branches/ScriptableController_HS17/src/orxonox/worldentities/WorldEntity.h	(revision 11518)
@@ -110,4 +110,9 @@
             virtual void changedActivity(void) override;
             virtual void changedVisibility(void) override;
+
+            inline void setID(int id)
+                { this->id_ = id; }
+
+            virtual void registerToScriptableController(ScriptableController *controller) override;
 
             virtual void setPosition(const Vector3& position) = 0;
@@ -442,4 +447,5 @@
 
             btRigidBody*  physicalBody_; //!< Bullet rigid body. Everything physical is applied to this instance.
+            int           id_;           //!< Used by the ScriptableController to identify objects
 
         private:
