Index: code/branches/PresentationFS18/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/PresentationFS18/src/orxonox/CMakeLists.txt	(revision 12015)
+++ code/branches/PresentationFS18/src/orxonox/CMakeLists.txt	(revision 12016)
@@ -51,4 +51,5 @@
 ADD_SUBDIRECTORY(items)
 ADD_SUBDIRECTORY(overlays)
+ADD_SUBDIRECTORY(scriptablecontroller)
 ADD_SUBDIRECTORY(sound)
 ADD_SUBDIRECTORY(weaponsystem)
Index: code/branches/PresentationFS18/src/orxonox/Level.cc
===================================================================
--- code/branches/PresentationFS18/src/orxonox/Level.cc	(revision 12015)
+++ code/branches/PresentationFS18/src/orxonox/Level.cc	(revision 12016)
@@ -42,4 +42,5 @@
 #include "overlays/OverlayGroup.h"
 #include "LevelManager.h"
+#include "scriptablecontroller/scriptable_controller.h"
 
 namespace orxonox
@@ -56,4 +57,5 @@
         this->xmlfilename_ = this->getFilename();
         this->xmlfile_ = nullptr;
+        this->controller_.reset(new ScriptableController());
     }
 
@@ -78,4 +80,6 @@
         XMLPortParam(Level, "plugins",  setPluginsString,  getPluginsString,  xmlelement, mode);
         XMLPortParam(Level, "gametype", setGametypeString, getGametypeString, xmlelement, mode).defaultValues("Gametype");
+
+        XMLPortParamLoadOnly(Level, "script", setScript, xmlelement, mode).defaultValues("scripts/empty.lua");
 
         XMLPortObject(Level, MeshLodInformation, "lodinformation", addLodInfo, getLodInfo, xmlelement, mode);
Index: code/branches/PresentationFS18/src/orxonox/Level.h
===================================================================
--- code/branches/PresentationFS18/src/orxonox/Level.h	(revision 12015)
+++ code/branches/PresentationFS18/src/orxonox/Level.h	(revision 12016)
@@ -42,4 +42,6 @@
 namespace orxonox
 {
+    class ScriptableController;
+
     class _OrxonoxExport Level : public BaseObject, public Synchronisable, public Context
     {
@@ -55,4 +57,9 @@
             MeshLodInformation* getLodInfo(std::string meshName) const;
 
+            inline ScriptableController *getScriptableController(void)
+                { return this->controller_.get(); }
+
+            inline const std::string &getScript(void)
+                { return this->level_script_; }
 
         private:
@@ -78,7 +85,12 @@
             void networkcallback_applyXMLFile();
 
+            inline void setScript(const std::string &script)
+                {   
+                    orxout(internal_warning) << "hi world" << endl;
+                    this->level_script_ = script; }
+
+
             std::string                    pluginsString_;
             std::list<PluginReference*>    plugins_;
-
             std::string                    gametype_;
             std::string                    xmlfilename_;
@@ -86,4 +98,7 @@
             std::list<BaseObject*>         objects_;
             std::map<std::string,MeshLodInformation*>  lodInformation_;
+
+            std::unique_ptr<ScriptableController> controller_;
+            std::string           level_script_;
     };
 }
Index: code/branches/PresentationFS18/src/orxonox/controllers/AutonomousDroneController.cc
===================================================================
--- code/branches/PresentationFS18/src/orxonox/controllers/AutonomousDroneController.cc	(revision 12016)
+++ code/branches/PresentationFS18/src/orxonox/controllers/AutonomousDroneController.cc	(revision 12016)
@@ -0,0 +1,115 @@
+/*
+ *   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:
+ *      Oli Scheuss
+ *   Co-authors:
+ *      Damian 'Mozork' Frick
+ *
+ */
+
+#include "AutonomousDroneController.h"
+
+#include "worldentities/AutonomousDrone.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+    //TODO: Put your code in here:
+    // Create the factory for the drone controller.
+    RegisterClass(AutonomousDroneController);
+    /**
+    @brief
+        Constructor.
+    @param context
+        The context of this object.
+    */
+    AutonomousDroneController::AutonomousDroneController(Context* context) : Controller(context)
+    {
+        //TODO: Place your code here:
+        // Make sure to register the object and create the factory.        
+	RegisterObject(AutonomousDroneController);
+        // This checks that our context really is a drone
+        // and saves the pointer to the drone for the controlling commands
+        /* NOTE from Sandro: This is currently broken */
+        //AutonomousDrone* drone = dynamic_cast<AutonomousDrone*>(context);
+        //assert(drone != nullptr);
+        //this->setControllableEntity(drone);
+    }
+
+    /**
+    @brief
+        Destructor.
+    */
+    AutonomousDroneController::~AutonomousDroneController()
+    {
+
+    }
+
+    /**
+    @brief
+        The controlling happens here. This method defines what the controller has to do each tick.
+    @param dt
+        The duration of the tick.
+    */
+    void AutonomousDroneController::tick(float dt)
+    {
+
+	static int i = 0;
+	
+        /* NOTE: Ugly hack by Sandro to make the tutorial work for the moment.
+         * This will be reverted once the framework update is complete
+         */
+        //AutonomousDrone *myDrone = static_cast<AutonomousDrone*>(this->getControllableEntity());
+        ObjectList<AutonomousDrone> objectList;
+        ObjectList<AutonomousDrone>::iterator it = objectList.begin();
+        AutonomousDrone* myDrone = *it;
+
+        if (myDrone != nullptr)
+        {
+            //TODO: Place your code here:
+            // Steering commands
+            // You can use the commands provided by the AutonomousDrone to steer it:
+            // - moveFrontBack, moveRightLeft, moveUpDown
+            // - rotatePitch, rotateYaw, rotateRoll
+            // You will see, that the AutonomousDrone has two variants for each of these commands, one with a vector as input and one with just a float. Use the one with just the float as input.
+            // Apply them to myDrone (e.g. myDrone->rotateYaw(..) )
+            // dt is the time passed since the last call of the tick function in seconds.
+	    int iMax = 100;
+	    double R = 250;
+
+	    double x = R * cos(math::twoPi/iMax*i);
+	    double y = R * sin(math::twoPi/iMax*i);
+
+	    
+	    const Vector2 motion1 = Vector2(x,0);
+	    const Vector2 motion2 = Vector2(y,0);
+
+	    
+	    myDrone->moveRightLeft(motion1);
+	    myDrone->moveUpDown(motion2);
+	    
+	    i = (i+1)%iMax;
+		
+
+        }
+    }
+}
Index: code/branches/PresentationFS18/src/orxonox/controllers/AutonomousDroneController.h
===================================================================
--- code/branches/PresentationFS18/src/orxonox/controllers/AutonomousDroneController.h	(revision 12016)
+++ code/branches/PresentationFS18/src/orxonox/controllers/AutonomousDroneController.h	(revision 12016)
@@ -0,0 +1,59 @@
+/*
+ *   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:
+ *      Oli Scheuss
+ *   Co-authors:
+ *      Damian 'Mozork' Frick
+ *
+ */
+
+#ifndef _AutonomousDroneController_H__
+#define _AutonomousDroneController_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "Controller.h"
+#include "tools/interfaces/Tickable.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        Controller for the AutonomousDrone of the PPS tutorial.
+    @author
+        Oli Scheuss
+    */
+    class _OrxonoxExport AutonomousDroneController : public Controller, public Tickable
+    {
+        public:
+            AutonomousDroneController(Context* context);
+            virtual ~AutonomousDroneController();
+
+            virtual void tick(float dt); //!< The controlling happens here. This method defines what the controller has to do each tick.
+
+        protected:
+
+        private:
+    };
+}
+
+#endif /* _AutonomousDroneController_H__ */
Index: code/branches/PresentationFS18/src/orxonox/controllers/CMakeLists.txt
===================================================================
--- code/branches/PresentationFS18/src/orxonox/controllers/CMakeLists.txt	(revision 12015)
+++ code/branches/PresentationFS18/src/orxonox/controllers/CMakeLists.txt	(revision 12016)
@@ -19,4 +19,6 @@
   FightingController.cc
   MasterController.cc
-  ArrowController.cc
+  ArrowController.cc;
+  AutonomousDroneController.cc;
+	
 )
Index: code/branches/PresentationFS18/src/orxonox/controllers/Controller.cc
===================================================================
--- code/branches/PresentationFS18/src/orxonox/controllers/Controller.cc	(revision 12015)
+++ code/branches/PresentationFS18/src/orxonox/controllers/Controller.cc	(revision 12016)
@@ -26,5 +26,5 @@
  *
  */
-
+//asdf
 #include "Controller.h"
 #include "core/CoreIncludes.h"
Index: code/branches/PresentationFS18/src/orxonox/infos/GametypeInfo.cc
===================================================================
--- code/branches/PresentationFS18/src/orxonox/infos/GametypeInfo.cc	(revision 12015)
+++ code/branches/PresentationFS18/src/orxonox/infos/GametypeInfo.cc	(revision 12016)
@@ -43,4 +43,6 @@
 #include "interfaces/GametypeMessageListener.h"
 #include "interfaces/NotificationListener.h"
+#include "scriptablecontroller/scriptable_controller.h"
+#include "Level.h"
 
 #include "PlayerInfo.h"
@@ -76,4 +78,5 @@
         this->spawned_ = false;
         this->readyToSpawn_ = false;
+        this->isFirstSpawn_ = true;
 
         this->registerVariables();
@@ -296,4 +299,5 @@
             this->setReadyToSpawnHelper(player, false);
             this->setSpawnedHelper(player, false);
+
         }
     }
@@ -310,6 +314,18 @@
         {
             if(this->hasStarted() && !this->hasEnded())
-
                 this->setSpawnedHelper(player, true);
+        }
+
+        // TODO We might want to handle the subsequent spawns as well somehow
+        if(player->isHumanPlayer() && player->isLocalPlayer()) //&& this->isFirstSpawn_)
+        {
+            this->isFirstSpawn_ = false;
+            this->getLevel()->getScriptableController()->setPlayer(player);
+
+            // This handles paths relative to the 'level' directory
+            std::string script = this->getLevel()->getScript();
+            if(script.at(0) != '/')
+                script = "../levels/" + script; // Not very dynamic
+            this->getLevel()->getScriptableController()->runScript(script);
         }
     }
@@ -345,6 +361,15 @@
             {
                 // Display "Press [Fire] to start the match" if the game has not yet ended.
-                if(!this->hasEnded())
+                if(!this->hasEnded()){
                     NotificationListener::sendNotification("Press [Fire] to start the match", GametypeInfo::NOTIFICATION_SENDER, NotificationMessageType::info, NotificationSendMode::network, player->getClientID());
+                
+                    //this->getLevel()->getScriptableController()->setPlayer(player);
+
+                    // This handles paths relative to the 'level' directory
+                    //std::string script = this->getLevel()->getScript();
+                    //if(script.at(0) != '/')
+                    //script = "../levels/" + script; // Not very dynamic
+                    //this->getLevel()->getScriptableController()->runScript(script);
+                }
                 // Else display "Game has ended".
                 else
Index: code/branches/PresentationFS18/src/orxonox/infos/GametypeInfo.h
===================================================================
--- code/branches/PresentationFS18/src/orxonox/infos/GametypeInfo.h	(revision 12015)
+++ code/branches/PresentationFS18/src/orxonox/infos/GametypeInfo.h	(revision 12016)
@@ -83,4 +83,5 @@
             inline bool isStartCountdownRunning() const
                 { return this->bStartCountdownRunning_; }
+
             void changedStartCountdownRunning(void); // Is called when the start countdown has been either started or stopped.
 
@@ -166,4 +167,5 @@
             bool spawned_; //!< Whether the local Player is currently spawned.
             bool readyToSpawn_; //!< Whether the local Player is ready to spawn.
+            bool isFirstSpawn_;
     };
 }
Index: code/branches/PresentationFS18/src/orxonox/infos/HumanPlayer.cc
===================================================================
--- code/branches/PresentationFS18/src/orxonox/infos/HumanPlayer.cc	(revision 12015)
+++ code/branches/PresentationFS18/src/orxonox/infos/HumanPlayer.cc	(revision 12016)
@@ -38,4 +38,6 @@
 #include "gametypes/Gametype.h"
 #include "overlays/OverlayGroup.h"
+#include "Level.h"
+#include "scriptablecontroller/scriptable_controller.h"
 
 namespace orxonox
Index: code/branches/PresentationFS18/src/orxonox/items/ShipPart.cc
===================================================================
--- code/branches/PresentationFS18/src/orxonox/items/ShipPart.cc	(revision 12015)
+++ code/branches/PresentationFS18/src/orxonox/items/ShipPart.cc	(revision 12016)
@@ -42,4 +42,6 @@
 #include "items/PartDestructionEvent.h"
 #include "chat/ChatManager.h"
+#include "Level.h"
+#include "scriptablecontroller/scriptable_controller.h"
 
 
@@ -215,4 +217,9 @@
             }
         }
+
+        // This is a bit hacky, but it takes away damage control from the pawn, so it has to handle
+        // that as well.
+        this->getLevel()->getScriptableController()->pawnHit(parent_, originator, parent_->getHealth(), parent_->getShieldHealth());
+
         if (this->health_ < 0)
             this->death();
Index: code/branches/PresentationFS18/src/orxonox/scriptablecontroller/CMakeLists.txt
===================================================================
--- code/branches/PresentationFS18/src/orxonox/scriptablecontroller/CMakeLists.txt	(revision 12016)
+++ code/branches/PresentationFS18/src/orxonox/scriptablecontroller/CMakeLists.txt	(revision 12016)
@@ -0,0 +1,6 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  luatb_typed_stack.cc
+  scriptable_controller.cc
+  scriptable_controller_api.cc
+)
+
Index: code/branches/PresentationFS18/src/orxonox/scriptablecontroller/is_callable.h
===================================================================
--- code/branches/PresentationFS18/src/orxonox/scriptablecontroller/is_callable.h	(revision 12016)
+++ code/branches/PresentationFS18/src/orxonox/scriptablecontroller/is_callable.h	(revision 12016)
@@ -0,0 +1,48 @@
+#ifndef IS_CALLABLE_H
+#define IS_CALLABLE_H
+
+#include <type_traits>
+
+/**
+ * @brief Implementation of IsCallable
+ */
+template<typename T>
+struct IsCallableImpl
+{
+private:
+    typedef char(&yes)[1];
+    typedef char(&no)[2];
+
+    struct Fallback { void operator()(); };
+    struct Derived : T, Fallback { };
+
+    template<typename U, U> struct Check;
+
+    template<typename>
+    static yes test(...);
+
+    template<typename C>
+    static no test(Check<void (Fallback::*)(), &C::operator()>*);
+
+public:
+    static const bool value = sizeof(test<Derived>(0)) == sizeof(yes);
+};
+
+/**
+ * @brief Checks if a type is callable
+ *
+ * Callable means here, that it has has an 'operator()'. This will not work for
+ * normal functions without modifications, but we don't need that case anyway.
+ *
+ * See https://stackoverflow.com/a/15396757/7421666
+ */
+template<typename T>
+struct IsCallable
+    : std::conditional<
+        std::is_class<T>::value,
+        IsCallableImpl<T>,
+        std::false_type
+    >::type
+{ };
+
+#endif // IS_CALLABLE_H
Index: code/branches/PresentationFS18/src/orxonox/scriptablecontroller/luatb.h
===================================================================
--- code/branches/PresentationFS18/src/orxonox/scriptablecontroller/luatb.h	(revision 12016)
+++ code/branches/PresentationFS18/src/orxonox/scriptablecontroller/luatb.h	(revision 12016)
@@ -0,0 +1,39 @@
+#ifndef LUATB_H
+#define LUATB_H
+
+#include <string>
+
+struct lua_State;
+
+/**
+ * @brief Makes certain functions visible to lua while staying type-safe
+ * on the C++ side.
+ */
+template<typename ThisType, typename FunctionType>
+class LuaTB
+{
+public:
+    /**
+     * @brief Make a function visible to lua
+     * @param _this Pointer to the object that owns the function
+     * @param lua Pointer to the lua state
+     * @param name Name that will be visible to lua for this function
+     *
+     * Only class functions are supported, because that's  all we need at
+     * the moment. Extending it to support normal functions as well should
+     * be fairly easy, though.
+     *
+     * If you want to make a function 'Foo::bar' visible, you should call
+     * it like this (assuming no C++17 support):
+     *
+     * LuaTB<Foo, decltype(&Foo::bar)>::registerFunction<&Foo::bar>( ... );
+     */
+    template<FunctionType func>
+    static void registerFunction(ThisType *_this, lua_State *lua, std::string name);
+};
+
+// We need to include all type-dependant template implementations, because the
+// compiler needs to know for which types it has to instantiate those.
+#include "luatb.ipp"
+
+#endif // LUATB_H
Index: code/branches/PresentationFS18/src/orxonox/scriptablecontroller/luatb.ipp
===================================================================
--- code/branches/PresentationFS18/src/orxonox/scriptablecontroller/luatb.ipp	(revision 12016)
+++ code/branches/PresentationFS18/src/orxonox/scriptablecontroller/luatb.ipp	(revision 12016)
@@ -0,0 +1,59 @@
+
+#include <lua.hpp>
+#include <iostream>
+#include <type_traits>
+#include "luatb_typed_stack.h"
+
+
+// TODO Make free functions work
+
+// This class is only valid for function types. As a neat side-effect, having
+// this specialization in the .ipp file, also hides all of the private members
+// from the user (kind of).
+template<typename ThisType, typename Ret, typename... Args>
+class LuaTB<ThisType, Ret (ThisType::*)(Args...)>
+{
+public:
+    template<Ret (ThisType::*func)(Args...)>
+    static void registerFunction(ThisType *_this, lua_State *lua, std::string name)
+    {
+        // Store the 'this' pointer of the caller in the extraspace
+        LuaTB<ThisType, Ret (ThisType::*)(Args...)>::stateToClassMap[lua] = _this;
+
+        // Make a function visible to lua that will call 'func' with the correct
+        // arguments
+        lua_register(lua, name.c_str(), toLuaSignature<func>);
+    }
+
+private:
+    static std::map<lua_State*, ThisType*> stateToClassMap;
+
+    // Represents a function that can made visible to lua with the correct
+    // signature. It will call the corresponding C++ function with the
+    // correctly typed arguments
+    template<Ret (ThisType::*func)(Args...)>
+    static int toLuaSignature(lua_State *lua)
+    {
+        // The index of the topmost item on the stack equals the size of
+        // the stack, which also equals the number of arguments
+        int argc = lua_gettop(lua);
+
+        // Check if the number of arguments match
+        if(argc != sizeof...(Args))
+        {
+            std::cerr << "ERROR: LuaTB: Lua script called a function with wrong number of arguments (" << argc << " given, " << sizeof...(Args) << " expected)" << std::endl;
+            return LUA_ERRSYNTAX;
+        }
+
+        // Call getArgument for every argument seperately to convert each argument
+        // to the correct type and call the function afterwards
+        ((*LuaTB<ThisType, Ret (ThisType::*)(Args...)>::stateToClassMap[lua]).*func)( (LuaTBTypedStack::getArgument<Args>(lua))... );
+
+        return 0;
+    }
+};
+
+// This needs to be here and not in a source file, because the compiler can't know
+// the template types if it's in a separate module.
+template<typename ThisType, typename Ret, typename... Args>
+std::map<lua_State*, ThisType*> LuaTB<ThisType, Ret (ThisType::*)(Args...)>::stateToClassMap = std::map<lua_State*, ThisType*>();
Index: code/branches/PresentationFS18/src/orxonox/scriptablecontroller/luatb_typed_stack.cc
===================================================================
--- code/branches/PresentationFS18/src/orxonox/scriptablecontroller/luatb_typed_stack.cc	(revision 12016)
+++ code/branches/PresentationFS18/src/orxonox/scriptablecontroller/luatb_typed_stack.cc	(revision 12016)
@@ -0,0 +1,33 @@
+
+#include "luatb_typed_stack.h"
+#include "luatb.h"
+#include <string>
+
+// Holds a list of all current callback references
+std::list<std::unique_ptr<int> > LuaTBTypedStack::callbackRefs = {};
+
+// Explicit and full specializations need to be in a .cpp file
+
+template<>
+int LuaTBTypedStack::getFromLuaStack<int>(lua_State *lua)
+{ return lua_tointeger(lua, lua_gettop(lua)); }
+
+template<>
+double LuaTBTypedStack::getFromLuaStack<double>(lua_State *lua)
+{ return lua_tonumber(lua, lua_gettop(lua)); }
+
+template<>
+std::string LuaTBTypedStack::getFromLuaStack<std::string>(lua_State *lua)
+{ return lua_tostring(lua, lua_gettop(lua)); }
+
+template<>
+void LuaTBTypedStack::pushToLuaStack<int>(lua_State *lua, int value)
+{ lua_pushinteger(lua, value); }
+
+template<>
+void LuaTBTypedStack::pushToLuaStack<double>(lua_State *lua, double value)
+{ lua_pushnumber(lua, value); }
+
+template<>
+void LuaTBTypedStack::pushToLuaStack<std::string>(lua_State *lua, std::string value)
+{ lua_pushstring(lua, value.c_str()); }
Index: code/branches/PresentationFS18/src/orxonox/scriptablecontroller/luatb_typed_stack.h
===================================================================
--- code/branches/PresentationFS18/src/orxonox/scriptablecontroller/luatb_typed_stack.h	(revision 12016)
+++ code/branches/PresentationFS18/src/orxonox/scriptablecontroller/luatb_typed_stack.h	(revision 12016)
@@ -0,0 +1,165 @@
+#ifndef LUATB_TYPED_STACK_H
+#define LUATB_TYPED_STACK_H
+
+#include <type_traits>
+#include <functional>
+#include <lua.hpp>
+#include "is_callable.h"
+#include "core/CoreIncludes.h"
+
+
+/**
+ * @brief Represents a typed version of the lua stack
+ *
+ * We need a separate class for this because we need to specialize the functions
+ * and that's not possible if we didn't specialize the class. And the logical
+ * separation makes sense as well.
+ */
+class LuaTBTypedStack
+{
+public:
+
+    /**
+     * @brief Get a non-function argument from the lua stack and convert it to type 'T'
+     * @param lua Pointer to the lua state
+     * @return Top element of the lua stack with the appropriate type
+     *
+     * Note: Pops the value from the stack.
+     */
+    template<typename T>
+    static typename std::enable_if<!IsCallable<T>::value, T>::type getArgument(lua_State *lua)
+    {
+        T value = LuaTBTypedStack::getFromLuaStack<T>(lua);
+        lua_pop(lua, 1);
+        return value;
+    }
+
+    /**
+     * @brief Get a function-type argument from the lua stack and convert it to type 'T'
+     * @param lua Pointer to the lua state
+     * @return Top element of the lua stack with the appropriate type
+     *
+     * Specialization if 'T' is a callable type (std::function). Saves the lua
+     * function in the registry and constructs a function to call it again.
+     *
+     * Note: Pops the value from the stack.
+     */
+    template<typename T>
+    static typename std::enable_if<IsCallable<T>::value, T>::type getArgument(lua_State *lua)
+    {
+        // Here's the tricky part. Apparently, references in the registry can only
+        // be called once. This is why we always have to re-add it to the registry
+        // after every call. That means, we need a persistent variable for 'ref' and
+        // that's only possible with a pointer in this case.
+        int *ref = new int(luaL_ref(lua, LUA_REGISTRYINDEX));
+        LuaTBTypedStack::callbackRefs.push_back(std::unique_ptr<int>(ref));
+
+        // 'decltype(&T::operator())' represents the function signature of the callable object.
+        return GetLuaCallback<decltype(&T::operator())>::value(lua, ref);
+    }
+
+private:
+    template<typename T> struct GetLuaCallback;
+
+    // Gets a value from the top of the lua stack and returns it with the proper type.
+    // Does not pop the value!
+    /**
+     * @brief Get a value from the lua stack and convert it to type 'T'
+     * @param lua Pointer to the lua state
+     * @return Top element of the lua stack with the appropriate type
+     *
+     * Note: Does NOT pop the value from the stack.
+     */
+    template<typename T> static T getFromLuaStack(lua_State *lua);
+
+    // This class is only valid for std::function types. The type argument will not
+    // be a normal function signature because it is the signature of
+    // std::function<>::operator(), which is also the reason for the 'const'.
+    /**
+     * @brief Needed to get a lambda to call a lua function
+     *
+     * We need this class, becasue we need to specify the signature of the function
+     * before.
+     */
+    template<typename Ret, typename... Args>
+    struct GetLuaCallback<void (std::function<Ret(Args...)>::*)(Args...) const>
+    {
+        /**
+         * @brief Get a lambda to call a lua function later
+         * @param lua Pointer to the lua state
+         * @param ref Pointer to the lua registry reference where the function is stored
+         * @return Lambda that will call the function specified with ref
+         */
+        static std::function<void (Args...)> value(lua_State *lua, int *ref)
+        {
+            // We can't return 'callLuaFunction' directly, because we need the
+            // additional arguments 'lua' and 'ref' which we would like to hide
+            // from the user.
+            return [lua, ref](Args... args){callLuaFunction<Ret, Args...>(lua, ref, args...);};
+        }
+    };
+
+    /**
+     * @brief Pushes all arguments to the lua stack and calls a lua function afterwards
+     * @param lua Pointer to the lua state
+     * @param ref Pointer to the lua registry reference where the function is stored
+     * @param args Arguments for the function
+     */
+    template<typename Ret, typename... Args>
+    static void callLuaFunction(lua_State *lua, int *ref, Args... args)
+    {
+        // Get the value of the callback from the registry and push it to the stack
+        lua_rawgeti(lua, LUA_REGISTRYINDEX, *ref);
+
+        // Duplicate it on the stack so we can save it in the registry again after
+        // we called the callback.
+        lua_pushvalue(lua, 1);
+
+        // We pass one extra argument in case the function has no arguments at all
+        pushArgumentsToLuaStack<Args...>(lua, args..., false);
+        lua_pcall(lua, sizeof...(args), 0, 0);
+
+        // Release the old reference and save the function in the registry again
+        lua_unref(lua, *ref);
+        *ref = luaL_ref(lua, LUA_REGISTRYINDEX);
+    }
+
+    /**
+     * @brief Pushes nothing onto the stack
+     *
+     * This is needed in case the function has no arguments at all. Otherwise, we
+     * would have a missing argument for such a function. This is also why we pass
+     * a dummy argument in 'callLuaFunction', so we have at least one argument. It
+     * is the termination point for the recursive template.
+     */
+    template<typename T>
+    static void pushArgumentsToLuaStack(lua_State *, T)
+    { }
+
+    /**
+     * @brief Recursively pushes arguments to the lua stack
+     * @param lua Pointer to the lua state
+     * @param first First argument to push onto the stack
+     * @param args The remaining arguments to push onto the stack
+     */
+    template<typename First, typename... Args>
+    static void pushArgumentsToLuaStack(lua_State *lua, First first, Args... args)
+    {
+        pushToLuaStack(lua, first);
+        pushArgumentsToLuaStack<Args...>(lua, args...);
+    }
+
+    /**
+     * @brief Pushes a value to the lua stack
+     * @param lua Pointer to the lua state
+     * @param value The value to push
+     *
+     * Note: Only the specializations are valid
+     */
+    template<typename T>
+    static void pushToLuaStack(lua_State *lua, T value);
+
+    static std::list<std::unique_ptr<int> > callbackRefs;
+};
+
+#endif // LUATB_TYPED_STACK_H
Index: code/branches/PresentationFS18/src/orxonox/scriptablecontroller/scriptable_controller.cc
===================================================================
--- code/branches/PresentationFS18/src/orxonox/scriptablecontroller/scriptable_controller.cc	(revision 12016)
+++ code/branches/PresentationFS18/src/orxonox/scriptablecontroller/scriptable_controller.cc	(revision 12016)
@@ -0,0 +1,160 @@
+
+#include "scriptable_controller.h"
+#include "luatb.h"
+#include "infos/PlayerInfo.h"
+#include "core/command/Executor.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+
+// Used https://csl.name/post/lua-and-cpp/ as a reference
+int ScriptableController::runScript(const std::string &file_path)
+{
+    int ret;
+
+    // Not having a script specified at all is not an error.
+    if(file_path.empty()){
+        orxout(internal_warning) << "No script specified!" << std::endl;
+        return 0;
+    }
+
+    // Create a lua object
+    lua_State *lua = luaL_newstate();
+    if(lua == nullptr)
+    {
+        orxout(internal_warning) << "ScriptableController: Failed to load script " << file_path << std::endl;
+        return LUA_ERRMEM;
+    }
+
+    // Make standard libraries available in the Lua object.
+    luaL_openlibs(lua);
+
+    // Register the API
+    ScriptableControllerAPI *api = new ScriptableControllerAPI(lua, this);
+
+    // Load the program; this supports both source code and bytecode files.
+    if((ret = luaL_loadfile(lua, file_path.c_str())) != 0)
+    {
+        orxout(user_error) << "Failed to load level script " + file_path << std::endl;
+        this->printLuaError(lua);
+        delete api;
+        return ret;
+    }
+
+    // Execute the script
+    if((ret = lua_pcall(lua, 0, LUA_MULTRET, 0)) != 0)
+    {
+        orxout(user_error) << "Level script returned an error" << std::endl;
+        this->printLuaError(lua);
+        delete api;
+        return ret;
+    }
+
+    // Remember the api
+    this->apis_.push_back(std::unique_ptr<ScriptableControllerAPI>(api));
+
+    return 0;
+}
+
+void ScriptableController::setPlayer(PlayerInfo *player)
+{
+    this->player_ = player;
+}
+
+void ScriptableController::registerWorldEntity(std::string id, WorldEntity *entity)
+{
+    this->worldEntities_[id] = entity;
+}
+
+void ScriptableController::registerMobileEntity(std::string id, MobileEntity *entity)
+{
+    this->mobileEntities_[id] = entity;
+}
+
+void ScriptableController::registerPawn(std::string id, Pawn *pawn)
+{
+    this->pawns_[id] = pawn;
+    this->pawnsReverse_[pawn] = id;
+}
+
+void ScriptableController::pawnKilled(Pawn *pawn)
+{
+    auto pawn_id_iter = this->pawnsReverse_.find(pawn);
+    if(pawn_id_iter == this->pawnsReverse_.end())
+    {
+        orxout(internal_warning) << "Unregistered pawn reported that it's destroyed" << std::endl;
+        return;
+    }
+
+    // The ID of the pawn should already be invalid when we call the callback
+    std::string id = pawn_id_iter->second;
+    this->pawns_.erase(pawn_id_iter->second);
+    this->pawnsReverse_.erase(pawn_id_iter);
+
+    for(auto &api : this->apis_)
+        api->pawnKilled(id, pawn);
+}
+
+void ScriptableController::pawnHit(Pawn *target, Pawn *source, double new_health, double new_shield)
+{
+    auto target_id_iter = this->pawnsReverse_.find(target);
+    auto source_id_iter = this->pawnsReverse_.find(source);
+
+    if(target_id_iter == this->pawnsReverse_.end() ||
+       source_id_iter == this->pawnsReverse_.end() )
+    {
+        orxout(internal_warning) << "Unregistered pawn reported that it's hit" << std::endl;
+        return;
+    }
+
+    for(auto &api : this->apis_)
+        api->pawnHit(target_id_iter->second, source_id_iter->second, new_health, new_shield);
+}
+
+WorldEntity *ScriptableController::getWorldEntityByID(std::string id) const
+{
+    if(id == "player" || id == "Player" || id == "PLAYER")
+        return this->player_->getControllableEntity();
+
+    auto entity = this->worldEntities_.find(id);
+    return entity != this->worldEntities_.end() ? entity->second : nullptr;
+}
+
+MobileEntity *ScriptableController::getMobileEntityByID(std::string id) const
+{
+    if(id == "player" || id == "Player" || id == "PLAYER")
+        return this->player_->getControllableEntity();
+
+    auto entity = this->mobileEntities_.find(id);
+    return entity != this->mobileEntities_.end() ? entity->second : nullptr;
+}
+
+Pawn *ScriptableController::getPawnByID(std::string id) const
+{
+    if(id == "player" || id == "Player" || id == "PLAYER") {
+        return orxonox_cast<Pawn*>(this->player_->getControllableEntity());
+        orxout(user_status) << "Pawn is player!?" << std::endl;
+    }
+
+
+    auto pawn = this->pawns_.find(id);
+
+    if(pawn != this->pawns_.end()) {
+        orxout(user_status) << "Requested Pawn is available!" << std::endl;
+    }
+
+    return pawn != this->pawns_.end() ? pawn->second : nullptr;
+}
+
+void ScriptableController::printLuaError(lua_State *lua)
+{
+    // The error message is on top of the stack.
+    // Fetch it, print it and then pop it off the stack.
+    // Yes, this is 'const char*' and not 'std::string' because that's what lua gives us.
+    const char* message = lua_tostring(lua, -1);
+    orxout(user_error) << message << std::endl;
+    lua_pop(lua, 1);
+}
+
+}
Index: code/branches/PresentationFS18/src/orxonox/scriptablecontroller/scriptable_controller.h
===================================================================
--- code/branches/PresentationFS18/src/orxonox/scriptablecontroller/scriptable_controller.h	(revision 12016)
+++ code/branches/PresentationFS18/src/orxonox/scriptablecontroller/scriptable_controller.h	(revision 12016)
@@ -0,0 +1,139 @@
+#ifndef SCRIPTABLE_CONTROLLER_H
+#define SCRIPTABLE_CONTROLLER_H
+
+#include <lua.hpp>
+#include <string>
+#include <list>
+#include <map>
+#include <memory>
+#include "scriptable_controller_api.h"
+#include "core/CoreIncludes.h"
+#include "worldentities/WorldEntity.h"
+#include "worldentities/ControllableEntity.h"
+#include "tools/Timer.h"
+
+
+struct lua_State;
+
+namespace orxonox
+{
+
+/**
+ * @brief Runs a scripts on a per-level basis and handles the connection to orxonox
+ *
+ * The script is an attribute of the <Level> element with the name 'script' and should be
+ * the path to a lua script. The script will be run as soon as the player spawns. It can
+ * then register on various events and react to them. See ScriptableControllerAPI for
+ * the complete API.
+ *
+ * \sa ScriptableControllerAPI
+ */
+class ScriptableController
+{
+public:
+    /**
+     * @brief Run a lua script
+     * @param file_path Path to the script
+     * @return A lua error code (0 for success)
+     *
+     * Constructs an API for the script and runs it.
+     */
+    int runScript(const std::string &file_path);
+
+    /**
+     * @brief Set the player object of the current game
+     * @param player The player
+     *
+     * The player is a special object and can perfom special actions.
+     */
+    void setPlayer(PlayerInfo *player);
+
+    /**
+     * @brief Register a WorldEntity to the ScriptableController
+     * @param id The ID of the WorldEntity
+     * @param entity The WorldEntity
+     *
+     * The ScriptableController needs a list of all WorldEntity's so it can
+     * convert an ID to a WorldEntity.
+     */
+    void registerWorldEntity(std::string id, WorldEntity *entity);
+
+    /**
+     * @brief Register a MobileEntity to the ScriptableController
+     * @param id The ID of the MobileEntity
+     * @param entity The MobileEntity
+     *
+     * The ScriptableController needs a list of all MobileEntity's so it can
+     * convert an ID to a MobileEntity.
+     */
+    void registerMobileEntity(std::string id, MobileEntity *entity);
+
+    /**
+     * @brief Register a Pawn to the ScriptableController
+     * @param id The ID of the Pawn
+     * @param pawn The Pawn
+     *
+     * The ScriptableController needs a list of all Pawn's in addition to
+     * the WorldEntity's, because they have additional actions available.
+     */
+    void registerPawn(std::string id, Pawn *pawn);
+
+    /**
+     * @brief Called when a Pawn is killed
+     * @param pawn The Pawn
+     *
+     * Called by the Pawn itself as soon as it's killed.
+     */
+    void pawnKilled(Pawn *pawn);
+
+    /**
+     * @brief Called when a Pawn is hit
+     * @param target The hit Pawn
+     * @param source The shooting Pawn
+     * @param new_health The new health of the hit Pawn
+     * @param new_shield The new shield health of the hit Pawn
+     *
+     * Called by the Pawn itself as soon as it's hit.
+     */
+    void pawnHit(Pawn *target, Pawn *source, double new_health, double new_shield);
+
+    /**
+     * @brief Convert an ID to a WorldEntity pointer
+     * @param id The ID of the WorldEntity
+     * @return A pointer to the WorldEntity, nullptr if it's not found
+     */
+    WorldEntity *getWorldEntityByID(std::string id) const;
+
+    /**
+     * @brief Convert an ID to a MobileEntity pointer
+     * @param id The ID of the MobileEntity
+     * @return A pointer to the MobileEntity, nullptr if it's not found
+     */
+    MobileEntity *getMobileEntityByID(std::string id) const;
+
+    /**
+     * @brief Convert an ID to a Pawt pointer
+     * @param id The ID of the Pawn
+     * @return A pointer to the Pawn, nullptr if it's not found
+     */
+    Pawn *getPawnByID(std::string id) const;
+
+private:
+    std::list<std::unique_ptr<ScriptableControllerAPI> > apis_;
+    PlayerInfo *player_;
+    std::map<std::string, WorldEntity*> worldEntities_;
+    std::map<std::string, MobileEntity*> mobileEntities_;
+    std::map<std::string, Pawn*> pawns_;
+    std::map<Pawn*, std::string> pawnsReverse_;
+    std::map<std::string, ControllableEntity*> controllabelEntities_;
+
+    /**
+     * @brief Prints a human readable error message if a lua error occurs
+     * @param lua The lua state where the error occured
+     */
+    void printLuaError(lua_State *lua);
+};
+
+}
+
+#endif // SCRIPTABLE_CONTROLLER_H
Index: code/branches/PresentationFS18/src/orxonox/scriptablecontroller/scriptable_controller_api.cc
===================================================================
--- code/branches/PresentationFS18/src/orxonox/scriptablecontroller/scriptable_controller_api.cc	(revision 12016)
+++ code/branches/PresentationFS18/src/orxonox/scriptablecontroller/scriptable_controller_api.cc	(revision 12016)
@@ -0,0 +1,526 @@
+
+#include "scriptable_controller_api.h"
+#include "luatb.h"
+#include "scriptable_controller.h"
+#include "tools/Timer.h"
+#include "worldentities/pawns/Pawn.h"
+#include "infos/Bot.h"
+#include "worldentities/pawns/ModularSpaceShip.h"
+//#include "../modules/objects/collisionshapes/SphereCollisionShape.h"
+#include "graphics/Model.h"
+#include "worldentities/pawns/ScriptableControllerDrone.h"
+
+
+namespace orxonox
+{
+
+    const double ScriptableControllerAPI::periodic_interval = 0.5;
+
+    ScriptableControllerAPI::ScriptableControllerAPI(lua_State *lua, ScriptableController *controller)
+    {
+        this->lua_ = lua;
+        this->controller_ = controller;
+
+        // Haven't found a shorter way yet to write that... We need C++17!
+        LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::orxPrint)>::registerFunction<&ScriptableControllerAPI::orxPrint>(this, lua, "orxPrint");
+
+        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::registerAtPawnKilled)>::registerFunction<&ScriptableControllerAPI::registerAtPawnKilled>(this, lua, "registerAtPawnKilled");
+        LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::registerAtPawnHit)>::registerFunction<&ScriptableControllerAPI::registerAtPawnHit>(this, lua, "registerAtPawnHit");
+
+        LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::setPosition)>::registerFunction<&ScriptableControllerAPI::setPosition>(this, lua, "setPosition");
+        LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::setOrientation)>::registerFunction<&ScriptableControllerAPI::setOrientation>(this, lua, "setOrientation");
+        LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::setVelocity)>::registerFunction<&ScriptableControllerAPI::setVelocity>(this, lua, "setVelocity");
+        LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::setAngularVelocity)>::registerFunction<&ScriptableControllerAPI::setAngularVelocity>(this, lua, "setAngularVelocity");
+
+        LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::killPawn)>::registerFunction<&ScriptableControllerAPI::killPawn>(this, lua, "killPawn");
+        LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::spawn)>::registerFunction<&ScriptableControllerAPI::spawn>(this, lua, "spawn");
+
+        LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::spawnTest)>::registerFunction<&ScriptableControllerAPI::spawnTest>(this, lua, "spawnTest");
+
+
+
+        LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::myTestFunction)>::registerFunction<&ScriptableControllerAPI::myTestFunction>(this, lua, "mytestfunction");
+        LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::moveControllableEntity)>::registerFunction<&ScriptableControllerAPI::moveControllableEntity>(this, lua, "moveControllableEntity");
+
+
+
+        this->periodicTimer.setTimer(ScriptableControllerAPI::periodic_interval, true, createExecutor(createFunctor(&ScriptableControllerAPI::periodic, this)), false);
+    }
+
+    ScriptableControllerAPI::~ScriptableControllerAPI()
+    {
+        lua_close(this->lua_);
+    }
+
+    void ScriptableControllerAPI::orxPrint(std::string msg)
+    {
+        orxout(user_info) << msg << std::endl;
+    }
+
+    void ScriptableControllerAPI::registerAfterTimeout(std::function<void (void)> callback, double timeout)
+    {
+        // Kills itself when the timer fires
+        new Timer(timeout, false, callback, true);
+    }
+
+    //void ScriptableControllerAPI::registerPeriodically(std::function<void (void)> callback, double timeout)
+    //{
+    //    // Kills itself when the timer fires
+    //    new Timer(timeout, false, callback, true);
+    //}
+
+
+
+
+
+
+
+
+    void ScriptableControllerAPI::registerAtNearObject(std::function<void (std::string, std::string)> callback, std::string id1, std::string id2, double distance)
+    {
+        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));
+    }
+
+    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));
+    }
+
+    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));
+    }
+
+    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));
+    }
+
+    void ScriptableControllerAPI::registerAtPawnKilled(std::function<void (std::string)> callback, std::string id)
+    {
+        this->pawnDestroyedHandlers_[id].push_back(callback);
+    }
+
+    void ScriptableControllerAPI::registerAtPawnHit(std::function<void (std::string, std::string, double, double)> callback, std::string id)
+    {
+        this->pawnHitHandlers_[id].push_back(callback);
+    }
+
+    void ScriptableControllerAPI::killPawn(std::string id)
+    {
+        Pawn *pawn = this->controller_->getPawnByID(id);
+        if(pawn == nullptr)
+            orxout(user_warning) << "Trying to kill an unknown pawn" << std::endl;
+        else
+            pawn->kill();
+    }
+
+    void ScriptableControllerAPI::spawn(std::string type, std::string id)
+    {
+        if(this->controller_->getWorldEntityByID(id) != nullptr)
+        {
+            orxout(user_warning) << "Script tried to spawn an object, but an object with the given ID exists already" << std::endl;
+            return;
+        }
+
+        Identifier *identifier = ClassByString(type);
+        if(!identifier)
+        {
+            orxout(user_error) << "Script tried to spawn unknown object" << std::endl;
+            return;
+        }
+
+        if(!identifier->isLoadable())
+        {
+            orxout(user_error) << "Script tried to spawn unloadable object" << std::endl;
+            return;
+        }
+
+        WorldEntity *entity;
+        Identifiable *obj = identifier->fabricate(this->controller_->getWorldEntityByID("Player")->getContext());
+
+        orxout(user_error) << "First hit!" << std::endl;
+
+        if(obj->isA(ClassIdentifier<WorldEntity>::getIdentifier()))
+        {
+            entity = orxonox_cast<WorldEntity*>(obj);
+        }
+        else if(obj->isA(ClassIdentifier<PlayerInfo>::getIdentifier()))
+        {
+            // TODO This does not work yet because somehow the controllable entity is not set
+            // yet at this stage.
+    //        entity = orxonox_cast<PlayerInfo*>(obj)->getControllableEntity();
+
+
+            //use TEMPLATES in the map to define objects that are not present on the map yet
+            return;
+        }
+        else
+        {
+            orxout(user_warning) << "Script tried to spawn an object that is neither a WorldEntity, nor a PlayerInfo" << std::endl;
+            
+            return;
+        }
+
+        orxout(user_error) << "Second hit!" << std::endl;
+
+        if(entity->isA(ClassIdentifier<MobileEntity>::getIdentifier()))
+            this->controller_->registerMobileEntity(id, orxonox_cast<MobileEntity*>(entity));
+
+        if(entity->isA(ClassIdentifier<Pawn>::getIdentifier()))
+            this->controller_->registerPawn(id, orxonox_cast<Pawn*>(entity));
+
+        this->controller_->registerWorldEntity(id, orxonox_cast<WorldEntity*>(entity));
+
+
+        orxout(user_error) << "Third and final hit!" << std::endl;
+
+    }
+
+
+
+
+
+    void ScriptableControllerAPI::spawnTest(std::string id)
+    {
+        
+        if(this->controller_->getWorldEntityByID(id) != nullptr)
+        {
+            orxout(user_warning) << "Script tried to spawn an object, but an object with the given ID exists already" << std::endl;
+            return;
+        }
+        
+
+        Identifier *identifier = ClassByString("ScriptableControllerDrone");
+        
+        
+        if(!identifier)
+        {
+            orxout(user_error) << "Script tried to spawn unknown object" << std::endl;
+            return;
+        }
+
+        if(!identifier->isLoadable())
+        {
+            orxout(user_error) << "Script tried to spawn unloadable object" << std::endl;
+            return;
+        }
+
+        
+
+        WorldEntity *entity;
+        Identifiable *obj = identifier->fabricate(this->controller_->getWorldEntityByID("Player")->getContext());
+
+        orxout(user_status) << "First hit!" << std::endl;
+
+        if(obj->isA(ClassIdentifier<WorldEntity>::getIdentifier()))
+        {
+            orxout(user_status) << "Is WorldEntity!" << std::endl;
+            entity = orxonox_cast<WorldEntity*>(obj);
+        }
+        else if(obj->isA(ClassIdentifier<PlayerInfo>::getIdentifier()))
+        {
+            // TODO This does not work yet because somehow the controllable entity is not set
+            // yet at this stage.
+    //        entity = orxonox_cast<PlayerInfo*>(obj)->getControllableEntity();
+
+            orxout(user_status) << "Is PlayerInfo!" << std::endl;
+
+            //use TEMPLATES in the map to define objects that are not present on the map yet
+            return;
+        }
+        else
+        {
+            orxout(user_warning) << "Script tried to spawn an object that is neither a WorldEntity, nor a PlayerInfo" << std::endl;
+            
+            return;
+        }
+
+
+        if(entity->isA(ClassIdentifier<MobileEntity>::getIdentifier())) {
+            orxout(user_status) << "Is MobileEntity!" << std::endl;
+            this->controller_->registerMobileEntity(id, orxonox_cast<MobileEntity*>(entity));
+        }
+
+        if(entity->isA(ClassIdentifier<Pawn>::getIdentifier())) {
+            orxout(user_status) << "Is Pawn!" << std::endl;
+            this->controller_->registerPawn(id, orxonox_cast<Pawn*>(entity));
+        }
+
+        this->controller_->registerWorldEntity(id, orxonox_cast<WorldEntity*>(entity));
+
+        if(this->controller_->getPawnByID(id) != nullptr) {
+            orxout(user_status) << "Pawn is indeed available!" << std::endl;
+        }
+
+
+
+        ///////////////GOLD!!!!!!!!!!!!!!!////////////////////////
+        Pawn* pawn = this->controller_->getPawnByID(id);
+        //Attach to pawn
+        ScriptableControllerDrone* drone = new ScriptableControllerDrone(pawn->getContext()); // this is neccessary because the projectiles fired need a valid creator for the particlespawner (when colliding against something)
+        
+        drone->addTemplate("ScriptableControllerDroneTemplate"); //ScriptableControllerDroneTemplate spaceshipescort
+
+        Vector3 spawnPosition = pawn->getWorldPosition() + Vector3(30,0,-30);
+        drone->setPosition(spawnPosition);
+        //drone->moveFrontBack(1.0);
+
+
+        orxout(user_status) << "Final hit!" << std::endl;
+    }
+
+
+
+
+
+
+    void ScriptableControllerAPI::setPosition(std::string id, double x, double y, double z)
+    {
+        WorldEntity *entity = this->controller_->getWorldEntityByID(id);
+        if(entity == nullptr)
+        {
+            orxout(user_warning) << "Trying to set position of an unknown object" << std::endl;
+            return;
+        }
+
+        const Vector3 &old = entity->getPosition();
+
+        // If one of the values is NaN, don't change that value
+        x = std::isnan(x) ? old.x : x;
+        y = std::isnan(y) ? old.y : y;
+        z = std::isnan(z) ? old.z : z;
+
+        entity->setPosition(x, y, z);
+    }
+
+    void ScriptableControllerAPI::setOrientation(std::string id, double x, double y, double z, double angle)
+    {
+        WorldEntity *entity = this->controller_->getWorldEntityByID(id);
+        if(entity == nullptr)
+        {
+            orxout(user_warning) << "Trying to set orientation of an unknown object" << std::endl;
+            return;
+        }
+
+        Vector3 old_axis;
+        Degree old_angle;
+
+        entity->getOrientation().ToAngleAxis(old_angle, old_axis);
+
+        // If one of the values is NaN, don't change that value
+        x = std::isnan(x) ? old_axis.x : x;
+        y = std::isnan(y) ? old_axis.y : y;
+        z = std::isnan(z) ? old_axis.z : z;
+        angle = std::isnan(x) ? old_angle.valueDegrees() : angle;
+
+
+        entity->setOrientation(Vector3(x, y, z), Degree(angle));
+    }
+
+    void ScriptableControllerAPI::setVelocity(std::string id, double x, double y, double z)
+    {
+        MobileEntity *entity = this->controller_->getMobileEntityByID(id);
+        if(entity == nullptr)
+        {
+            orxout(user_warning) << "Trying to set velocity of an unknown object" << std::endl;
+            return;
+        }
+
+        const Vector3 &old = entity->getVelocity();
+
+        // If one of the values is NaN, don't change that value
+        x = std::isnan(x) ? old.x : x;
+        y = std::isnan(y) ? old.y : y;
+        z = std::isnan(z) ? old.z : z;
+
+        entity->setVelocity(x, y, z);
+    }
+
+    void ScriptableControllerAPI::setAngularVelocity(std::string id, double x, double y, double z)
+    {
+        MobileEntity *entity = this->controller_->getMobileEntityByID(id);
+        if(entity == nullptr)
+        {
+            orxout(user_warning) << "Trying to set angular velocity of an unknown object" << std::endl;
+            return;
+        }
+
+        const Vector3 &old = entity->getAngularVelocity();
+
+        // If one of the values is NaN, don't change that value
+        x = std::isnan(x) ? old.x : x;
+        y = std::isnan(y) ? old.y : y;
+        z = std::isnan(z) ? old.z : z;
+
+        entity->setAngularVelocity(x, y, z);
+    }
+
+    void ScriptableControllerAPI::pawnKilled(std::string id, Pawn *pawn)
+    {
+        for(auto callback : this->pawnDestroyedHandlers_[id])
+            callback(id);
+
+        this->pawnDestroyedHandlers_.erase(id);
+
+        // We need to delete those handlers as well, they're no longer valid
+        auto near_obj_handler = this->nearObjectHandlers_.begin();
+        while(near_obj_handler != this->nearObjectHandlers_.end())
+        {
+            if(near_obj_handler->entity1_ == pawn || near_obj_handler->entity2_ == pawn)
+                near_obj_handler = this->nearObjectHandlers_.erase(near_obj_handler);
+            else
+                near_obj_handler++;
+        }
+
+        auto near_point_handler = this->nearPointHandlers_.begin();
+        while(near_point_handler != this->nearPointHandlers_.end())
+        {
+            if(near_point_handler->entity_ == pawn)
+                near_point_handler = this->nearPointHandlers_.erase(near_point_handler);
+            else
+                near_point_handler++;
+        }
+
+        auto area_handler = this->areaHandlers_.begin();
+        while(area_handler != this->areaHandlers_.end())
+        {
+            if(area_handler->entity_ == pawn)
+                area_handler = this->areaHandlers_.erase(area_handler);
+            else
+                area_handler++;
+        }
+    }
+
+    void ScriptableControllerAPI::pawnHit(std::string target_id, std::string source_id, double new_health, double new_shield)
+    {
+        for(auto callback : this->pawnHitHandlers_[target_id])
+            callback(target_id, source_id, new_health, new_shield);
+    }
+
+    void ScriptableControllerAPI::periodic()
+    {
+        // 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++;
+                }
+            }
+        }
+
+    }
+
+
+    //// TESTTESTTESTTESTTESTTEST
+    double ScriptableControllerAPI::myTestFunction(double x, double y)
+    {
+        double z = x + y;
+        orxout(user_info) << "Result = " << z << endl;
+        return z;
+    }
+
+
+
+
+
+    void ScriptableControllerAPI::moveControllableEntity(std::string id, double x, double y, double z)
+    {
+        MobileEntity *entity = this->controller_->getMobileEntityByID(id);
+        
+        if(entity == nullptr)
+        {
+            orxout(user_warning) << "Trying to move an unknown object" << std::endl;
+            return;
+        }
+
+        Identifier *identifier = ClassByString("ControllableEntity");
+       
+        ControllableEntity *controllable_entity;
+        
+        if(identifier->isA(ClassIdentifier<ControllableEntity>::getIdentifier()))
+        {
+            orxout(user_info) << "Before final cast..."<< endl;
+            controllable_entity = orxonox_cast<ControllableEntity*>(entity);
+            orxout(user_info) << "After final cast..."<< endl;
+            //ATTACHED COLLISION SHAPE is MANDATORY in order to move the entity
+            controllable_entity->moveFrontBack(x);
+            controllable_entity->moveRightLeft(y);
+            controllable_entity->moveUpDown(z);
+            orxout(user_info) << "After move..."<< endl;
+        }
+
+        return;
+        
+    }
+}
Index: code/branches/PresentationFS18/src/orxonox/scriptablecontroller/scriptable_controller_api.h
===================================================================
--- code/branches/PresentationFS18/src/orxonox/scriptablecontroller/scriptable_controller_api.h	(revision 12016)
+++ code/branches/PresentationFS18/src/orxonox/scriptablecontroller/scriptable_controller_api.h	(revision 12016)
@@ -0,0 +1,300 @@
+#ifndef SCRIPTABLE_CONTROLLER_API_H
+#define SCRIPTABLE_CONTROLLER_API_H
+
+#include <functional>
+#include "core/CoreIncludes.h"
+#include "tools/Timer.h"
+#include "OgreVector3.h"
+
+struct lua_State;
+
+namespace orxonox
+{
+
+class ScriptableController;
+class WorldEntity;
+class Pawn;
+
+/**
+ * @brief API for ScriptableController's lua-scripts
+ *
+ * Defines the interface that lua can use in the scripts to communicate with orxonox.
+ *
+ * \sa ScriptableController
+ */
+class ScriptableControllerAPI
+{
+friend class ScriptableController;
+
+public:
+    /**
+     * @brief Constructs the API with the given lua state
+     * @param lua The lua state
+     * @param controller The parent controller
+     *
+     * This will not run any scripts, it'll just make the API visible to lua.
+     */
+    ScriptableControllerAPI(lua_State *lua, ScriptableController *controller);
+
+    /**
+     * @brief Destructs the API and closes the lua state.
+     */
+    ~ScriptableControllerAPI();
+
+// ### API ####################################################################
+
+    /**
+     * @brief Print a message
+     * @param msg The message
+     *
+     * Use this function instead of printing from lua directly, because that will mess up the
+     * output as it is not synchronized.
+     */
+    void orxPrint(std::string msg);
+
+    /**
+     * @brief Register a function that will be called after a timeout
+     * @param callback The function to call after the timeout expired
+     * @param timeout The timeout in seconds
+     */
+    void registerAfterTimeout(std::function<void (void)> callback, double timeout);
+
+    /**
+     * @brief Register a function that will be called when two object are close to eachother
+     * @param callback The function to call when the objects are close enough
+     * @param id1 The first object
+     * @param id2 The second object
+     * @param distance If the distance between the two objects is smaller than this value,
+     * the function is called
+     *
+     * Note: Distances are only checked every 0.5s!
+     */
+    void registerAtNearObject(std::function<void(std::string, std::string)> callback, std::string id1, std::string id2, double distance);
+
+    /**
+     * @brief Register a function that will be called when an object is close to a certain point
+     * @param callback The function to call when the object is close enough
+     * @param id The object
+     * @param x X-coordinate of the point
+     * @param y Y-coordinate of the point
+     * @param z Z-coordinate of the point
+     * @param distance If the distance between the object and the point is smaller than this value, the
+     * function is called.
+     *
+     * Note: Distances are only checked every 0.5s!
+     */
+    void registerAtNearPoint(std::function<void (std::string)> callback, std::string id, double x, double y, double z, double distance);
+
+    /**
+     * @brief Register a function that will be called when an object enters a cubic area
+     * @param callback The function to call when the object entered the area
+     * @param id The object
+     * @param x X-coordinate of the top-left corner
+     * @param y Y-coordinate of the top-left corner
+     * @param z Z-coordinate of the top-left corner
+     * @param dx Size in X-direction of the cube
+     * @param dy Size in Y-direction of the cube
+     * @param dz Size in Z-direction of the cube
+     *
+     * Note: Distances are only checked every 0.5s!
+     */
+    void registerAtAreaEnter(std::function<void (std::string)> callback, std::string id, int x, int y, int z, int dx, int dy, int dz);
+
+    /**
+     * @brief Register a function that will be called when an object leaves a cubic area
+     * @param callback The function to call when the object left the area
+     * @param id The object
+     * @param x X-coordinate of the top-left corner
+     * @param y Y-coordinate of the top-left corner
+     * @param z Z-coordinate of the top-left corner
+     * @param dx Size in X-direction of the cube
+     * @param dy Size in Y-direction of the cube
+     * @param dz Size in Z-direction of the cube
+     *
+     * Note: Distances are only checked every 0.5s!
+     */
+    void registerAtAreaLeave(std::function<void (std::string)> callback, std::string id, int x, int y, int z, int dx, int dy, int dz);
+
+    /**
+     * @brief Register a function that will be called when a Pawn is killed
+     * @param callback The function to call as soon as the Pawn is dead
+     * @param id The Pawn
+     *
+     * Note: Once a Pawn is dead, the callback is removed, even if the pawn got magically revived.
+     */
+    void registerAtPawnKilled(std::function<void (std::string)> callback, std::string id);
+
+    /**
+     * @brief Register a function that will be called when a Pawn is hit
+     * @param callback The function to call as soon as the Pawn is hit
+     * @param id The Pawn
+     *
+     * Note: Once a Pawn is dead, the all hit-callbacks are removed, even if the pawn got magically revived.
+     */
+    void registerAtPawnHit(std::function<void (std::string, std::string, double, double)> callback, std::string id);
+
+    /**
+     * @brief Kill a pawn
+     * @param id The pawn to kill
+     *
+     * Note: It might up to 0.5s until the pawn is actually killed.
+     */
+    void killPawn(std::string id);
+
+    /**
+     * @brief Spawn an object
+     * @param type Name of the class of the object you want to spawn
+     * @param id The newly created ID that can be used to access this object
+     *
+     * IMPORTANT: Do not use this function yet, it only has minimal functionality and is not
+     * really helpful as it is.
+     */
+    void spawn(std::string type, std::string id);
+
+    void spawnTest(std::string id);
+
+    /**
+     * @brief Set the position of an object
+     * @param id The ID of the object
+     * @param x The position on the x-axis
+     * @param y The position on the y-axis
+     * @param z The position on the z-axis
+     */
+    void setPosition(std::string id, double x, double y, double z);
+
+    /**
+     * @brief Set the orientation of an object
+     * @param id The ID of the object
+     * @param x The x component of the axis vector
+     * @param y The y component of the axis vector
+     * @param z The z component of the axis vector
+     * @param angle The angle around the axis
+     *
+     * To set the orientation, you have to specify the direction that the
+     * object should be facing with the vector (x, y, z) and the rotation
+     * of the object around this axis with 'angle', which has to be given
+     * in degrees, NOT radian. The vector does not have to be normalized.
+     */
+    void setOrientation(std::string id, double x, double y, double z, double angle);
+
+    /**
+     * @brief Set the velocity of an object
+     * @param id The ID of the object
+     * @param x The velocity in x-direction
+     * @param y The velocity in y-direction
+     * @param z The velocity in z-direction
+     *
+     * The velocity is in units per second.
+     */
+    void setVelocity(std::string id, double x, double y, double z);
+
+    /**
+     * @brief Set the angular velocity of an object
+     * @param id The ID of the object
+     * @param x The rotation velocity around the x-axis
+     * @param y The rotation velocity around the y-axis
+     * @param z The rotation velocity around the z-axis
+     */
+    void setAngularVelocity(std::string id, double x, double y, double z);
+
+
+    /**
+     * @brief Set the angular velocity of an object
+     * @param id The ID of the object
+     * @param x The rotation velocity around the x-axis
+     * @param y The rotation velocity around the y-axis
+     * @param z The rotation velocity around the z-axis
+     */
+    double myTestFunction(double x, double y);
+
+    void moveControllableEntity(std::string id, double x, double y, double z);
+
+// ### API END ################################################################
+
+private:
+    /**
+     * @brief Groups everything together that is needed to handle a near-object event
+     */
+    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_;
+    };
+
+    /**
+     * @brief Groups everything together that is needed to handle a near-poinb event
+     */
+    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_;
+    };
+
+    /**
+     * @brief Groups everything together that is needed to handle an area enter/leave event
+     */
+    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_;
+    std::map<std::string, std::list<std::function<void (std::string)> > > pawnDestroyedHandlers_;
+    std::map<std::string, std::list<std::function<void (std::string, std::string, double, double)> > > pawnHitHandlers_;
+    Timer periodicTimer;
+    static const double periodic_interval;
+
+    /**
+     * @brief Called by ScriptableController when a pawn is killed
+     * @param id The dead pawn
+     *
+     * Calls the lua callbacks associated with this event.
+     */
+    void pawnKilled(std::string id, Pawn *pawn);
+
+    /**
+     * @brief Called by ScriptableController when a Pawn is hit
+     * @param target_id The hit Pawn
+     * @param source_id The shooting Pawn
+     * @param new_health The new health of the hit Pawn
+     * @param new_shield The new shield health of the hit Pawn
+     */
+    void pawnHit(std::string target_id, std::string source_id, double new_health, double new_shield);
+
+    /**
+     * @brief Called every 0.5s
+     *
+     * This handles things that have to be checked periodically (like area events)
+     * but doing this in every tick would be an overkill.
+     */
+    void periodic(void);
+};
+
+}
+
+#endif // SCRIPTABLE_CONTROLLER_API_H
Index: code/branches/PresentationFS18/src/orxonox/worldentities/AutonomousDrone.cc
===================================================================
--- code/branches/PresentationFS18/src/orxonox/worldentities/AutonomousDrone.cc	(revision 12016)
+++ code/branches/PresentationFS18/src/orxonox/worldentities/AutonomousDrone.cc	(revision 12016)
@@ -0,0 +1,200 @@
+/*
+ *   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:
+ *      Oli Scheuss
+ *   Co-authors:
+ *      Damian 'Mozork' Frick
+ *
+ */
+
+#include "AutonomousDrone.h"
+
+#include "core/CoreIncludes.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+
+namespace orxonox
+{
+    //TODO: Put your code in here:
+    // Create the factory for the drone.
+
+    /**
+    @brief
+        Constructor. Registers the object and initializes some default values.
+    @param creator
+        The creator of this object.
+    */
+
+    RegisterClass(AutonomousDrone);
+    
+    AutonomousDrone::AutonomousDrone(Context* context) : ControllableEntity(context)
+    {
+        //TODO: Put your code in here:
+        // Register the drone class to the core.
+
+	RegisterObject(AutonomousDrone);
+      
+        this->myController_ = NULL;
+
+        this->localLinearAcceleration_.setValue(0, 0, 0);
+        this->localAngularAcceleration_.setValue(0, 0, 0);
+        this->primaryThrust_  = 100;
+        this->auxiliaryThrust_ = 100;
+        this->rotationThrust_ = 10;
+	    this->mass_ = 100;
+	    this->linearDamping_ = 0.5;
+	    this->angularDamping_ = 0.3;
+
+        this->setCollisionType(CollisionType::Dynamic);
+
+        //this->myController_ = new AutonomousDroneController(this); // Creates a new controller and passes our this pointer to it as creator.
+    }
+
+    /**
+    @brief
+        Destructor. Destroys controller, if present.
+    */
+    AutonomousDrone::~AutonomousDrone()
+    {
+        // Deletes the controller if the object was initialized and the pointer to the controller is not NULL.
+        if( this->isInitialized() && this->myController_ != NULL )
+            delete this->myController_;
+    }
+
+    /**
+    @brief
+        Method for creating a AutonomousDrone through XML.
+    */
+    void AutonomousDrone::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        // This calls the XMLPort function of the parent class
+        SUPER(AutonomousDrone, XMLPort, xmlelement, mode);
+
+        XMLPortParam(AutonomousDrone, "primaryThrust", setPrimaryThrust, getPrimaryThrust, xmlelement, mode);
+        //TODO: Put your code in here:
+        // Make sure you add the variables auxiliaryThrust_ and rotationThrust_ to XMLPort.
+        // Variables can be added by the following command
+        // XMLPortParam(Classname, "xml-attribute-name (i.e. variablename)", setFunctionName, getFunctionName, xmlelement, mode);
+        // Also make sure that you also create the get- and set-functions in AutonomousDrone.h. As you can see, the get- and set-functions for the variable primaryThrust_ has already been specified there, so you can get your inspiration from there.
+        XMLPortParam(AutonomousDrone, "auxiliaryThrust", setAuxiliaryThrust, getAuxiliaryThrust, xmlelement, mode);
+    XMLPortParam(AutonomousDrone, "rotationThrust", setRotationThrust, getRotationThrust, xmlelement, mode);
+	XMLPortParam(AutonomousDrone, "mass", setMass, getMass, xmlelement, mode);
+	XMLPortParam(AutonomousDrone, "linearDamping", setLinearDamping, getLinearDamping, xmlelement, mode);
+	XMLPortParam(AutonomousDrone, "angularDamping", setAngularDamping, getAngularDamping, xmlelement, mode);
+
+   
+	
+	
+
+    }
+
+    /**
+    @brief
+        Defines which actions the AutonomousDrone has to take in each tick.
+    @param dt
+        The length of the tick.
+    */
+    void AutonomousDrone::tick(float dt)
+    {
+        SUPER(AutonomousDrone, tick, dt);
+
+        this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() * getMass() * this->auxiliaryThrust_);
+        this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() * getMass() * this->auxiliaryThrust_);
+        if (this->localLinearAcceleration_.z() > 0)
+            this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->auxiliaryThrust_);
+        else
+            this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->primaryThrust_);
+        this->physicalBody_->applyCentralForce(physicalBody_->getWorldTransform().getBasis() * this->localLinearAcceleration_);
+        this->localLinearAcceleration_.setValue(0, 0, 0);
+
+        this->localAngularAcceleration_ *= this->getLocalInertia() * this->rotationThrust_;
+        this->physicalBody_->applyTorque(physicalBody_->getWorldTransform().getBasis() * this->localAngularAcceleration_);
+        this->localAngularAcceleration_.setValue(0, 0, 0);
+    }
+
+    /**
+    @brief
+        Moves the AutonomousDrone in the negative z-direction (Front/Back) by an amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the movement.
+    */
+    void AutonomousDrone::moveFrontBack(const Vector2& value)
+    {
+        this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() - value.x);
+    }
+
+    /**
+    @brief
+        Moves the AutonomousDrone in the x-direction (Right/Left) by an amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the movement.
+    */
+    void AutonomousDrone::moveRightLeft(const Vector2& value)
+    {
+        this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() + value.x);
+    }
+
+    /**
+    @brief
+        Moves the AutonomousDrone in the y-direction (Up/Down) by an amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the movement.
+    */
+    void AutonomousDrone::moveUpDown(const Vector2& value)
+    {
+        this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() + value.x);
+    }
+
+    /**
+    @brief
+        Rotates the AutonomousDrone around the y-axis by the amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the angular movement.
+    */
+    void AutonomousDrone::rotateYaw(const Vector2& value)
+    {
+        this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() - value.x);
+    }
+
+    /**
+    @brief
+        Rotates the AutonomousDrone around the x-axis by the amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the angular movement.
+    */
+    void AutonomousDrone::rotatePitch(const Vector2& value)
+    {
+        this->localAngularAcceleration_.setX(this->localAngularAcceleration_.x() + value.x);
+    }
+
+    /**
+    @brief
+        Rotates the AutonomousDrone around the z-axis by the amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the angular movement.
+    */
+    void AutonomousDrone::rotateRoll(const Vector2& value)
+    {
+        this->localAngularAcceleration_.setZ(this->localAngularAcceleration_.z() + value.x);
+    }
+
+
+}
Index: code/branches/PresentationFS18/src/orxonox/worldentities/AutonomousDrone.h
===================================================================
--- code/branches/PresentationFS18/src/orxonox/worldentities/AutonomousDrone.h	(revision 12016)
+++ code/branches/PresentationFS18/src/orxonox/worldentities/AutonomousDrone.h	(revision 12016)
@@ -0,0 +1,212 @@
+/*
+ *   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:
+ *      Oli Scheuss
+ *   Co-authors:
+ *      Damian 'Mozork' Frick
+ *
+ */
+
+#ifndef _AutonomousDrone_H__
+#define _AutonomousDrone_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "core/XMLPort.h"
+#include "controllers/AutonomousDroneController.h"
+
+#include "ControllableEntity.h"
+
+namespace orxonox {
+
+    /**
+    @brief
+        Drone, that is made to move upon a specified pattern.
+        This class was constructed for the PPS tutorial.
+    @author
+        Oli Scheuss
+    */
+    class _OrxonoxExport AutonomousDrone : public ControllableEntity
+    {
+        public:
+            AutonomousDrone(Context* context);
+            virtual ~AutonomousDrone();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating an AutonomousDrone through XML.
+            virtual void tick(float dt); //!< Defines which actions the AutonomousDrone has to take in each tick.
+
+            virtual void moveFrontBack(const Vector2& value);
+            virtual void moveRightLeft(const Vector2& value);
+            virtual void moveUpDown(const Vector2& value);
+
+            virtual void rotateYaw(const Vector2& value);
+            virtual void rotatePitch(const Vector2& value);
+            virtual void rotateRoll(const Vector2& value);
+
+            /**
+            @brief Moves the Drone in the Front/Back-direction by the specifed amount.
+            @param value  The amount by which the drone is to be moved.
+            */
+
+
+            inline void moveFrontBack(float value)
+            { this->moveFrontBack(Vector2(value, 0)); }
+            /**
+            @brief Moves the Drone in the Right/Left-direction by the specifed amount.
+            @param value  The amount by which the drone is to be moved.
+            */
+            inline void moveRightLeft(float value)
+            { this->moveRightLeft(Vector2(value, 0)); }
+            /**
+            @brief Moves the Drone in the Up/Down-direction by the specifed amount.
+            @param value  The amount by which the drone is to be moved.
+            */
+            inline void moveUpDown(float value)
+            { this->moveUpDown(Vector2(value, 0)); }
+
+            /**
+            @brief Rotates the Drone around the y-axis by the specifed amount.
+            @param value  The amount by which the drone is to be rotated.
+            */
+            inline void rotateYaw(float value)
+            { this->rotateYaw(Vector2(value, 0)); }
+            /**
+            @brief Rotates the Drone around the x-axis by the specifed amount.
+            @param value  The amount by which the drone is to be rotated.
+            */
+            inline void rotatePitch(float value)
+            { this->rotatePitch(Vector2(value, 0)); }
+            /**
+            @brief Rotates the Drone around the z-axis by the specifed amount.
+            @param value  The amount by which the drone is to be rotated.
+            */
+            inline void rotateRoll(float value)
+            { this->rotateRoll(Vector2(value, 0)); }
+
+            /**
+            @brief Sets the primary thrust to the input amount.
+            @param thrust The amount of thrust.
+            */
+            inline void setPrimaryThrust( float thrust )
+                { this->primaryThrust_ = thrust; }
+            //TODO: Place your set-functions here.
+            // Hint: auxiliary thrust, rotation thrust.
+
+
+	     /**
+            @brief Sets the auxiliary thrust to the input amount.
+            @param thrust The amount of thrust.
+            */
+            inline void setAuxiliaryThrust( float thrust )
+                { this->auxiliaryThrust_ = thrust; }
+
+	     /**
+            @brief Sets the rotation thrust to the input amount.
+            @param thrust The amount of thrust.
+            */
+            inline void setRotationThrust( float thrust )
+                { this->rotationThrust_ = thrust; }
+
+	     /**
+            @brief Sets the rotation thrust to the input amount.
+            @param thrust The amount of thrust.
+            */
+            inline void setMass( float mass )
+                { this->mass_ = mass; }
+
+	     /**
+            @brief Sets the rotation thrust to the input amount.
+            @param thrust The amount of thrust.
+            */
+            inline void setLinearDamping( float damping )
+                { this->linearDamping_ = damping; }
+
+	     /**
+            @brief Sets the rotation thrust to the input amount.
+            @param thrust The amount of thrust.
+            */
+            inline void setAngularDamping( float damping )
+                { this->angularDamping_ = damping; }
+            
+	    
+	    
+            /**
+            @brief Gets the primary thrust to the input amount.
+            @return The amount of thrust.
+            */
+            inline float getPrimaryThrust()
+                { return this->primaryThrust_; }
+            //TODO: Place your get-functions here.
+
+	    /**
+            @brief Gets the primary thrust to the input amount.
+            @return The amount of thrust.
+            */
+            inline float getAuxiliaryThrust()
+                { return this->auxiliaryThrust_; }
+
+	     /**
+            @brief Gets the primary thrust to the input amount.
+            @return The amount of thrust.
+            */
+            inline float getRotationThrust()
+                { return this->rotationThrust_; }
+
+	     /**
+            @brief Gets the primary thrust to the input amount.
+            @return The amount of thrust.
+            */
+            inline float getMass()
+                { return this->mass_; }
+
+	     /**
+            @brief Gets the primary thrust to the input amount.
+            @return The amount of thrust.
+            */
+            inline float getLinearDamping()
+                { return this->linearDamping_; }
+
+	     /**
+            @brief Gets the primary thrust to the input amount.
+            @return The amount of thrust.
+            */
+            inline float getAngularDamping()
+                { return this->angularDamping_; }
+
+            
+
+        private:
+            AutonomousDroneController *myController_; //!< The controller of the AutonomousDrone.
+
+            btVector3 localLinearAcceleration_; //!< The linear acceleration that is used to move the AutonomousDrone the next tick.
+            btVector3 localAngularAcceleration_; //!< The linear angular acceleration that is used to move the AutonomousDrone the next tick.
+            float primaryThrust_; //!< The amount of primary thrust. This is just used, when moving forward.
+            float auxiliaryThrust_; //!< The amount of auxiliary thrust. Used for all other movements (except for rotations).
+            float rotationThrust_; //!< The amount of rotation thrust. Used for rotations only.s
+	    float mass_;
+	    float linearDamping_;
+	    float angularDamping_;
+    };
+
+}
+
+#endif // _AutonomousDrone_H__
Index: code/branches/PresentationFS18/src/orxonox/worldentities/CMakeLists.txt
===================================================================
--- code/branches/PresentationFS18/src/orxonox/worldentities/CMakeLists.txt	(revision 12015)
+++ code/branches/PresentationFS18/src/orxonox/worldentities/CMakeLists.txt	(revision 12016)
@@ -15,4 +15,5 @@
   NameableStaticEntity.cc
   Arrow.cc
+  AutonomousDrone.cc
 )
 
Index: code/branches/PresentationFS18/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/branches/PresentationFS18/src/orxonox/worldentities/ControllableEntity.cc	(revision 12015)
+++ code/branches/PresentationFS18/src/orxonox/worldentities/ControllableEntity.cc	(revision 12016)
@@ -39,4 +39,5 @@
 
 #include "Scene.h"
+#include "Level.h"
 #include "infos/PlayerInfo.h"
 #include "controllers/NewHumanController.h"
@@ -67,5 +68,4 @@
         this->camera_ = nullptr;
         this->xmlcontroller_ = nullptr;
-        //this->controller_ = nullptr;
         this->reverseCamera_ = nullptr;
         this->bDestroyWhenPlayerLeft_ = false;
Index: code/branches/PresentationFS18/src/orxonox/worldentities/ControllableEntity.h
===================================================================
--- code/branches/PresentationFS18/src/orxonox/worldentities/ControllableEntity.h	(revision 12015)
+++ code/branches/PresentationFS18/src/orxonox/worldentities/ControllableEntity.h	(revision 12016)
@@ -175,4 +175,5 @@
             inline int getTeam() const
                 { return this->team_; }
+
 
         protected:
Index: code/branches/PresentationFS18/src/orxonox/worldentities/MobileEntity.cc
===================================================================
--- code/branches/PresentationFS18/src/orxonox/worldentities/MobileEntity.cc	(revision 12015)
+++ code/branches/PresentationFS18/src/orxonox/worldentities/MobileEntity.cc	(revision 12016)
@@ -36,4 +36,6 @@
 
 #include "Scene.h"
+#include "Level.h"
+#include "scriptablecontroller/scriptable_controller.h"
 
 namespace orxonox
@@ -72,4 +74,7 @@
                 this->setAngularVelocity(rotationAxis.normalisedCopy() * rotationRate.valueRadians());
         }
+
+        if(!this->id_.empty() && this->getLevel() != nullptr)
+            this->getLevel()->getScriptableController()->registerMobileEntity(this->id_, this);
     }
 
Index: code/branches/PresentationFS18/src/orxonox/worldentities/WorldEntity.cc
===================================================================
--- code/branches/PresentationFS18/src/orxonox/worldentities/WorldEntity.cc	(revision 12015)
+++ code/branches/PresentationFS18/src/orxonox/worldentities/WorldEntity.cc	(revision 12016)
@@ -44,5 +44,7 @@
 #include "core/XMLPort.h"
 #include "Scene.h"
+#include "Level.h"
 #include "collisionshapes/WorldEntityCollisionShape.h"
+#include "scriptablecontroller/scriptable_controller.h"
 
 namespace orxonox
@@ -79,4 +81,5 @@
         this->parentID_ = OBJECTID_UNKNOWN;
         this->bDeleteWithParent_ = true;
+        this->id_ = -1;
 
         this->node_->setPosition(Vector3::ZERO);
@@ -160,4 +163,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);
@@ -181,4 +185,7 @@
         // Attached collision shapes
         XMLPortObject(WorldEntity, CollisionShape, "collisionShapes", attachCollisionShape, getAttachedCollisionShape, xmlelement, mode);
+
+        if(!this->id_.empty() && this->getLevel() != nullptr)
+            this->getLevel()->getScriptableController()->registerWorldEntity(this->id_, this);
     }
 
Index: code/branches/PresentationFS18/src/orxonox/worldentities/WorldEntity.h
===================================================================
--- code/branches/PresentationFS18/src/orxonox/worldentities/WorldEntity.h	(revision 12015)
+++ code/branches/PresentationFS18/src/orxonox/worldentities/WorldEntity.h	(revision 12016)
@@ -110,4 +110,10 @@
             virtual void changedActivity(void) override;
             virtual void changedVisibility(void) override;
+
+            inline std::string getID(void)
+                { return this->id_; }
+
+            inline void setID(std::string id)
+                { this->id_ = id; }
 
             virtual void setPosition(const Vector3& position) = 0;
@@ -442,4 +448,5 @@
 
             btRigidBody*  physicalBody_; //!< Bullet rigid body. Everything physical is applied to this instance.
+            std::string   id_;           //!< Used by the ScriptableController to identify objects
 
         private:
Index: code/branches/PresentationFS18/src/orxonox/worldentities/pawns/CMakeLists.txt
===================================================================
--- code/branches/PresentationFS18/src/orxonox/worldentities/pawns/CMakeLists.txt	(revision 12015)
+++ code/branches/PresentationFS18/src/orxonox/worldentities/pawns/CMakeLists.txt	(revision 12016)
@@ -4,4 +4,5 @@
   Pawn.cc
   SpaceShip.cc
+  ScriptableControllerDrone.cc
   ModularSpaceShip.cc
   TeamBaseMatchBase.cc
Index: code/branches/PresentationFS18/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/PresentationFS18/src/orxonox/worldentities/pawns/Pawn.cc	(revision 12015)
+++ code/branches/PresentationFS18/src/orxonox/worldentities/pawns/Pawn.cc	(revision 12016)
@@ -50,4 +50,6 @@
 #include "sound/WorldSound.h"
 #include "core/object/ObjectListIterator.h"
+#include "Level.h"
+#include "scriptablecontroller/scriptable_controller.h"
 
 #include "controllers/FormationController.h"
@@ -160,4 +162,7 @@
 
         XMLPortParam ( RadarViewable, "radarname", setRadarName, getRadarName, xmlelement, mode );
+
+        if(!this->id_.empty() && this->getLevel() != nullptr)
+            this->getLevel()->getScriptableController()->registerPawn(this->id_, this);
     }
 
@@ -282,5 +287,5 @@
         {
             // Health-damage cannot be absorbed by shields.
-            // Shield-damage only reduces shield health. 
+            // Shield-damage only reduces shield health.
             // Normal damage can be (partially) absorbed by shields.
 
@@ -302,4 +307,5 @@
                 this->setHealth(this->health_ - (damage - shielddamage) - healthdamage);
             }
+            this->getLevel()->getScriptableController()->pawnHit(this, originator, this->health_, this->shieldHealth_);
 
             this->lastHitOriginator_ = originator;
@@ -402,4 +408,6 @@
             }
         }
+
+        this->getLevel()->getScriptableController()->pawnKilled(this);
     }
     void Pawn::goWithStyle()
@@ -625,5 +633,5 @@
         {
             // delete all debug models
-            for(Model* model : debugWeaponSlotModels_) 
+            for(Model* model : debugWeaponSlotModels_)
             {
                 model->destroy();
Index: code/branches/PresentationFS18/src/orxonox/worldentities/pawns/ScriptableControllerDrone.cc
===================================================================
--- code/branches/PresentationFS18/src/orxonox/worldentities/pawns/ScriptableControllerDrone.cc	(revision 12016)
+++ code/branches/PresentationFS18/src/orxonox/worldentities/pawns/ScriptableControllerDrone.cc	(revision 12016)
@@ -0,0 +1,208 @@
+/*
+ *   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:
+ *      Oli Scheuss
+ *   Co-authors:
+ *      Damian 'Mozork' Frick
+ *
+ */
+
+#include "ScriptableControllerDrone.h"
+
+#include "core/CoreIncludes.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+
+namespace orxonox
+{
+    //TODO: Put your code in here:
+    // Create the factory for the drone.
+
+    /**
+    @brief
+        Constructor. Registers the object and initializes some default values.
+    @param creator
+        The creator of this object.
+    */
+
+    RegisterClass(ScriptableControllerDrone);
+    
+    ScriptableControllerDrone::ScriptableControllerDrone(Context* context) : Pawn(context)
+    {
+        //TODO: Put your code in here:
+        // Register the drone class to the core.
+
+	RegisterObject(ScriptableControllerDrone);
+      
+        //this->myController_ = NULL;
+
+        this->localLinearAcceleration_.setValue(0, 0, 0);
+        this->localAngularAcceleration_.setValue(0, 0, 0);
+        this->primaryThrust_  = 100;
+        this->auxiliaryThrust_ = 100;
+        this->rotationThrust_ = 10;
+	    this->mass_ = 100;
+	    this->linearDamping_ = 0.5;
+	    this->angularDamping_ = 0.3;
+
+        this->setRadarVisibility(false);
+        
+        this->setCollisionType(WorldEntity::CollisionType::Dynamic);
+
+        //this->setCollisionType(CollisionType::Dynamic);
+
+        //this->myController_ = new ScriptableControllerDroneController(this); // Creates a new controller and passes our this pointer to it as creator.
+    }
+
+    /**
+    @brief
+        Destructor. Destroys controller, if present.
+    */
+    ScriptableControllerDrone::~ScriptableControllerDrone()
+    {
+        // Deletes the controller if the object was initialized and the pointer to the controller is not NULL.
+        if( this->isInitialized()); //)&& this->myController_ != NULL )
+            //delete this->myController_;
+    }
+
+    /**
+    @brief
+        Method for creating a ScriptableControllerDrone through XML.
+    */
+    void ScriptableControllerDrone::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        // This calls the XMLPort function of the parent class
+        SUPER(ScriptableControllerDrone, XMLPort, xmlelement, mode);
+
+        XMLPortParam(ScriptableControllerDrone, "primaryThrust", setPrimaryThrust, getPrimaryThrust, xmlelement, mode);
+        //TODO: Put your code in here:
+        // Make sure you add the variables auxiliaryThrust_ and rotationThrust_ to XMLPort.
+        // Variables can be added by the following command
+        // XMLPortParam(Classname, "xml-attribute-name (i.e. variablename)", setFunctionName, getFunctionName, xmlelement, mode);
+        // Also make sure that you also create the get- and set-functions in ScriptableControllerDrone.h. As you can see, the get- and set-functions for the variable primaryThrust_ has already been specified there, so you can get your inspiration from there.
+        XMLPortParam(ScriptableControllerDrone, "auxiliaryThrust", setAuxiliaryThrust, getAuxiliaryThrust, xmlelement, mode);
+    XMLPortParam(ScriptableControllerDrone, "rotationThrust", setRotationThrust, getRotationThrust, xmlelement, mode);
+	XMLPortParam(ScriptableControllerDrone, "mass", setMass, getMass, xmlelement, mode);
+	XMLPortParam(ScriptableControllerDrone, "linearDamping", setLinearDamping, getLinearDamping, xmlelement, mode);
+	XMLPortParam(ScriptableControllerDrone, "angularDamping", setAngularDamping, getAngularDamping, xmlelement, mode);
+
+   
+	
+	
+
+    }
+
+    /**
+    @brief
+        Defines which actions the ScriptableControllerDrone has to take in each tick.
+    @param dt
+        The length of the tick.
+    */
+    void ScriptableControllerDrone::tick(float dt)
+    {
+        SUPER(ScriptableControllerDrone, tick, dt);
+
+
+        this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() * getMass() * this->auxiliaryThrust_);
+        this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() * getMass() * this->auxiliaryThrust_);
+
+
+        if (this->localLinearAcceleration_.z() > 0)
+            this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->auxiliaryThrust_);
+        else
+            this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->primaryThrust_);
+
+        this->physicalBody_->applyCentralForce(physicalBody_->getWorldTransform().getBasis() * this->localLinearAcceleration_);
+        this->localLinearAcceleration_.setValue(0, 0, 0);
+
+        this->localAngularAcceleration_ *= this->getLocalInertia() * this->rotationThrust_;
+        this->physicalBody_->applyTorque(physicalBody_->getWorldTransform().getBasis() * this->localAngularAcceleration_);
+        this->localAngularAcceleration_.setValue(0, 0, 0);
+    }
+
+    /**
+    @brief
+        Moves the ScriptableControllerDrone in the negative z-direction (Front/Back) by an amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the movement.
+    */
+    void ScriptableControllerDrone::moveFrontBack(const Vector2& value)
+    {
+        this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() - value.x);
+    }
+
+    /**
+    @brief
+        Moves the ScriptableControllerDrone in the x-direction (Right/Left) by an amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the movement.
+    */
+    void ScriptableControllerDrone::moveRightLeft(const Vector2& value)
+    {
+        this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() + value.x);
+    }
+
+    /**
+    @brief
+        Moves the ScriptableControllerDrone in the y-direction (Up/Down) by an amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the movement.
+    */
+    void ScriptableControllerDrone::moveUpDown(const Vector2& value)
+    {
+        this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() + value.x);
+    }
+
+    /**
+    @brief
+        Rotates the ScriptableControllerDrone around the y-axis by the amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the angular movement.
+    */
+    void ScriptableControllerDrone::rotateYaw(const Vector2& value)
+    {
+        this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() - value.x);
+    }
+
+    /**
+    @brief
+        Rotates the ScriptableControllerDrone around the x-axis by the amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the angular movement.
+    */
+    void ScriptableControllerDrone::rotatePitch(const Vector2& value)
+    {
+        this->localAngularAcceleration_.setX(this->localAngularAcceleration_.x() + value.x);
+    }
+
+    /**
+    @brief
+        Rotates the ScriptableControllerDrone around the z-axis by the amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the angular movement.
+    */
+    void ScriptableControllerDrone::rotateRoll(const Vector2& value)
+    {
+        this->localAngularAcceleration_.setZ(this->localAngularAcceleration_.z() + value.x);
+    }
+
+
+}
Index: code/branches/PresentationFS18/src/orxonox/worldentities/pawns/ScriptableControllerDrone.h
===================================================================
--- code/branches/PresentationFS18/src/orxonox/worldentities/pawns/ScriptableControllerDrone.h	(revision 12016)
+++ code/branches/PresentationFS18/src/orxonox/worldentities/pawns/ScriptableControllerDrone.h	(revision 12016)
@@ -0,0 +1,212 @@
+/*
+ *   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:
+ *      Oli Scheuss
+ *   Co-authors:
+ *      Damian 'Mozork' Frick
+ *
+ */
+
+#ifndef _ScriptableControllerDrone_H__
+#define _ScriptableControllerDrone_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "core/XMLPort.h"
+//#include "controllers/AutonomousDroneController.h"
+
+#include "Pawn.h"
+
+namespace orxonox {
+
+    /**
+    @brief
+        Drone, that is made to move upon a specified pattern.
+        This class was constructed for the PPS tutorial.
+    @author
+        Oli Scheuss
+    */
+    class _OrxonoxExport ScriptableControllerDrone : public Pawn
+    {
+        public:
+            ScriptableControllerDrone(Context* context);
+            virtual ~ScriptableControllerDrone();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating an AutonomousDrone through XML.
+            virtual void tick(float dt); //!< Defines which actions the AutonomousDrone has to take in each tick.
+
+            virtual void moveFrontBack(const Vector2& value);
+            virtual void moveRightLeft(const Vector2& value);
+            virtual void moveUpDown(const Vector2& value);
+
+            virtual void rotateYaw(const Vector2& value);
+            virtual void rotatePitch(const Vector2& value);
+            virtual void rotateRoll(const Vector2& value);
+
+            /**
+            @brief Moves the Drone in the Front/Back-direction by the specifed amount.
+            @param value  The amount by which the drone is to be moved.
+            */
+
+
+            inline void moveFrontBack(float value)
+            { this->moveFrontBack(Vector2(value, 0)); }
+            /**
+            @brief Moves the Drone in the Right/Left-direction by the specifed amount.
+            @param value  The amount by which the drone is to be moved.
+            */
+            inline void moveRightLeft(float value)
+            { this->moveRightLeft(Vector2(value, 0)); }
+            /**
+            @brief Moves the Drone in the Up/Down-direction by the specifed amount.
+            @param value  The amount by which the drone is to be moved.
+            */
+            inline void moveUpDown(float value)
+            { this->moveUpDown(Vector2(value, 0)); }
+
+            /**
+            @brief Rotates the Drone around the y-axis by the specifed amount.
+            @param value  The amount by which the drone is to be rotated.
+            */
+            inline void rotateYaw(float value)
+            { this->rotateYaw(Vector2(value, 0)); }
+            /**
+            @brief Rotates the Drone around the x-axis by the specifed amount.
+            @param value  The amount by which the drone is to be rotated.
+            */
+            inline void rotatePitch(float value)
+            { this->rotatePitch(Vector2(value, 0)); }
+            /**
+            @brief Rotates the Drone around the z-axis by the specifed amount.
+            @param value  The amount by which the drone is to be rotated.
+            */
+            inline void rotateRoll(float value)
+            { this->rotateRoll(Vector2(value, 0)); }
+
+            /**
+            @brief Sets the primary thrust to the input amount.
+            @param thrust The amount of thrust.
+            */
+            inline void setPrimaryThrust( float thrust )
+                { this->primaryThrust_ = thrust; }
+            //TODO: Place your set-functions here.
+            // Hint: auxiliary thrust, rotation thrust.
+
+
+	     /**
+            @brief Sets the auxiliary thrust to the input amount.
+            @param thrust The amount of thrust.
+            */
+            inline void setAuxiliaryThrust( float thrust )
+                { this->auxiliaryThrust_ = thrust; }
+
+	     /**
+            @brief Sets the rotation thrust to the input amount.
+            @param thrust The amount of thrust.
+            */
+            inline void setRotationThrust( float thrust )
+                { this->rotationThrust_ = thrust; }
+
+	     /**
+            @brief Sets the rotation thrust to the input amount.
+            @param thrust The amount of thrust.
+            */
+            inline void setMass( float mass )
+                { this->mass_ = mass; }
+
+	     /**
+            @brief Sets the rotation thrust to the input amount.
+            @param thrust The amount of thrust.
+            */
+            inline void setLinearDamping( float damping )
+                { this->linearDamping_ = damping; }
+
+	     /**
+            @brief Sets the rotation thrust to the input amount.
+            @param thrust The amount of thrust.
+            */
+            inline void setAngularDamping( float damping )
+                { this->angularDamping_ = damping; }
+            
+	    
+	    
+            /**
+            @brief Gets the primary thrust to the input amount.
+            @return The amount of thrust.
+            */
+            inline float getPrimaryThrust()
+                { return this->primaryThrust_; }
+            //TODO: Place your get-functions here.
+
+	    /**
+            @brief Gets the primary thrust to the input amount.
+            @return The amount of thrust.
+            */
+            inline float getAuxiliaryThrust()
+                { return this->auxiliaryThrust_; }
+
+	     /**
+            @brief Gets the primary thrust to the input amount.
+            @return The amount of thrust.
+            */
+            inline float getRotationThrust()
+                { return this->rotationThrust_; }
+
+	     /**
+            @brief Gets the primary thrust to the input amount.
+            @return The amount of thrust.
+            */
+            inline float getMass()
+                { return this->mass_; }
+
+	     /**
+            @brief Gets the primary thrust to the input amount.
+            @return The amount of thrust.
+            */
+            inline float getLinearDamping()
+                { return this->linearDamping_; }
+
+	     /**
+            @brief Gets the primary thrust to the input amount.
+            @return The amount of thrust.
+            */
+            inline float getAngularDamping()
+                { return this->angularDamping_; }
+
+            
+
+        private:
+            //AutonomousDroneController *myController_; //!< The controller of the AutonomousDrone.
+
+            btVector3 localLinearAcceleration_; //!< The linear acceleration that is used to move the AutonomousDrone the next tick.
+            btVector3 localAngularAcceleration_; //!< The linear angular acceleration that is used to move the AutonomousDrone the next tick.
+            float primaryThrust_; //!< The amount of primary thrust. This is just used, when moving forward.
+            float auxiliaryThrust_; //!< The amount of auxiliary thrust. Used for all other movements (except for rotations).
+            float rotationThrust_; //!< The amount of rotation thrust. Used for rotations only.s
+	    float mass_;
+	    float linearDamping_;
+	    float angularDamping_;
+    };
+
+}
+
+#endif // _AutonomousDrone_H__
Index: code/branches/PresentationFS18/src/orxonox/worldentities/pawns/SpaceShip.cc
===================================================================
--- code/branches/PresentationFS18/src/orxonox/worldentities/pawns/SpaceShip.cc	(revision 12015)
+++ code/branches/PresentationFS18/src/orxonox/worldentities/pawns/SpaceShip.cc	(revision 12016)
@@ -163,5 +163,5 @@
             engine->run(dt);
 
-        if (this->hasLocalController())
+        if (this->hasLocalController() || true)
         {
             // If not in mouse look apply the angular movement to the ship.
Index: code/branches/PresentationFS18/src/orxonox/worldentities/pawns/SpaceShip.h
===================================================================
--- code/branches/PresentationFS18/src/orxonox/worldentities/pawns/SpaceShip.h	(revision 12015)
+++ code/branches/PresentationFS18/src/orxonox/worldentities/pawns/SpaceShip.h	(revision 12016)
@@ -117,4 +117,11 @@
                 { this->steering_.y += (0.6)*value.x; }
 
+            inline void moveFrontBack(float value)
+                { this->moveFrontBack(Vector2(value, 0)); }
+            inline void moveRightLeft(float value)
+                { this->moveRightLeft(Vector2(value, 0)); }
+            inline void moveUpDown(float value)
+                { this->moveUpDown(Vector2(value, 0)); }    
+
             virtual void rotateYaw(const Vector2& value); // Rotate in yaw direction.
             virtual void rotatePitch(const Vector2& value); // Rotate in pitch direction.
