Index: code/trunk/src/modules/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/CMakeLists.txt	(revision 6906)
+++ code/trunk/src/modules/CMakeLists.txt	(revision 7163)
@@ -33,2 +33,3 @@
 ADD_SUBDIRECTORY(questsystem)
 ADD_SUBDIRECTORY(weapons)
+ADD_SUBDIRECTORY(designtools)
Index: code/trunk/src/modules/designtools/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/designtools/CMakeLists.txt	(revision 7163)
+++ code/trunk/src/modules/designtools/CMakeLists.txt	(revision 7163)
@@ -0,0 +1,13 @@
+SET_SOURCE_FILES(DESIGNTOOLS_SRC_FILES
+  SkyboxGenerator.cc
+  CreateStars.cc
+  ScreenshotManager.cc
+)
+
+ORXONOX_ADD_LIBRARY(designtools
+  MODULE
+  FIND_HEADER_FILES
+  LINK_LIBRARIES
+    orxonox
+  SOURCE_FILES ${DESIGNTOOLS_SRC_FILES}
+)
Index: code/trunk/src/modules/designtools/CreateStars.cc
===================================================================
--- code/trunk/src/modules/designtools/CreateStars.cc	(revision 7163)
+++ code/trunk/src/modules/designtools/CreateStars.cc	(revision 7163)
@@ -0,0 +1,125 @@
+/*
+ *   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:
+ *      Gion-Andri Cantieni
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "CreateStars.h"
+
+#include <OgreVector3.h>
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "graphics/Billboard.h"
+
+namespace orxonox
+{
+    CreateFactory(CreateStars);
+
+    static const float pi = 3.14159265359f;
+
+    CreateStars::CreateStars(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(CreateStars);
+        this->material_ = "Examples/Flare";
+        this->alpha_ = 0.7f;
+        this->alphaDiff_ = 0.5f;
+        this->radiusDiff_ = 0.9f;
+        this->colour_.r = 1;
+        this->colour_.g = 1;
+        this->colour_.b = 1;
+        this->colourDiff_ = 0.1f;
+    }
+
+    CreateStars::~CreateStars()
+    {
+        while( billboards_.size()!=0 )
+        {
+            billboards_.back()->destroy();
+            billboards_.pop_back();
+
+        }
+
+        billboards_.clear();
+    }
+
+    void CreateStars::createBillboards()
+    {
+
+        for(int i=0; i < numStars_; i++)
+        {
+            Billboard* bb = new Billboard(this);
+
+            float r = rnd(-colourDiff_,colourDiff_);
+            float g = rnd(-colourDiff_,colourDiff_);
+            float b = rnd(-colourDiff_,colourDiff_);
+            orxonox::ColourValue thisColour = colour_;
+            float alpha = alpha_+rnd(-alphaDiff_,alphaDiff_);
+            thisColour.r=clamp((thisColour.r+r)*alpha, 0.0f, 1.0f);
+            thisColour.g=clamp((thisColour.g+g)*alpha, 0.0f, 1.0f);
+            thisColour.b=clamp((thisColour.b+b)*alpha, 0.0f, 1.0f);
+
+            bb->setMaterial(material_);
+            bb->setColour(thisColour);
+
+            float phi;
+            float teta;
+
+            while(1)
+            {
+                phi = rnd(2*pi);
+                teta = rnd(pi);
+                float random = rnd(1);
+                if(sin(teta)>random) break;
+            }
+            float radius = rnd(radiusDiff_,1)*radius_;
+            bb->setPosition( PolarToCartesian(phi, teta, radius) );
+            billboards_.push_back(bb);
+        }
+    }
+
+    Vector3 CreateStars::PolarToCartesian(float phi, float teta, float radius)
+    {
+        float x = radius * cos(phi) * sin(teta);
+        float y = radius * sin(phi) * sin(teta);
+        float z = radius * cos(teta);
+        return Vector3(x,y,z);
+    }
+
+    void CreateStars::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(CreateStars, XMLPort, xmlelement, mode);
+
+        XMLPortParam(CreateStars, "numStars", setNumStars, getNumStars, xmlelement, mode);
+        XMLPortParam(CreateStars, "material", setMaterial, getMaterial, xmlelement, mode);
+        XMLPortParam(CreateStars, "colour", setColour, getColour, xmlelement, mode);
+        XMLPortParam(CreateStars, "alpha", setAlpha, getAlpha, xmlelement, mode);
+        XMLPortParam(CreateStars, "colourDiff", setColourDiff, getColourDiff, xmlelement, mode);
+        XMLPortParam(CreateStars, "alphaDiff", setAlphaDiff, getAlphaDiff, xmlelement, mode);
+        XMLPortParam(CreateStars, "radiusDiff", setRadiusDiff, getRadiusDiff, xmlelement, mode);
+        XMLPortParam(CreateStars, "radius", setRadius, getRadius, xmlelement, mode);
+    }
+
+}
Index: code/trunk/src/modules/designtools/CreateStars.h
===================================================================
--- code/trunk/src/modules/designtools/CreateStars.h	(revision 7163)
+++ code/trunk/src/modules/designtools/CreateStars.h	(revision 7163)
@@ -0,0 +1,126 @@
+/*
+ *   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:
+ *      Gion-Andri Cantieni
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "DesignToolsPrereqs.h"
+
+#include <string>
+#include "util/Math.h"
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    class CreateStars : public BaseObject
+    {
+        public:
+            CreateStars(orxonox::BaseObject* creator);
+            virtual ~CreateStars();
+
+            void createBillboards();
+
+            void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            void setNumStars(int num) {
+                this->numStars_ = num;
+            }
+
+            int getNumStars() const {
+                return this->numStars_;
+            }
+
+            void setMaterial(const std::string& material) {
+                this->material_ = material;
+            }
+
+            const std::string& getMaterial() const {
+                return this->material_;
+            }
+
+            void setColour(const orxonox::ColourValue& colour) {
+                this->colour_ = colour;
+            }
+
+            const ColourValue& getColour() const {
+                return this->colour_;
+            }
+
+            void setAlpha(float alpha) {
+                this->alpha_ = alpha;
+            }
+
+            float getAlpha() const {
+                return this->alpha_;
+            }
+
+            void setColourDiff(float colourDiff) {
+                this->colourDiff_ = colourDiff;
+            }
+
+            float getColourDiff() const {
+                return this->colourDiff_;
+            }
+
+            void setAlphaDiff(float alphaDiff) {
+                this->alphaDiff_ = alphaDiff;
+            }
+
+            float getAlphaDiff() const {
+                return this->alphaDiff_;
+            }
+
+            void setRadiusDiff(float radiusDiff) {
+                this->radiusDiff_ = radiusDiff;
+            }
+
+            float getRadiusDiff() const {
+                return this->radiusDiff_;
+            }
+
+            void setRadius(unsigned int dist) {
+                this->radius_ = dist;
+                this->createBillboards();
+            }
+
+            unsigned int getRadius()const {
+                return this->radius_;
+            }
+
+            Vector3 PolarToCartesian(float alpha, float beta, float radius);
+
+        private:
+            int numStars_;
+            std::string material_;
+            ColourValue colour_;
+            std::vector<Billboard*> billboards_;
+            unsigned int radius_;
+            float alpha_;
+            float colourDiff_;
+            float alphaDiff_;
+            float radiusDiff_;
+
+    };
+}
Index: code/trunk/src/modules/designtools/DesignToolsPrereqs.h
===================================================================
--- code/trunk/src/modules/designtools/DesignToolsPrereqs.h	(revision 7163)
+++ code/trunk/src/modules/designtools/DesignToolsPrereqs.h	(revision 7163)
@@ -0,0 +1,69 @@
+/*
+ *   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:
+ *      Oliver Scheuss
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief
+    Shared library macros, enums, constants and forward declarations for the pong module
+*/
+
+#ifndef _DesignToolsPrereqs_H__
+#define _DesignToolsPrereqs_H__
+
+#include "OrxonoxConfig.h"
+#include "OrxonoxPrereqs.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(DESIGNTOOLS_STATIC_BUILD)
+#  ifdef DESIGNTOOLS_SHARED_BUILD
+#    define _DesignToolsExport __declspec(dllexport)
+#  else
+#    if defined( __MINGW32__ )
+#      define _DesignToolsExport
+#    else
+#      define _DesignToolsExport __declspec(dllimport)
+#    endif
+#  endif
+#elif defined ( ORXONOX_GCC_VISIBILITY )
+#  define _DesignToolsExport  __attribute__ ((visibility("default")))
+#else
+#  define _DesignToolsExport
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+}
+
+#endif /* _DesignToolsPrereqs_H__ */
Index: code/trunk/src/modules/designtools/ScreenshotManager.cc
===================================================================
--- code/trunk/src/modules/designtools/ScreenshotManager.cc	(revision 7163)
+++ code/trunk/src/modules/designtools/ScreenshotManager.cc	(revision 7163)
@@ -0,0 +1,174 @@
+/* COPYRIGHT: this code comes from http://www.ogre3d.org/wiki/index.php/High_resolution_screenshots */
+
+#include "ScreenshotManager.h"
+
+#include <OgreRenderWindow.h>
+#include <OgreViewport.h>
+#include <OgreRenderTexture.h>
+#include <OgreCamera.h>
+#include <OgreRoot.h>
+
+#include "core/GraphicsManager.h"
+#include "core/PathConfig.h"
+#include "core/ScopedSingletonManager.h"
+#include "core/ConsoleCommand.h"
+
+#include "CameraManager.h"
+#include "graphics/Camera.h"
+
+namespace orxonox
+{
+    ManageScopedSingleton(ScreenshotManager, ScopeID::Graphics, false);
+    SetConsoleCommandAlias(ScreenshotManager, makeScreenshot_s, "printScreenHD", true);
+
+    ScreenshotManager::ScreenshotManager()
+    {
+        Ogre::RenderWindow* pRenderWindow = GraphicsManager::getInstance().getRenderWindow();
+        int gridSize = 3;
+        std::string fileExtension = ".png";
+        bool overlayFlag = true;
+
+        //set file extension for the Screenshot files
+        mFileExtension   = fileExtension;
+        // the gridsize
+        mGridSize        = gridSize;
+        // flag for overlay rendering
+        mDisableOverlays = overlayFlag;
+        //get current window size
+        mWindowWidth   = pRenderWindow->getWidth();
+        mWindowHeight  = pRenderWindow->getHeight();
+        //create temporary texture
+        mTempTex = Ogre::TextureManager::getSingleton().createManual("ScreenShotTex",
+                                                                  Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D,
+                                                                    mWindowWidth, mWindowHeight,0, Ogre::PF_B8G8R8, Ogre::TU_RENDERTARGET);
+
+        //get The current Render Target of the temp Texture
+        mRT = mTempTex->getBuffer()->getRenderTarget();
+
+        //HardwarePixelBufferSharedPtr to the Buffer of the temp Texture
+        mBuffer = mTempTex->getBuffer();
+
+        //create PixelBox
+            uint8_t* data_ = new uint8_t[(mWindowWidth * mGridSize) * (mWindowHeight * mGridSize) * 3];
+        mFinalPicturePB = Ogre::PixelBox(mWindowWidth * mGridSize,mWindowHeight * mGridSize,1,Ogre::PF_B8G8R8,data_);
+
+    }
+
+
+    ScreenshotManager::~ScreenshotManager()
+    {
+        // Don't delete data_. Somehow this pointer points anywhere but to memory location.
+        //delete[] data_;
+    }
+
+
+    /* Creates a screenshot with the given camera.
+    * @param camera Pointer to the camera "looking at" the scene of interest
+    * @param fileName the filename of the screenshot file.
+    */
+    void ScreenshotManager::makeScreenshot() const
+    {
+        Ogre::Camera* camera = CameraManager::getInstance().getActiveCamera()->getOgreCamera();
+        std::string fileName = PathConfig::getInstance().getLogPathString() + "screenshot_" + this->getTimestamp();
+
+        //Remove all viewports, so the added Viewport(camera) ist the only
+        mRT->removeAllViewports();
+        mRT->addViewport(camera);
+
+        //set the viewport settings
+        Ogre::Viewport *vp = mRT->getViewport(0);
+        vp->setClearEveryFrame(true);
+        vp->setOverlaysEnabled(false);
+
+        // remind current overlay flag
+        bool enableOverlayFlag = GraphicsManager::getInstance().getViewport()->getOverlaysEnabled();
+
+        // we disable overlay rendering if it is set in config file and the viewport setting is enabled
+        if(mDisableOverlays && enableOverlayFlag)
+            GraphicsManager::getInstance().getViewport()->setOverlaysEnabled(false);
+
+        if(mGridSize <= 1)
+        {
+            // Simple case where the contents of the screen are taken directly
+            // Also used when an invalid value is passed within gridSize (zero or negative grid size)
+            mRT->update();    //render
+
+            //write the file on the Harddisk
+            mRT->writeContentsToFile(fileName + "." + mFileExtension);
+        }
+        else
+        {
+            //define the original frustum extents variables
+            Ogre::Real originalFrustumLeft, originalFrustumRight, originalFrustumTop, originalFrustumBottom;
+            // set the original Frustum extents
+            camera->getFrustumExtents(originalFrustumLeft, originalFrustumRight, originalFrustumTop, originalFrustumBottom);
+
+            // compute the Stepsize for the drid
+            Ogre::Real frustumGridStepHorizontal  = (originalFrustumRight * 2) / mGridSize;
+            Ogre::Real frustumGridStepVertical  = (originalFrustumTop * 2) / mGridSize;
+
+            // process each grid
+            Ogre::Real frustumLeft, frustumRight, frustumTop, frustumBottom;
+            for (unsigned int nbScreenshots = 0; nbScreenshots < mGridSize * mGridSize; nbScreenshots++)
+            {
+                int y = nbScreenshots / mGridSize;
+                int x = nbScreenshots - y * mGridSize;
+
+                // Shoggoth frustum extents setting
+                // compute the new frustum extents
+                frustumLeft    = originalFrustumLeft + frustumGridStepHorizontal * x;
+                frustumRight  = frustumLeft + frustumGridStepHorizontal;
+                frustumTop    = originalFrustumTop - frustumGridStepVertical * y;
+                frustumBottom  = frustumTop - frustumGridStepVertical;
+
+                // set the frustum extents value to the camera
+                camera->setFrustumExtents(frustumLeft, frustumRight, frustumTop, frustumBottom);
+
+                // ignore time duration between frames
+                Ogre::Root::getSingletonPtr()->clearEventTimes();
+                mRT->update();    //render
+
+                //define the current
+                Ogre::Box subBox = Ogre::Box(x* mWindowWidth,y * mWindowHeight,x * mWindowWidth + mWindowWidth, y * mWindowHeight + mWindowHeight);
+                //copy the content from the temp buffer into the final picture PixelBox
+                //Place the tempBuffer content at the right position
+                mBuffer->blitToMemory(mFinalPicturePB.getSubVolume(subBox));
+
+            }
+
+            // set frustum extents to previous settings
+            camera->resetFrustumExtents();
+
+            Ogre::Image finalImage; //declare the final Image Object
+            //insert the PixelBox data into the Image Object
+            finalImage = finalImage.loadDynamicImage(static_cast<unsigned char*>(mFinalPicturePB.data), mFinalPicturePB.getWidth(),mFinalPicturePB.getHeight(),Ogre::PF_B8G8R8);
+            // Save the Final image to a file
+            finalImage.save(fileName + "." + mFileExtension);
+
+        }
+
+        // do we have to re-enable our overlays?
+        if(enableOverlayFlag)
+            GraphicsManager::getInstance().getViewport()->setOverlaysEnabled(true);
+
+
+        // reset time since last frame to pause the scene
+        Ogre::Root::getSingletonPtr()->clearEventTimes();
+    }
+
+    std::string ScreenshotManager::getTimestamp()
+    {
+        struct tm *pTime;
+        time_t ctTime; time(&ctTime);
+        pTime = localtime( &ctTime );
+        std::ostringstream oss;
+        oss << std::setw(2) << std::setfill('0') << (pTime->tm_mon + 1)
+            << std::setw(2) << std::setfill('0') << pTime->tm_mday
+            << std::setw(2) << std::setfill('0') << (pTime->tm_year + 1900)
+            << "_" << std::setw(2) << std::setfill('0') << pTime->tm_hour
+            << std::setw(2) << std::setfill('0') << pTime->tm_min
+            << std::setw(2) << std::setfill('0') << pTime->tm_sec;
+        return oss.str();
+    }
+
+}
Index: code/trunk/src/modules/designtools/ScreenshotManager.h
===================================================================
--- code/trunk/src/modules/designtools/ScreenshotManager.h	(revision 7163)
+++ code/trunk/src/modules/designtools/ScreenshotManager.h	(revision 7163)
@@ -0,0 +1,70 @@
+/* COPYRIGHT: this code comes from http://www.ogre3d.org/wiki/index.php/High_resolution_screenshots */
+
+#ifndef __ScreenshotManager_h__
+#define __ScreenshotManager_h__
+
+#include "DesignToolsPrereqs.h"
+
+#include <string>
+#include <cstring>
+#include <cstdlib>
+
+#include <OgrePrerequisites.h>
+#include <OgreTexture.h>
+#include <OgreHardwarePixelBuffer.h>
+
+#include "util/Singleton.h"
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+
+
+    /* Class encapsulates Screenshot functionality and provides a method for making multi grid screenshots.
+    *  pRenderWindow:    Pointer to the render window.  This could be "mWindow" from the ExampleApplication,
+    *              the window automatically created obtained when calling
+    *              Ogre::Root::getSingletonPtr()->initialise(false) and retrieved by calling
+    *              "Ogre::Root::getSingletonPtr()->getAutoCreatedWindow()", or the manually created
+    *              window from calling "mRoot->createRenderWindow()".
+    *  gridSize:      The magnification factor.  A 2 will create a 2x2 grid, doubling the size of the
+                screenshot.  A 3 will create a 3x3 grid, tripling the size of the screenshot.
+    *  fileExtension:    The extension of the screenshot file name, hence the type of graphics file to generate.
+    *              To generate "MyScreenshot.png" this parameter would contain ".png".
+    */
+    class ScreenshotManager : public OrxonoxClass, public Singleton<ScreenshotManager>
+    {
+        friend class Singleton<ScreenshotManager>;
+
+    public:
+        ScreenshotManager();
+        ~ScreenshotManager();
+
+      /* Creates a screenshot with the given camera.
+        * @param camera Pointer to the camera "looking at" the scene of interest
+        * @param fileName the filename of the screenshot file.
+      */
+        void makeScreenshot() const;
+
+        static void makeScreenshot_s()
+            { getInstance().makeScreenshot(); }
+
+    protected:
+        static std::string getTimestamp();
+
+        std::string    mFileExtension;
+        unsigned int   mGridSize, mWindowWidth, mWindowHeight;
+        bool           mDisableOverlays;
+        //temp texture with current screensize
+        Ogre::TexturePtr mTempTex;
+        Ogre::RenderTexture* mRT;
+        Ogre::HardwarePixelBufferSharedPtr mBuffer;
+        //PixelBox for a large Screenshot, if grid size is > 1
+        Ogre::PixelBox  mFinalPicturePB;
+        uint8_t* data_;
+
+        static ScreenshotManager* singletonPtr_s;
+    };
+
+}
+
+#endif  // __ScreenshotManager_h__
Index: code/trunk/src/modules/designtools/SkyboxGenerator.cc
===================================================================
--- code/trunk/src/modules/designtools/SkyboxGenerator.cc	(revision 7163)
+++ code/trunk/src/modules/designtools/SkyboxGenerator.cc	(revision 7163)
@@ -0,0 +1,159 @@
+/*
+ *   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:
+ *      Gion-Andri Cantieni
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "SkyboxGenerator.h"
+
+#include <string>
+#include <cassert>
+#include <OgreRenderWindow.h>
+#include <OgreCamera.h>
+
+#include "core/ConsoleCommand.h"
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/ScopedSingletonManager.h"
+#include "controllers/HumanController.h"
+#include "worldentities/CameraPosition.h"
+#include "worldentities/ControllableEntity.h"
+#include "core/GraphicsManager.h"
+#include "core/CommandExecutor.h"
+#include "graphics/Camera.h"
+
+
+
+namespace orxonox
+{
+
+    SetConsoleCommand(SkyboxGenerator, createSkybox, true);
+
+    ManageScopedSingleton(SkyboxGenerator, ScopeID::Graphics, false);
+
+    SkyboxGenerator::SkyboxGenerator() : iterateOverDirections_(0)
+    {
+        RegisterRootObject(SkyboxGenerator);
+
+        this->setConfigValues();
+        takeScreenshot_ = false;
+        this->captionsRemoved_ = false;
+    }
+
+    SkyboxGenerator::~SkyboxGenerator()
+    {
+
+    }
+
+    void SkyboxGenerator::setConfigValues( )
+    {
+        SetConfigValue(skyboxPrefix_, "SkyboxFile_");
+    }
+
+    void SkyboxGenerator::tick(float dt)
+    {
+        if( takeScreenshot_ == true )
+        {
+            if(!this->captionsRemoved_)
+            {
+                CommandExecutor::execute("setGametypeStatus false");
+                this->captionsRemoved_ = true;
+                return;
+            }
+
+            ControllableEntity* ce = HumanController::getLocalControllerSingleton()->getControllableEntity();
+            Camera* camera = ce->getCamera();
+            assert(ce);
+
+            Ogre::RenderWindow* w = GraphicsManager::getInstance().getRenderWindow();
+
+
+            switch (iterateOverDirections_)
+            {
+            case 0 :
+                fovy_ = camera->getOgreCamera()->getFOVy();
+                camera->getOgreCamera()->setFOVy(Degree(90));
+                aspectRatio_ = camera->getOgreCamera()->getAspectRatio();
+                camera->getOgreCamera()->setAspectRatio(1);
+                iterateOverDirections_++;
+                break;
+            case 1 :
+                w->writeContentsToFile(skyboxPrefix_+"fr.png");
+                ce->yaw(Degree(90));
+                iterateOverDirections_++;
+                break;
+
+            case 2 :
+                w->writeContentsToFile(skyboxPrefix_+"lf.png");
+                ce->yaw(Degree(90));
+                iterateOverDirections_++;
+                break;
+
+            case 3 :
+                w->writeContentsToFile(skyboxPrefix_+"bk.png");
+                ce->yaw(Degree(90));
+                iterateOverDirections_++;
+                break;
+
+            case 4 :
+                w->writeContentsToFile(skyboxPrefix_+"rt.png");
+                ce->yaw(Degree(90));
+                ce->pitch(Degree(90));
+                iterateOverDirections_++;
+                break;
+
+            case 5 :
+                w->writeContentsToFile(skyboxPrefix_+"up.png");
+                ce->pitch(Degree(180));
+                iterateOverDirections_++;
+                break;
+
+            case 6 :
+                w->writeContentsToFile(skyboxPrefix_+"dn.png");
+                ce->pitch(Degree(90));
+                iterateOverDirections_++;
+                break;
+
+            case 7 :
+                camera->getOgreCamera()->setAspectRatio(aspectRatio_);
+                camera->getOgreCamera()->setFOVy(fovy_);
+                iterateOverDirections_++;
+            case 8 :
+                iterateOverDirections_ =0;
+                takeScreenshot_ = false;
+                CommandExecutor::execute("pause");
+                CommandExecutor::execute("setGametypeStatus true");
+                this->captionsRemoved_ = false;
+            }
+
+        }
+    }
+
+    void SkyboxGenerator::createSkybox( )
+    {
+        SkyboxGenerator::getInstance().takeScreenshot_ = true;
+        CommandExecutor::execute("pause");
+    }
+}
Index: code/trunk/src/modules/designtools/SkyboxGenerator.h
===================================================================
--- code/trunk/src/modules/designtools/SkyboxGenerator.h	(revision 7163)
+++ code/trunk/src/modules/designtools/SkyboxGenerator.h	(revision 7163)
@@ -0,0 +1,58 @@
+/*
+ *   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:
+ *      Gion-Andri Cantieni
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#include "core/OrxonoxClass.h"
+#include "util/Singleton.h"
+#include "tools/interfaces/Tickable.h"
+#include <OgreMath.h>
+
+
+namespace orxonox
+{
+    class SkyboxGenerator : public virtual OrxonoxClass, public Singleton<SkyboxGenerator>, public Tickable
+    {
+        friend class Singleton<SkyboxGenerator>;
+
+        public:
+            SkyboxGenerator();
+            virtual ~SkyboxGenerator();
+            static void createSkybox( );
+            void setConfigValues( );
+            void tick(float dt);
+
+        private:
+            static SkyboxGenerator* singletonPtr_s;
+            std::string skyboxPrefix_;
+            bool takeScreenshot_;
+            int iterateOverDirections_;
+            float aspectRatio_;
+            Ogre::Radian fovy_;
+            bool captionsRemoved_;
+    };
+}
Index: code/trunk/src/modules/objects/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/objects/CMakeLists.txt	(revision 6906)
+++ code/trunk/src/modules/objects/CMakeLists.txt	(revision 7163)
@@ -15,6 +15,4 @@
   PCH_FILE
     ObjectsPrecompiledHeaders.h
-  DEFINE_SYMBOL
-    "OBJECTS_SHARED_BUILD"
   LINK_LIBRARIES
     orxonox
Index: code/trunk/src/modules/objects/ObjectsPrereqs.h
===================================================================
--- code/trunk/src/modules/objects/ObjectsPrereqs.h	(revision 6906)
+++ code/trunk/src/modules/objects/ObjectsPrereqs.h	(revision 7163)
@@ -43,5 +43,5 @@
 //-----------------------------------------------------------------------
 
-#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD)
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(OBJECTS_STATIC_BUILD)
 #  ifdef OBJECTS_SHARED_BUILD
 #    define _ObjectsExport __declspec(dllexport)
Index: code/trunk/src/modules/objects/Planet.cc
===================================================================
--- code/trunk/src/modules/objects/Planet.cc	(revision 6906)
+++ code/trunk/src/modules/objects/Planet.cc	(revision 7163)
@@ -70,5 +70,5 @@
         {
             Camera* activeCamera = CameraManager::getInstance().getActiveCamera();
-            if (activeCamera)
+            if (activeCamera && this->billboard_.getBillboardSet())
             {
                 float distance = this->getPosition().distance( activeCamera->getWorldPosition() );
@@ -89,49 +89,52 @@
     void Planet::init()
     {
-        float scaleFactor = this->getScale();
-
-#if OGRE_VERSION >= 0x010700
-        Ogre::Mesh::LodValueList distList;
-#else
-        Ogre::Mesh::LodDistanceList distList;
-#endif
-
-        distList.push_back(10.0f*scaleFactor);
-        distList.push_back(19.0f*scaleFactor);
-        distList.push_back(27.0f*scaleFactor);
-        distList.push_back(34.0f*scaleFactor);
-        distList.push_back(40.0f*scaleFactor);
-        distList.push_back(45.0f*scaleFactor);
-        distList.push_back(49.0f*scaleFactor);
-        distList.push_back(52.0f*scaleFactor);
-        distList.push_back(54.0f*scaleFactor);
-        distList.push_back(55.0f*scaleFactor);
-
-        float reductionValue = 0.2f;
-
-        this->mesh_.getEntity()->getMesh()->generateLodLevels(distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL, reductionValue);
-        billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->atmosphere_, Vector3(0,0,0));
-
-        this->attachOgreObject(this->billboard_.getBillboardSet());
-        this->billboard_.getBillboardSet()->setUseAccurateFacing(true);
-        this->setCastShadows(true);
-        this->billboard_.getBillboardSet()->setRenderQueueGroup(this->mesh_.getEntity()->getRenderQueueGroup());
-        this->mesh_.setCastShadows(true);
     }
 
     void Planet::changedMesh()
     {
-        if (this->mesh_.getEntity())
-            this->detachOgreObject(this->mesh_.getEntity());
+        if( GameMode::showsGraphics() )
+        {
+            if (this->mesh_.getEntity())
+                this->detachOgreObject(this->mesh_.getEntity());
 
-        this->mesh_.setMeshSource(this->getScene()->getSceneManager(), this->meshSrc_);
+            this->mesh_.setMeshSource(this->getScene()->getSceneManager(), this->meshSrc_);
 
-        if (this->mesh_.getEntity())
-        {
-            this->attachOgreObject(this->mesh_.getEntity());
-            this->mesh_.getEntity()->setCastShadows(this->bCastShadows_);
-            this->mesh_.setVisible(this->isVisible());
+            if (this->mesh_.getEntity())
+            {
+                this->attachOgreObject(this->mesh_.getEntity());
+                this->mesh_.getEntity()->setCastShadows(this->bCastShadows_);
+                this->mesh_.setVisible(this->isVisible());
+
+                float scaleFactor = this->getScale();
+
+    #if OGRE_VERSION >= 0x010700
+                Ogre::Mesh::LodValueList distList;
+    #else
+                Ogre::Mesh::LodDistanceList distList;
+    #endif
+
+                distList.push_back(10.0f*scaleFactor);
+                distList.push_back(19.0f*scaleFactor);
+                distList.push_back(27.0f*scaleFactor);
+                distList.push_back(34.0f*scaleFactor);
+                distList.push_back(40.0f*scaleFactor);
+                distList.push_back(45.0f*scaleFactor);
+                distList.push_back(49.0f*scaleFactor);
+                distList.push_back(52.0f*scaleFactor);
+                distList.push_back(54.0f*scaleFactor);
+                distList.push_back(55.0f*scaleFactor);
+
+                float reductionValue = 0.2f;
+
+                this->mesh_.getEntity()->getMesh()->generateLodLevels(distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL, reductionValue);
+                billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->atmosphere_, Vector3(0,0,0));
+
+                this->attachOgreObject(this->billboard_.getBillboardSet());
+                this->billboard_.getBillboardSet()->setUseAccurateFacing(true);
+                this->setCastShadows(true);
+                this->billboard_.getBillboardSet()->setRenderQueueGroup(this->mesh_.getEntity()->getRenderQueueGroup());
+                this->mesh_.setCastShadows(true);
+            }
         }
-        this->init();
     }
 
@@ -151,12 +154,9 @@
         SUPER(Planet, XMLPort, xmlelement, mode);
 
-        if (GameMode::showsGraphics())
-        {
-            XMLPortParam(Planet, "atmosphere", setAtmosphere, getAtmosphere, xmlelement, mode).defaultValues("planet/Atmosphere");
-            XMLPortParam(Planet, "atmospheresize", setAtmosphereSize, getAtmosphereSize, xmlelement,mode);
-            XMLPortParam(Planet, "imagesize", setImageSize, getImageSize, xmlelement,mode);
-            XMLPortParam(Planet, "mesh", setMeshSource, getMeshSource, xmlelement, mode);
-            XMLPortParam(Planet, "shadow", setCastShadows, getCastShadows, xmlelement, mode).defaultValues(true);
-        }
+        XMLPortParam(Planet, "atmosphere", setAtmosphere, getAtmosphere, xmlelement, mode).defaultValues("planet/Atmosphere");
+        XMLPortParam(Planet, "atmospheresize", setAtmosphereSize, getAtmosphereSize, xmlelement,mode);
+        XMLPortParam(Planet, "imagesize", setImageSize, getImageSize, xmlelement,mode);
+        XMLPortParam(Planet, "mesh", setMeshSource, getMeshSource, xmlelement, mode);
+        XMLPortParam(Planet, "shadow", setCastShadows, getCastShadows, xmlelement, mode).defaultValues(true);
     }
 
@@ -164,8 +164,9 @@
     {
         registerVariable(this->atmosphere_, VariableDirection::ToClient);
+        registerVariable(this->atmosphereSize, VariableDirection::ToClient);
+        registerVariable(this->imageSize, VariableDirection::ToClient);
+        // Note: the meshSrc should be synchronised after atmosphere and other values, because the meshSrc callback setts the atmosphere billboards
         registerVariable(this->meshSrc_, VariableDirection::ToClient, new NetworkCallback<Planet>(this, &Planet::changedMesh));
         registerVariable(this->bCastShadows_, VariableDirection::ToClient, new NetworkCallback<Planet>(this, &Planet::changedShadows));
-        registerVariable(this->atmosphereSize, VariableDirection::ToClient);
-        registerVariable(this->imageSize, VariableDirection::ToClient);
     }
 
Index: code/trunk/src/modules/objects/Planet.h
===================================================================
--- code/trunk/src/modules/objects/Planet.h	(revision 6906)
+++ code/trunk/src/modules/objects/Planet.h	(revision 7163)
@@ -94,7 +94,7 @@
 
         protected:
-            void registerVariables();
 
         private:
+            void registerVariables();
 
             void changedMesh();
Index: code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.h
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.h	(revision 6906)
+++ code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.h	(revision 7163)
@@ -43,5 +43,4 @@
             virtual ~BoxCollisionShape();
 
-            void registerVariables();
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
@@ -67,4 +66,6 @@
 
         private:
+            void registerVariables();
+
             btCollisionShape* createNewShape() const;
 
Index: code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.h
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.h	(revision 6906)
+++ code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.h	(revision 7163)
@@ -41,5 +41,4 @@
             virtual ~ConeCollisionShape();
 
-            void registerVariables();
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
@@ -55,4 +54,6 @@
 
         private:
+            void registerVariables();
+
             btCollisionShape* createNewShape() const;
 
Index: code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.h
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.h	(revision 6906)
+++ code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.h	(revision 7163)
@@ -43,5 +43,4 @@
             virtual ~PlaneCollisionShape();
 
-            void registerVariables();
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
@@ -57,4 +56,6 @@
 
         private:
+            void registerVariables();
+
             btCollisionShape* createNewShape()const;
 
Index: code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.h
===================================================================
--- code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.h	(revision 6906)
+++ code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.h	(revision 7163)
@@ -41,5 +41,4 @@
             virtual ~SphereCollisionShape();
 
-            void registerVariables();
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
@@ -50,4 +49,6 @@
 
         private:
+            void registerVariables();
+
             btCollisionShape* createNewShape() const;
 
Index: code/trunk/src/modules/objects/eventsystem/EventListener.cc
===================================================================
--- code/trunk/src/modules/objects/eventsystem/EventListener.cc	(revision 6906)
+++ code/trunk/src/modules/objects/eventsystem/EventListener.cc	(revision 7163)
@@ -61,5 +61,5 @@
             return;
         }
-        
+
         COUT(4) << "EventListener, processing event: originator: " << event.originator_->getIdentifier()->getName() << " (&" << event.originator_ << ")" << ", activate: " << event.activate_ << ", name: " << event.name_ << std::endl;
 
Index: code/trunk/src/modules/objects/triggers/CheckPoint.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/CheckPoint.cc	(revision 6906)
+++ code/trunk/src/modules/objects/triggers/CheckPoint.cc	(revision 7163)
@@ -38,5 +38,7 @@
     CreateFactory(CheckPoint);
 
-    CheckPoint::CheckPoint(BaseObject* creator) : DistanceTrigger(creator)
+    CheckPoint::CheckPoint(BaseObject* creator)
+        : DistanceTrigger(creator)
+        , RadarViewable(creator, static_cast<WorldEntity*>(this))
     {
         RegisterObject(CheckPoint);
Index: code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.cc	(revision 6906)
+++ code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.cc	(revision 7163)
@@ -40,15 +40,15 @@
 namespace orxonox
 {
-    
+
     CreateFactory(DistanceMultiTrigger);
 
     /**
     @brief
-        Default Constructor. Registers the object and initializes default values. 
+        Default Constructor. Registers the object and initializes default values.
     */
     DistanceMultiTrigger::DistanceMultiTrigger(BaseObject* creator) : MultiTrigger(creator)
     {
         RegisterObject(DistanceMultiTrigger);
-        
+
         this->distance_ = 100.0f;
         this->targetName_ = BLANKSTRING;
@@ -98,5 +98,5 @@
                 continue;
             }
-            
+
             Vector3 distanceVec = entity->getWorldPosition() - this->getWorldPosition();
             // If the object is no longer in range.
@@ -154,5 +154,5 @@
                 if(this->singleTargetMode_)
                     entity = entity->getParent();
-                
+
                 // If no queue has been created, yet.
                 if(queue == NULL)
@@ -166,7 +166,7 @@
             }
         }
-        
+
         return queue;
     }
-    
+
 }
Index: code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h
===================================================================
--- code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h	(revision 6906)
+++ code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h	(revision 7163)
@@ -56,9 +56,9 @@
     class _ObjectsExport DistanceMultiTrigger : public MultiTrigger
     {
-        
+
         public:
             DistanceMultiTrigger(BaseObject* creator); //!< Default Constructor. Registers the object and initializes default values.
             ~DistanceMultiTrigger(); //!< Destructor.
-            
+
             void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a DistanceMultiTrigger object through XML.
 
@@ -75,5 +75,5 @@
             inline const std::string& getTargetName(void)
                 { return this->targetName_; }
-            
+
             /**
             @brief Set the distance at which the DistanceMultiTrigger triggers.
@@ -88,5 +88,5 @@
             inline float getDistance() const
                 { return this->distance_; }
-                
+
         protected:
             virtual std::queue<MultiTriggerState*>* letTrigger(void); //!< This method is called by the MultiTrigger to get information about new trigger events that need to be looked at.
@@ -106,14 +106,14 @@
             inline bool removeFromRange(WorldEntity* entity)
                 { WeakPtr<WorldEntity>* weakptr = this->range_.find(entity)->second; bool erased = this->range_.erase(entity) > 0; if(erased) delete weakptr; return erased; }
-                
+
         private:
             float distance_; //!< The distance at which the DistanceMultiTrigger triggers.
             std::string targetName_; //!< The target name, used in singleTargetMode.
             bool singleTargetMode_; //!< To indicate whe the MultiDistanceTrigger is in single-target-mode.
-            
+
             std::map<WorldEntity*, WeakPtr<WorldEntity>* > range_; //!< The set of entities that currently are in range of the DistanceMultiTrigger.
-        
+
     };
-    
+
 }
 
Index: code/trunk/src/modules/objects/triggers/DistanceTrigger.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/DistanceTrigger.cc	(revision 6906)
+++ code/trunk/src/modules/objects/triggers/DistanceTrigger.cc	(revision 7163)
@@ -136,5 +136,5 @@
           continue;
       }
-      
+
       Vector3 distanceVec = entity->getWorldPosition() - this->getWorldPosition();
       if (distanceVec.length() < this->distance_)
@@ -155,4 +155,5 @@
       }
     }
+
     return false;
   }
Index: code/trunk/src/modules/objects/triggers/DistanceTriggerBeacon.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/DistanceTriggerBeacon.cc	(revision 6906)
+++ code/trunk/src/modules/objects/triggers/DistanceTriggerBeacon.cc	(revision 7163)
@@ -35,9 +35,9 @@
 
     CreateFactory(DistanceTriggerBeacon);
-    
+
     DistanceTriggerBeacon::DistanceTriggerBeacon(BaseObject* creator) : StaticEntity(creator)
     {
         RegisterObject(DistanceTriggerBeacon);
     }
-    
+
 }
Index: code/trunk/src/modules/objects/triggers/DistanceTriggerBeacon.h
===================================================================
--- code/trunk/src/modules/objects/triggers/DistanceTriggerBeacon.h	(revision 6906)
+++ code/trunk/src/modules/objects/triggers/DistanceTriggerBeacon.h	(revision 7163)
@@ -39,5 +39,5 @@
     class _ObjectsExport DistanceTriggerBeacon : public StaticEntity
     {
-        
+
         public:
 
Index: code/trunk/src/modules/objects/triggers/EventMultiTrigger.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/EventMultiTrigger.cc	(revision 6906)
+++ code/trunk/src/modules/objects/triggers/EventMultiTrigger.cc	(revision 7163)
@@ -52,5 +52,5 @@
     EventMultiTrigger::~EventMultiTrigger()
     {
-        
+
     }
 
@@ -61,5 +61,5 @@
         this->setBroadcast(true);
     }
-    
+
     void EventMultiTrigger::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
     {
Index: code/trunk/src/modules/objects/triggers/EventMultiTrigger.h
===================================================================
--- code/trunk/src/modules/objects/triggers/EventMultiTrigger.h	(revision 6906)
+++ code/trunk/src/modules/objects/triggers/EventMultiTrigger.h	(revision 7163)
@@ -44,5 +44,5 @@
     class _ObjectsExport EventMultiTrigger : public MultiTrigger
     {
-        
+
         public:
             EventMultiTrigger(BaseObject* creator);
Index: code/trunk/src/modules/objects/triggers/MultiTrigger.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/MultiTrigger.cc	(revision 6906)
+++ code/trunk/src/modules/objects/triggers/MultiTrigger.cc	(revision 7163)
@@ -47,5 +47,5 @@
     /*static*/ const std::string MultiTrigger::or_s = "or";
     /*static*/ const std::string MultiTrigger::xor_s = "xor";
-    
+
     CreateFactory(MultiTrigger);
 
@@ -65,5 +65,5 @@
         this->bSwitch_ = false;
         this->bStayActive_ = false;
-        
+
         this->remainingActivations_ = INF_s;
         this->maxNumSimultaniousTriggerers_ = INF_s;
@@ -75,10 +75,10 @@
 
         this->parentTrigger_ = NULL;
-        
+
         this->targetMask_.exclude(Class(BaseObject));
 
         this->setSyncMode(0x0);
     }
-    
+
     /**
     @brief
@@ -95,5 +95,5 @@
         }
     }
-    
+
     /**
     @brief
@@ -117,8 +117,8 @@
         //TODO: Maybe nicer with explicit subgroup, e.g. triggers
         XMLPortObject(MultiTrigger, MultiTrigger, "", addTrigger, getTrigger, xmlelement, mode);
-        
+
         COUT(4) << "MultiTrigger '" << this->getName() << "' (&" << this << ") created." << std::endl;
     }
-    
+
 
     /**
@@ -131,5 +131,5 @@
     {
         // If this is the first tick.
-        //TODO: Determine need for this, else kick it out. 
+        //TODO: Determine need for this, else kick it out.
         if(this->bFirstTick_)
         {
@@ -174,5 +174,5 @@
                     delete state;
                 }
-                
+
                 queue->pop();
             }
@@ -185,5 +185,5 @@
             MultiTriggerState* state;
             float timeRemaining;
-            
+
             // Go through all pending states.
             for(int size = this->stateQueue_.size(); size >= 1; size--)
@@ -212,5 +212,5 @@
                                 this->triggered_.erase(state->originator);
                             }
-                            
+
                             bStateChanged = true;
                         }
@@ -229,5 +229,5 @@
 
                             bool bFire = true;
-                            
+
                             // Add the originator to the objects activating this MultiTrigger.
                             if(bActive == true)
@@ -266,5 +266,5 @@
                                 else
                                     this->fire(bActive, state->originator);
-                                
+
                                 bStateChanged = true;
                             }
@@ -289,5 +289,5 @@
                         }
                     }
-                    
+
                     // Remove the state from the state queue.
                     this->stateQueue_.pop_front();
@@ -509,8 +509,8 @@
             return returnVal;
         }
-        
+
         return true;
     }
-    
+
     /**
     @brief
@@ -547,5 +547,5 @@
             return;
         }
-        
+
         MultiTriggerContainer* container = new MultiTriggerContainer(this, this, originator);
         this->fireEvent(status, container);
@@ -563,5 +563,5 @@
     {
         ClassTreeMask& targetMask = this->getTargetMask();
-        
+
         for(ClassTreeMaskObjectIterator it = targetMask.begin(); it != targetMask.end(); ++it)
         {
@@ -580,9 +580,9 @@
     {
         assert(state);
-        
+
         // If the originator is no target of this MultiTrigger.
         if(!this->isTarget(state->originator))
             return false;
-        
+
         // Add it ot the state queue.
         this->stateQueue_.push_back(std::pair<float, MultiTriggerState*>(this->delay_, state));
Index: code/trunk/src/modules/objects/triggers/MultiTrigger.h
===================================================================
--- code/trunk/src/modules/objects/triggers/MultiTrigger.h	(revision 6906)
+++ code/trunk/src/modules/objects/triggers/MultiTrigger.h	(revision 7163)
@@ -94,8 +94,8 @@
             MultiTrigger(BaseObject* creator); //!< Constructor. Registers the objects and initializes default values.
             ~MultiTrigger(); //!< Destructor.
-            
+
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a MultiTrigger object through XML.
             virtual void tick(float dt); //!< A method that is executed each tick.
-            
+
             bool isActive(BaseObject* triggerer = NULL); //!< Get whether the MultiTrigger is active for a given object.
 
@@ -215,13 +215,13 @@
             void addTargets(const std::string& targets); //!< Add some target to the MultiTrigger.
             void removeTargets(const std::string& targets); //!< Remove some target from the MultiTrigger.
-            
+
             void addTrigger(MultiTrigger* trigger); //!< Adds a MultiTrigger as a sub-trigger to the trigger.
             const MultiTrigger* getTrigger(unsigned int index) const; //!< Get the sub-trigger of this MultiTrigger at the given index.
-            
+
         protected:
             virtual std::queue<MultiTriggerState*>* letTrigger(void); //!< This method is called by the MultiTrigger to get information about new trigger events that need to be looked at.
 
             void changeTriggered(BaseObject* originator = NULL); //!< This method can be called by any class inheriting from MultiTrigger to change it's triggered status for a specified originator.
-            
+
             bool isModeTriggered(BaseObject* triggerer = NULL); //!< Checks whetherx the MultiTrigger is triggered concerning it's sub-triggers.
             bool isTriggered(BaseObject* triggerer = NULL); //!< Get whether the MultiTrigger is triggered for a given object.
@@ -236,5 +236,5 @@
             inline void addParentTrigger(MultiTrigger* parent)
                 { this->parentTrigger_ = parent; }
-            
+
             /**
             @brief Get the target mask used to identify the targets of this MultiTrigger.
@@ -248,5 +248,5 @@
             //TODO: Check if something mus be done here.
             virtual void notifyMaskUpdate(void) {}
-            
+
         private:
             static const int INF_s; //!< Magic number for infinity.
@@ -257,7 +257,7 @@
 
             void subTrigggerActivityChanged(BaseObject* originator); //!< This method is called by any sub-trigger to advertise changes in it's state to it's parent-trigger.
-            
+
             bool addState(MultiTriggerState* state); //!< Helper method. Adds a state to the state queue, where the state will wait to become active.
-            
+
             bool checkAnd(BaseObject* triggerer); //!< Checks whether the sub-triggers amount to true for the 'and' mode for a given object.
             bool checkOr(BaseObject* triggerer); //!< Checks whether the sub-triggers amount to true for the 'or' mode for a given object.
@@ -276,5 +276,5 @@
             bool bSwitch_; //!< Bool for the switch-mode, if true the MultiTrigger behaves like a switch.
             bool bStayActive_; //!< Bool for the stay-active-mode, if true the MultiTrigger stays active after its last activation.;
-            
+
             int remainingActivations_; //!< The remaining activations of this MultiTrigger.
             int maxNumSimultaniousTriggerers_; //!< The maximum number of objects simultaniously trigggering this MultiTrigger.
@@ -287,12 +287,12 @@
             MultiTrigger* parentTrigger_;
             std::set<MultiTrigger*> subTriggers_; //!< The sub-triggers of this MultiTrigger.
-            
+
             std::set<BaseObject*> active_; //!< The set of all objects the MultiTrigger is active for.
             std::set<BaseObject*> triggered_; //!< The set of all objects the MultiTrigger is triggered for.
 
             std::deque< std::pair<float, MultiTriggerState*> > stateQueue_; //!< The queue of states waiting to become active.
-            
+
             ClassTreeMask targetMask_; //!< The target mask, masking all objects that can trigger this MultiTrigger.
-            
+
     };
 
Index: code/trunk/src/modules/objects/triggers/MultiTriggerContainer.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/MultiTriggerContainer.cc	(revision 6906)
+++ code/trunk/src/modules/objects/triggers/MultiTriggerContainer.cc	(revision 7163)
@@ -40,5 +40,5 @@
 
     CreateUnloadableFactory(MultiTriggerContainer);
-    
+
     /**
     @brief
@@ -73,5 +73,5 @@
     MultiTriggerContainer::~MultiTriggerContainer()
     {
-        
+
     }
 
Index: code/trunk/src/modules/objects/triggers/MultiTriggerContainer.h
===================================================================
--- code/trunk/src/modules/objects/triggers/MultiTriggerContainer.h	(revision 6906)
+++ code/trunk/src/modules/objects/triggers/MultiTriggerContainer.h	(revision 7163)
@@ -50,5 +50,5 @@
     class _ObjectsExport MultiTriggerContainer : public BaseObject
     {
-        
+
         public:
             MultiTriggerContainer(BaseObject* creator); //!< Default constructor. Registers the object and creates an empty container.
@@ -68,10 +68,10 @@
             inline BaseObject* getData(void)
                 { return this->data_; }
-            
+
         private:
             MultiTrigger* originator_; //!< The originator.
             BaseObject* data_; //!< The data.
     };
-    
+
 }
 
Index: code/trunk/src/modules/overlays/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/overlays/CMakeLists.txt	(revision 6906)
+++ code/trunk/src/modules/overlays/CMakeLists.txt	(revision 7163)
@@ -14,6 +14,4 @@
   PCH_FILE
     OverlaysPrecompiledHeaders.h
-  DEFINE_SYMBOL
-    "OVERLAYS_SHARED_BUILD"
   LINK_LIBRARIES
     orxonox
Index: code/trunk/src/modules/overlays/GUIOverlay.cc
===================================================================
--- code/trunk/src/modules/overlays/GUIOverlay.cc	(revision 6906)
+++ code/trunk/src/modules/overlays/GUIOverlay.cc	(revision 7163)
@@ -30,6 +30,6 @@
 
 #include <string>
-#include <sstream>
 
+#include "util/Convert.h"
 #include "core/input/InputManager.h"
 #include "core/CoreIncludes.h"
@@ -73,7 +73,5 @@
         if (this->isVisible())
         {
-            std::ostringstream out;
-            out << reinterpret_cast<long>(this);
-            const std::string& str = out.str();
+            const std::string& str = multi_cast<std::string>(reinterpret_cast<long>(this));
             GUIManager::getInstance().showGUIExtra(this->guiName_, str);
 
Index: code/trunk/src/modules/overlays/OverlaysPrereqs.h
===================================================================
--- code/trunk/src/modules/overlays/OverlaysPrereqs.h	(revision 6906)
+++ code/trunk/src/modules/overlays/OverlaysPrereqs.h	(revision 7163)
@@ -43,5 +43,5 @@
 //-----------------------------------------------------------------------
 
-#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD)
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(OVERLAYS_STATIC_BUILD)
 #  ifdef OVERLAYS_SHARED_BUILD
 #    define _OverlaysExport __declspec(dllexport)
@@ -78,4 +78,6 @@
     class ChatOverlay;
     class DeathMessage;
+    class GametypeFadingMessage;
+    class GametypeStaticMessage;
     class GametypeStatus;
     class HUDBar;
Index: code/trunk/src/modules/overlays/hud/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/overlays/hud/CMakeLists.txt	(revision 6906)
+++ code/trunk/src/modules/overlays/hud/CMakeLists.txt	(revision 7163)
@@ -13,3 +13,5 @@
   UnderAttackHealthBar.cc
   TeamBaseMatchScore.cc
+  GametypeStaticMessage.cc
+  GametypeFadingMessage.cc
 )
Index: code/trunk/src/modules/overlays/hud/GametypeFadingMessage.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/GametypeFadingMessage.cc	(revision 7163)
+++ code/trunk/src/modules/overlays/hud/GametypeFadingMessage.cc	(revision 7163)
@@ -0,0 +1,62 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "GametypeFadingMessage.h"
+
+#include "core/CoreIncludes.h"
+#include "infos/PlayerInfo.h"
+
+namespace orxonox
+{
+    CreateFactory(GametypeFadingMessage);
+
+    GametypeFadingMessage::GametypeFadingMessage(BaseObject* creator) : FadeoutText(creator)
+    {
+        RegisterObject(GametypeFadingMessage);
+
+        this->owner_ = 0;
+        this->setDelay(2.0f);
+        this->setFadeouttime(0.5f);
+    }
+
+    GametypeFadingMessage::~GametypeFadingMessage()
+    {
+    }
+
+    void GametypeFadingMessage::fadingmessage(const GametypeInfo* gtinfo, const std::string& message)
+    {
+        if (this->owner_ && this->owner_->getGametypeInfo() == gtinfo)
+            this->setCaption(message);
+    }
+
+    void GametypeFadingMessage::changedOwner()
+    {
+        SUPER(GametypeFadingMessage, changedOwner);
+        this->owner_ = orxonox_cast<PlayerInfo*>(this->getOwner());
+    }
+}
Index: code/trunk/src/modules/overlays/hud/GametypeFadingMessage.h
===================================================================
--- code/trunk/src/modules/overlays/hud/GametypeFadingMessage.h	(revision 7163)
+++ code/trunk/src/modules/overlays/hud/GametypeFadingMessage.h	(revision 7163)
@@ -0,0 +1,53 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _GametypeInfoMessage_H__
+#define _GametypeInfoMessage_H__
+
+#include "overlays/OverlaysPrereqs.h"
+
+#include "interfaces/GametypeMessageListener.h"
+#include "overlays/FadeoutText.h"
+
+namespace orxonox
+{
+    class _OverlaysExport GametypeFadingMessage : public FadeoutText, GametypeMessageListener
+    {
+        public:
+            GametypeFadingMessage(BaseObject* creator);
+            virtual ~GametypeFadingMessage();
+
+            virtual void changedOwner();
+
+            void fadingmessage(const GametypeInfo* gtinfo, const std::string& message);
+
+        private:
+            PlayerInfo* owner_;
+    };
+}
+#endif /* _GametypeFadingMessage_H__ */
Index: code/trunk/src/modules/overlays/hud/GametypeStaticMessage.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/GametypeStaticMessage.cc	(revision 7163)
+++ code/trunk/src/modules/overlays/hud/GametypeStaticMessage.cc	(revision 7163)
@@ -0,0 +1,66 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "GametypeStaticMessage.h"
+
+#include "core/CoreIncludes.h"
+#include "infos/GametypeInfo.h"
+#include "infos/PlayerInfo.h"
+
+
+namespace orxonox
+{
+    CreateFactory(GametypeStaticMessage);
+
+
+    GametypeStaticMessage::GametypeStaticMessage(BaseObject* creator) : OverlayText(creator)
+    {
+        RegisterObject(GametypeStaticMessage);
+        this->owner_ = 0;
+    }
+
+    GametypeStaticMessage::~GametypeStaticMessage()
+    {
+    }
+
+    void GametypeStaticMessage::staticmessage(const GametypeInfo* gtinfo, const std::string& message, const ColourValue& colour)
+    {
+    if (this->owner_ && this->owner_->getGametypeInfo() == gtinfo)
+    {
+        this->setColour(colour);
+        this->setCaption(message);
+    }
+    }
+
+    void GametypeStaticMessage::changedOwner()
+    {
+        SUPER(GametypeStaticMessage, changedOwner);
+        this->owner_ = orxonox_cast<PlayerInfo*>(this->getOwner());
+    }
+
+}
Index: code/trunk/src/modules/overlays/hud/GametypeStaticMessage.h
===================================================================
--- code/trunk/src/modules/overlays/hud/GametypeStaticMessage.h	(revision 7163)
+++ code/trunk/src/modules/overlays/hud/GametypeStaticMessage.h	(revision 7163)
@@ -0,0 +1,56 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _GametypeInfoMessage_H__
+#define _GametypeInfoMessage_H__
+
+#include "overlays/OverlaysPrereqs.h"
+
+#include "interfaces/GametypeMessageListener.h"
+#include "overlays/OverlayText.h"
+/*Goal: Every Gametype could add a hud-element that displays text in the gametype. For example instructions for newbies.
+-> you have to add a "GametypeInfoMessage"-object that displays text. How the message change has to be defined in the gametype.
+*/
+
+namespace orxonox
+{
+    class _OverlaysExport GametypeStaticMessage : public OverlayText, GametypeMessageListener
+    {
+        public:
+            GametypeStaticMessage(BaseObject* creator);
+            virtual ~GametypeStaticMessage();
+
+            virtual void changedOwner();
+
+            void staticmessage(const GametypeInfo* gtinfo, const std::string& message, const ColourValue& colour);
+
+        private:
+            PlayerInfo* owner_;
+    };
+}
+#endif /* _GametypeInfoMessage_H__ */
Index: code/trunk/src/modules/overlays/hud/GametypeStatus.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/GametypeStatus.cc	(revision 6906)
+++ code/trunk/src/modules/overlays/hud/GametypeStatus.cc	(revision 7163)
@@ -30,4 +30,5 @@
 
 #include "util/Convert.h"
+#include "core/ConsoleCommand.h"
 #include "core/CoreIncludes.h"
 #include "infos/GametypeInfo.h"
@@ -39,4 +40,7 @@
 {
     CreateFactory(GametypeStatus);
+
+    /*static*/ bool GametypeStatus::noCaption_s = false;
+    SetConsoleCommand(GametypeStatus, setGametypeStatus, true);
 
     GametypeStatus::GametypeStatus(BaseObject* creator) : OverlayText(creator)
@@ -59,4 +63,10 @@
             const GametypeInfo* gtinfo = this->owner_->getGametypeInfo();
             ControllableEntity* ce = this->owner_->getControllableEntity();
+
+            if(GametypeStatus::noCaption_s) // No captions are displayed.
+            {
+                this->setCaption("");
+                return;
+            }
 
             if (!gtinfo->hasStarted() && !gtinfo->isStartCountdownRunning())
@@ -88,3 +98,15 @@
         this->owner_ = orxonox_cast<PlayerInfo*>(this->getOwner());
     }
+
+    /**
+    @brief
+        Sets whether the gametype status is displayed.
+    @param bValue
+        If true captions are displayed, if false, not.
+    */
+    /*static*/ void GametypeStatus::setGametypeStatus(bool bValue)
+    {
+        GametypeStatus::noCaption_s = !bValue;
+    }
+
 }
Index: code/trunk/src/modules/overlays/hud/GametypeStatus.h
===================================================================
--- code/trunk/src/modules/overlays/hud/GametypeStatus.h	(revision 6906)
+++ code/trunk/src/modules/overlays/hud/GametypeStatus.h	(revision 7163)
@@ -46,6 +46,10 @@
             virtual void changedOwner();
 
+            static void setGametypeStatus(bool bValue); //!< Toggles whether the gametype status is displayed.
+
         private:
             PlayerInfo* owner_;
+            static bool noCaption_s;
+
     };
 }
Index: code/trunk/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDNavigation.cc	(revision 6906)
+++ code/trunk/src/modules/overlays/hud/HUDNavigation.cc	(revision 7163)
@@ -29,6 +29,6 @@
 #include "HUDNavigation.h"
 
-#include <string>
 #include <OgreCamera.h>
+#include <OgreFontManager.h>
 #include <OgreOverlayManager.h>
 #include <OgreTextAreaOverlayElement.h>
@@ -45,242 +45,368 @@
 #include "controllers/HumanController.h"
 #include "worldentities/pawns/Pawn.h"
+#include "worldentities/WorldEntity.h"
+#include "core/ConfigValueIncludes.h"
+#include "tools/TextureGenerator.h"
+// #include <boost/bind/bind_template.hpp>
+
 
 namespace orxonox
 {
-    CreateFactory(HUDNavigation);
-
-    HUDNavigation::HUDNavigation(BaseObject* creator)
-        : OrxonoxOverlay(creator)
-    {
-        RegisterObject(HUDNavigation);
-
-        // create nav text
-        navText_ = static_cast<Ogre::TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton()
-            .createOverlayElement("TextArea", "HUDNavigation_navText_" + getUniqueNumberString()));
-
-        // create nav marker
-        navMarker_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
-            .createOverlayElement("Panel", "HUDNavigation_navMarker_" + getUniqueNumberString()));
-        navMarker_->setMaterialName("Orxonox/NavArrows");
-
-/*
-        // create aim marker
-        aimMarker_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
-            .createOverlayElement("Panel", "HUDNavigation_aimMarker_" + getUniqueNumberString()));
-        aimMarker_->setMaterialName("Orxonox/NavCrosshair");
-        this->wasOutOfView_ = true; // Ensure the material is changed right the first time..
-
-        setFont("Monofur");
-        setTextSize(0.05f);
-        setNavMarkerSize(0.05f);
-        setAimMarkerSize(0.04f);
-*/
-
-        background_->addChild(navMarker_);
-//        background_->addChild(aimMarker_);
-        background_->addChild(navText_);
-
-        // hide at first
-        this->setVisible(false);
-    }
-
-    HUDNavigation::~HUDNavigation()
-    {
-        if (this->isInitialized())
+bool compareDistance ( std::pair<RadarViewable*, unsigned int > a, std::pair<RadarViewable*, unsigned int > b )
+{
+    return a.second<b.second;
+
+}
+
+void HUDNavigation::setConfigValues()
+{
+  SetConfigValue(markerLimit_, 3);
+}
+
+CreateFactory ( HUDNavigation );
+
+HUDNavigation::HUDNavigation ( BaseObject* creator )
+        : OrxonoxOverlay ( creator )
+{
+    RegisterObject ( HUDNavigation );
+    this->setConfigValues();
+
+    // Set default values
+    setFont ( "Monofur" );
+    setTextSize ( 0.05f );
+    setNavMarkerSize ( 0.05f );
+}
+
+HUDNavigation::~HUDNavigation()
+{
+    if ( this->isInitialized() )
+    {
+        for ( ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); )
+            removeObject ( ( it++ )->first );
+
+    }
+
+    sortedObjectList_.clear();
+}
+
+void HUDNavigation::XMLPort ( Element& xmlElement, XMLPort::Mode mode )
+{
+    SUPER ( HUDNavigation, XMLPort, xmlElement, mode );
+
+    XMLPortParam ( HUDNavigation, "font",          setFont,          getFont,          xmlElement, mode );
+    XMLPortParam ( HUDNavigation, "textSize",      setTextSize,      getTextSize,      xmlElement, mode );
+    XMLPortParam ( HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlElement, mode );
+}
+
+void HUDNavigation::setFont ( const std::string& font )
+{
+    const Ogre::ResourcePtr& fontPtr = Ogre::FontManager::getSingleton().getByName ( font );
+    if ( fontPtr.isNull() )
+    {
+        COUT ( 2 ) << "Warning: HUDNavigation: Font '" << font << "' not found" << std::endl;
+        return;
+    }
+    fontName_ = font;
+    for ( ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); ++it )
+    {
+        if ( it->second.text_ != NULL )
+            it->second.text_->setFontName ( fontName_ );
+    }
+}
+
+const std::string& HUDNavigation::getFont() const
+{
+    return fontName_;
+}
+
+void HUDNavigation::setTextSize ( float size )
+{
+    if ( size <= 0.0f )
+    {
+        COUT ( 2 ) << "Warning: HUDNavigation: Negative font size not allowed" << std::endl;
+        return;
+    }
+    textSize_ = size;
+    for ( ObjectMap::iterator it = activeObjectList_.begin(); it!=activeObjectList_.end(); ++it )
+    {
+        if ( it->second.text_ )
+            it->second.text_->setCharHeight ( size );
+    }
+}
+
+float HUDNavigation::getTextSize() const
+{
+    return textSize_;
+}
+
+
+
+void HUDNavigation::tick ( float dt )
+{
+    SUPER ( HUDNavigation, tick, dt );
+
+    Camera* cam = CameraManager::getInstance().getActiveCamera();
+    if ( cam == NULL )
+        return;
+    const Matrix4& camTransform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix();
+
+
+    for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++listIt )
+    {
+        listIt->second = ( int ) ( ( listIt->first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition() ).length() + 0.5f );
+    }
+
+    sortedObjectList_.sort ( compareDistance );
+
+    unsigned int markerCount_ = 0;
+
+//         for (ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); ++it)
+    for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++markerCount_, ++listIt )
+    {
+        ObjectMap::iterator it = activeObjectList_.find ( listIt->first );
+
+        if ( markerCount_ < markerLimit_ )
         {
-            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->navMarker_);
-            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->navText_);
-//            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->aimMarker_);
-        }
-    }
-
-    void HUDNavigation::XMLPort(Element& xmlElement, XMLPort::Mode mode)
-    {
-        SUPER(HUDNavigation, XMLPort, xmlElement, mode);
-
-        XMLPortParam(HUDNavigation, "font",     setFont,     getFont,     xmlElement, mode);
-        XMLPortParam(HUDNavigation, "textSize", setTextSize, getTextSize, xmlElement, mode);
-        XMLPortParam(HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlElement, mode);
-//        XMLPortParam(HUDNavigation, "aimMarkerSize", setAimMarkerSize, getAimMarkerSize, xmlElement, mode);
-    }
-
-    void HUDNavigation::setFont(const std::string& font)
-    {
-        if (this->navText_ && !font.empty())
-            this->navText_->setFontName(font);
-    }
-
-    const std::string& HUDNavigation::getFont() const
-    {
-        if (this->navText_)
-            return this->navText_->getFontName();
-        else
-            return BLANKSTRING;
-    }
-
-    void HUDNavigation::setTextSize(float size)
-    {
-        if (this->navText_ && size >= 0.0f)
-            this->navText_->setCharHeight(size);
-    }
-
-    float HUDNavigation::getTextSize() const
-    {
-        if (this->navText_)
-            return this->navText_->getCharHeight();
-        else
-            return 0.0f;
-    }
-
-    void HUDNavigation::tick(float dt)
-    {
-        SUPER(HUDNavigation, tick, dt);
-
-        // Get radar
-        Radar* radar = this->getOwner()->getScene()->getRadar();
-
-        if (!radar->getFocus())
-        {
-            this->overlay_->hide();
-            return;
-        }
-        else
-        {
-            this->overlay_->show();
-        }
-
-        // set text
-        int dist = static_cast<int>(getDist2Focus());
-        navText_->setCaption(multi_cast<std::string>(dist));
-        float textLength = multi_cast<std::string>(dist).size() * navText_->getCharHeight() * 0.3f;
-
-        orxonox::Camera* cam = CameraManager::getInstance().getActiveCamera();
-        if (!cam)
-            return;
-        const Matrix4& transform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix();
-        // transform to screen coordinates
-        Vector3 pos = transform * radar->getFocus()->getRVWorldPosition();
-
-        bool outOfView;
-        if (pos.z > 1.0)
-        {
-            // z > 1.0 means that the object is behind the camera
-            outOfView = true;
-            // we have to switch all coordinates (if you don't know why,
-            // try linear algebra lectures, because I can't explain..)
-            pos.x = -pos.x;
-            pos.y = -pos.y;
-        }
-        else
-            outOfView = pos.x < -1.0 || pos.x > 1.0 || pos.y < -1.0 || pos.y > 1.0;
-
-        if (outOfView)
-        {
-            // object is not in view
-//            aimMarker_->hide();
-
-            if (!wasOutOfView_)
+
+
+            // Get Distance to HumanController and save it in the TextAreaOverlayElement.
+            int dist = listIt->second;
+            it->second.text_->setCaption ( multi_cast<std::string> ( dist ) );
+            float textLength = multi_cast<std::string> ( dist ).size() * it->second.text_->getCharHeight() * 0.3f;
+
+            // Transform to screen coordinates
+            Vector3 pos = camTransform * it->first->getRVWorldPosition();
+
+            bool outOfView = true;
+            if ( pos.z > 1.0 )
             {
-                navMarker_->setMaterialName("Orxonox/NavArrows");
-                wasOutOfView_ = true;
+                // z > 1.0 means that the object is behind the camera
+                outOfView = true;
+                // we have to switch all coordinates (if you don't know why,
+                // try linear algebra lectures, because I can't explain..)
+                pos.x = -pos.x;
+                pos.y = -pos.y;
             }
-
-            if (pos.x < pos.y)
+            else
+                outOfView = pos.x < -1.0 || pos.x > 1.0 || pos.y < -1.0 || pos.y > 1.0;
+            // Get Distance to HumanController and save it in the TextAreaOverlayElement.
+            it->second.text_->setCaption ( multi_cast<std::string> ( dist ) );
+
+            if ( outOfView )
             {
-                if (pos.y > -pos.x)
+                // Object is not in view
+
+                // Change material only if outOfView changed
+                if ( !it->second.wasOutOfView_ )
                 {
-                    // up
-                    float position = pos.x / pos.y + 1.0f;
-                    navMarker_->setPosition((position - navMarker_->getWidth()) * 0.5f, 0.0f);
-                    navMarker_->setUV(0.5f, 0.0f, 1.0f, 0.5f);
-                    navText_->setLeft((position - textLength) * 0.5f);
-                    navText_->setTop(navMarker_->getHeight());
+                    it->second.panel_->setMaterialName( TextureGenerator::getMaterialName( "arrows.tga", it->first->getRadarObjectColour()) );
+                    it->second.wasOutOfView_ = true;
                 }
+
+                // Switch between top, bottom, left and right position of the arrow at the screen border
+                if ( pos.x < pos.y )
+                {
+                    if ( pos.y > -pos.x )
+                    {
+                        // Top
+                        float position = pos.x / pos.y + 1.0f;
+                        it->second.panel_->setPosition ( ( position - it->second.panel_->getWidth() ) * 0.5f, 0.0f );
+                        it->second.panel_->setUV ( 0.5f, 0.0f, 1.0f, 0.5f );
+                        it->second.text_->setLeft ( ( position - textLength ) * 0.5f );
+                        it->second.text_->setTop ( it->second.panel_->getHeight() );
+                    }
+                    else
+                    {
+                        // Left
+                        float position = pos.y / pos.x + 1.0f;
+                        it->second.panel_->setPosition ( 0.0f, ( position - it->second.panel_->getWidth() ) * 0.5f );
+                        it->second.panel_->setUV ( 0.0f, 0.0f, 0.5f, 0.5f );
+                        it->second.text_->setLeft ( it->second.panel_->getWidth() + 0.01f );
+                        it->second.text_->setTop ( ( position - it->second.text_->getCharHeight() ) * 0.5f );
+                    }
+                }
+
                 else
                 {
-                    // left
-                    float position = pos.y / pos.x + 1.0f;
-                    navMarker_->setPosition(0.0f, (position - navMarker_->getWidth()) * 0.5f);
-                    navMarker_->setUV(0.0f, 0.0f, 0.5f, 0.5f);
-                    navText_->setLeft(navMarker_->getWidth() + 0.01f);
-                    navText_->setTop((position - navText_->getCharHeight()) * 0.5f);
+
+                    if ( pos.y < -pos.x )
+                    {
+                        // Bottom
+                        float position = -pos.x / pos.y + 1.0f;
+                        it->second.panel_->setPosition ( ( position - it->second.panel_->getWidth() ) * 0.5f, 1.0f - it->second.panel_->getHeight() );
+                        it->second.panel_->setUV ( 0.0f, 0.5f, 0.5f, 1.0f );
+                        it->second.text_->setLeft ( ( position - textLength ) * 0.5f );
+                        it->second.text_->setTop ( 1.0f - it->second.panel_->getHeight() - it->second.text_->getCharHeight() );
+                    }
+                    else
+                    {
+                        // Right
+                        float position = -pos.y / pos.x + 1.0f;
+                        it->second.panel_->setPosition ( 1.0f - it->second.panel_->getWidth(), ( position - it->second.panel_->getHeight() ) * 0.5f );
+                        it->second.panel_->setUV ( 0.5f, 0.5f, 1.0f, 1.0f );
+                        it->second.text_->setLeft ( 1.0f - it->second.panel_->getWidth() - textLength - 0.01f );
+                        it->second.text_->setTop ( ( position - it->second.text_->getCharHeight() ) * 0.5f );
+                    }
                 }
             }
             else
             {
-                if (pos.y < -pos.x)
+                // Object is in view
+
+                // Change material only if outOfView changed
+                if ( it->second.wasOutOfView_ )
                 {
-                    // down
-                    float position = -pos.x / pos.y + 1.0f;
-                    navMarker_->setPosition((position - navMarker_->getWidth()) * 0.5f, 1.0f - navMarker_->getHeight());
-                    navMarker_->setUV(0.0f, 0.5f, 0.5f, 1.0f);
-                    navText_->setLeft((position - textLength) * 0.5f);
-                    navText_->setTop(1.0f - navMarker_->getHeight() - navText_->getCharHeight());
+                  //it->second.panel_->setMaterialName ( "Orxonox/NavTDC" );
+                    it->second.panel_->setMaterialName( TextureGenerator::getMaterialName( "tdc.tga", it->first->getRadarObjectColour()) );
+                    it->second.wasOutOfView_ = false;
                 }
-                else
-                {
-                    // right
-                    float position = -pos.y / pos.x + 1.0f;
-                    navMarker_->setPosition(1.0f - navMarker_->getWidth(), (position - navMarker_->getHeight()) * 0.5f);
-                    navMarker_->setUV(0.5f, 0.5f, 1.0f, 1.0f);
-                    navText_->setLeft(1.0f - navMarker_->getWidth() - textLength - 0.01f);
-                    navText_->setTop((position - navText_->getCharHeight()) * 0.5f);
-                }
+
+                // Position marker
+                it->second.panel_->setUV ( 0.0f, 0.0f, 1.0f, 1.0f );
+                it->second.panel_->setLeft ( ( pos.x + 1.0f - it->second.panel_->getWidth() ) * 0.5f );
+                it->second.panel_->setTop ( ( -pos.y + 1.0f - it->second.panel_->getHeight() ) * 0.5f );
+
+                // Position text
+                it->second.text_->setLeft ( ( pos.x + 1.0f + it->second.panel_->getWidth() ) * 0.5f );
+                it->second.text_->setTop ( ( -pos.y + 1.0f + it->second.panel_->getHeight() ) * 0.5f );
             }
+
+            // Make sure the overlays are shown
+            it->second.panel_->show();
+            it->second.text_->show();
         }
         else
         {
-            // object is in view
-/*
-            Vector3 aimpos = transform * getPredictedPosition(SpaceShip::getLocalShip()->getPosition(),
-                    Projectile::getSpeed(), Radar::getInstance().getFocus()->getRVWorldPosition(), Radar::getInstance().getFocus()->getRVOrientedVelocity());
+            it->second.panel_->hide();
+            it->second.text_->hide();
+        }
+
+    }
+}
+
+
+/** Overridden method of OrxonoxOverlay.
+@details
+    Usually the entire overlay scales with scale().
+    Here we obviously have to adjust this.
 */
-            if (wasOutOfView_)
-            {
-                navMarker_->setMaterialName("Orxonox/NavTDC");
-                wasOutOfView_ = false;
-            }
-
-            // object is in view
-            navMarker_->setUV(0.0f, 0.0f, 1.0f, 1.0f);
-            navMarker_->setLeft((pos.x + 1.0f - navMarker_->getWidth()) * 0.5f);
-            navMarker_->setTop((-pos.y + 1.0f - navMarker_->getHeight()) * 0.5f);
-
-/*
-            aimMarker_->show();
-            aimMarker_->setLeft((aimpos.x + 1.0f - aimMarker_->getWidth()) * 0.5f);
-            aimMarker_->setTop((-aimpos.y + 1.0f - aimMarker_->getHeight()) * 0.5f);
-*/
-            navText_->setLeft((pos.x + 1.0f + navMarker_->getWidth()) * 0.5f);
-            navText_->setTop((-pos.y + 1.0f + navMarker_->getHeight()) * 0.5f);
+void HUDNavigation::sizeChanged()
+{
+    // Use size to compensate for aspect ratio if enabled.
+    float xScale = this->getActualSize().x;
+    float yScale = this->getActualSize().y;
+
+    for ( ObjectMap::iterator it = activeObjectList_.begin(); it!=activeObjectList_.end(); ++it )
+    {
+        if ( it->second.panel_ != NULL )
+            it->second.panel_->setDimensions ( navMarkerSize_ * xScale, navMarkerSize_ * yScale );
+        if ( it->second.text_ != NULL )
+            it->second.text_->setCharHeight ( it->second.text_->getCharHeight() * yScale );
+    }
+}
+
+void HUDNavigation::addObject ( RadarViewable* object )
+{
+    if( showObject(object)==false )
+        return;
+
+    if ( activeObjectList_.size() >= markerLimit_ )
+        if ( object == NULL )
+            return;
+
+    // Object hasn't been added yet (we know that)
+    assert ( this->activeObjectList_.find ( object ) == this->activeObjectList_.end() );
+
+    // Scales used for dimensions and text size
+    float xScale = this->getActualSize().x;
+    float yScale = this->getActualSize().y;
+
+    // Create everything needed to display the object on the radar and add it to the map
+
+    // Create arrow/marker
+    Ogre::PanelOverlayElement* panel = static_cast<Ogre::PanelOverlayElement*> ( Ogre::OverlayManager::getSingleton()
+                                       .createOverlayElement ( "Panel", "HUDNavigation_navMarker_" + getUniqueNumberString() ) );
+//     panel->setMaterialName ( "Orxonox/NavTDC" );
+    panel->setMaterialName( TextureGenerator::getMaterialName( "tdc.tga", object->getRadarObjectColour()) );
+    panel->setDimensions ( navMarkerSize_ * xScale, navMarkerSize_ * yScale );
+//     panel->setColour( object->getRadarObjectColour() );
+
+    Ogre::TextAreaOverlayElement* text = static_cast<Ogre::TextAreaOverlayElement*> ( Ogre::OverlayManager::getSingleton()
+                                         .createOverlayElement ( "TextArea", "HUDNavigation_navText_" + getUniqueNumberString() ) );
+    text->setFontName ( this->fontName_ );
+    text->setCharHeight ( text->getCharHeight() * yScale );
+    text->setColour( object->getRadarObjectColour() );
+
+    panel->hide();
+    text->hide();
+
+    ObjectInfo tempStruct = {panel, text, false};
+    activeObjectList_[object] = tempStruct;
+
+    this->background_->addChild ( panel );
+    this->background_->addChild ( text );
+
+    sortedObjectList_.push_front ( std::make_pair ( object, ( unsigned int ) 0 ) );
+
+
+}
+
+void HUDNavigation::removeObject ( RadarViewable* viewable )
+{
+    ObjectMap::iterator it = activeObjectList_.find ( viewable );
+
+    if ( activeObjectList_.find ( viewable ) != activeObjectList_.end() )
+    {
+        // Detach overlays
+        this->background_->removeChild ( it->second.panel_->getName() );
+        this->background_->removeChild ( it->second.text_->getName() );
+        // Properly destroy the overlay elements (do not use delete!)
+        Ogre::OverlayManager::getSingleton().destroyOverlayElement ( it->second.panel_ );
+        Ogre::OverlayManager::getSingleton().destroyOverlayElement ( it->second.text_ );
+        // Remove from the list
+        activeObjectList_.erase ( viewable );
+
+
+    }
+
+    for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++listIt )
+    {
+        if ( (listIt->first) == viewable )
+        {
+            sortedObjectList_.erase ( listIt );
+            break;
         }
-    }
-
-    float HUDNavigation::getDist2Focus() const
-    {
-        Radar* radar = this->getOwner()->getScene()->getRadar();
-        if (radar->getFocus() && HumanController::getLocalControllerEntityAsPawn())
-            return (radar->getFocus()->getRVWorldPosition() - HumanController::getLocalControllerEntityAsPawn()->getWorldPosition()).length();
-        else
-            return 0;
-    }
-
-    /**
-    @brief Overridden method of OrxonoxOverlay. Usually the entire overlay
-           scales with scale(). Here we obviously have to adjust this.
-    */
-    void HUDNavigation::sizeChanged()
-    {
-        // use size to compensate for aspect ratio if enabled.
-        float xScale = this->getActualSize().x;
-        float yScale = this->getActualSize().y;
-        if (this->navMarker_)
-            navMarker_->setDimensions(navMarkerSize_ * xScale, navMarkerSize_ * yScale);
-/*
-        if (this->aimMarker_)
-            aimMarker_->setDimensions(aimMarkerSize_ * xScale, aimMarkerSize_ * yScale);
-*/
-        if (this->navText_)
-            navText_->setCharHeight(navText_->getCharHeight() * yScale);
-    }
-}
+
+    }
+
+}
+
+void HUDNavigation::objectChanged(RadarViewable* viewable)
+{
+    // TODO: niceification neccessary ;)
+    removeObject(viewable);
+    addObject(viewable);
+}
+
+
+bool HUDNavigation::showObject(RadarViewable* rv)
+{
+    if ( rv == dynamic_cast<RadarViewable*> ( this->getOwner() ) )
+        return false;
+    assert( rv->getWorldEntity() );
+    if ( rv->getWorldEntity()->isVisible()==false || rv->getRadarVisibility()==false )
+        return false;
+    return true;
+}
+
+void HUDNavigation::changedOwner()
+{
+
+    const std::set<RadarViewable*>& respawnObjects = this->getOwner()->getScene()->getRadar()->getRadarObjects();
+    for ( std::set<RadarViewable*>::const_iterator it = respawnObjects.begin(); it != respawnObjects.end(); ++it )
+    {
+        if ( ! ( *it )->isHumanShip_ )
+            this->addObject ( *it );
+    }
+}
+}
Index: code/trunk/src/modules/overlays/hud/HUDNavigation.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDNavigation.h	(revision 6906)
+++ code/trunk/src/modules/overlays/hud/HUDNavigation.h	(revision 7163)
@@ -32,52 +32,78 @@
 #include "overlays/OverlaysPrereqs.h"
 
+#include <map>
+#include <string>
+
+
 #include "util/OgreForwardRefs.h"
 #include "tools/interfaces/Tickable.h"
+#include "interfaces/RadarListener.h"
 #include "overlays/OrxonoxOverlay.h"
 
 namespace orxonox
 {
-    class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable
+class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable, public RadarListener
+{
+public:
+    HUDNavigation ( BaseObject* creator );
+    virtual ~HUDNavigation();
+
+    void setConfigValues();
+
+    virtual void XMLPort ( Element& xmlElement, XMLPort::Mode mode );
+    virtual void tick ( float dt );
+
+    virtual void addObject ( RadarViewable* object );
+    virtual void removeObject ( RadarViewable* viewable );
+    virtual void objectChanged ( RadarViewable* viewable );
+
+    virtual void changedOwner();
+    virtual void sizeChanged();
+    virtual void angleChanged() { }
+    virtual void positionChanged() { }
+    virtual void radarTick ( float dt ) {}
+
+    inline float getRadarSensitivity() const
+    { return 1.0f; }
+
+private:
+    struct ObjectInfo
     {
-    public:
-        HUDNavigation(BaseObject* creator);
-        virtual ~HUDNavigation();
+        Ogre::PanelOverlayElement* panel_;
+        Ogre::TextAreaOverlayElement* text_;
+        bool outOfView_;
+        bool wasOutOfView_;
 
-        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
-        virtual void tick(float dt);
+    };
 
-    private:
-        void sizeChanged();
-        void angleChanged() { }
-        void positionChanged() { }
+    bool showObject( RadarViewable* rv );
 
-        // XMLPort accessors
-        void setNavMarkerSize(float size) { this->navMarkerSize_ = size; this->sizeChanged(); }
-        float getNavMarkerSize() const    { return this->navMarkerSize_; }
+    // XMLPort accessors
+    void setNavMarkerSize ( float size )
+    { navMarkerSize_ = size; this->sizeChanged(); }
+    float getNavMarkerSize() const
+    { return navMarkerSize_; }
 
-/*
-        void setAimMarkerSize(float size) { this->aimMarkerSize_ = size; this->sizeChanged(); }
-        float getAimMarkerSize() const    { return this->aimMarkerSize_; }
-*/
+    void setTextSize ( float size );
+    float getTextSize() const;
 
-        void setTextSize(float size);
-        float getTextSize() const;
+    void setFont ( const std::string& font );
+    const std::string& getFont() const;
 
-        void setFont(const std::string& font);
-        const std::string& getFont() const;
+    typedef std::map<RadarViewable*, ObjectInfo > ObjectMap;
+    ObjectMap activeObjectList_;
 
-        void updateMarker();
-        void updateFocus();
-        float getDist2Focus() const;
+    typedef std::list < std::pair<RadarViewable*, unsigned int > > sortedList;
+    sortedList sortedObjectList_;
 
-        Ogre::PanelOverlayElement* navMarker_;      //!< the panel used to show the arrow and the target marker
-        float navMarkerSize_;                       //!< One paramter size of the navigation marker
-/*
-        Ogre::PanelOverlayElement* aimMarker_;      //!< Panel used to show the aim Marker
-        float aimMarkerSize_;                       //!< One paramter size of the aim marker
-*/
-        Ogre::TextAreaOverlayElement* navText_;     //!< Text overlay to display the target distance
-        bool wasOutOfView_;                         //!< Performance booster variable: setMaterial is not cheap
-    };
+
+    float navMarkerSize_;
+    std::string fontName_;
+    float textSize_;
+
+    unsigned int markerLimit_;; //TODO: is it possible to set this over the console and/or the IG-Setting
+
+
+};
 }
 
Index: code/trunk/src/modules/overlays/hud/HUDRadar.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDRadar.cc	(revision 6906)
+++ code/trunk/src/modules/overlays/hud/HUDRadar.cc	(revision 7163)
@@ -40,4 +40,6 @@
 #include "worldentities/WorldEntity.h"
 #include "worldentities/pawns/Pawn.h"
+#include "Scene.h"
+#include "Radar.h"
 
 namespace orxonox
@@ -72,8 +74,8 @@
         {
             Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->marker_);
-            for (std::vector<Ogre::PanelOverlayElement*>::iterator it = this->radarDots_.begin();
-                it != this->radarDots_.end(); ++it)
+            for (std::map<RadarViewable*,Ogre::PanelOverlayElement*>::iterator it = this->radarObjects_.begin();
+                it != this->radarObjects_.end(); ++it)
             {
-                Ogre::OverlayManager::getSingleton().destroyOverlayElement(*it);
+                Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second);
             }
         }
@@ -89,80 +91,108 @@
     }
 
-    void HUDRadar::displayObject(RadarViewable* object, bool bIsMarked)
+    void HUDRadar::addObject(RadarViewable* object)
     {
-        if (object == static_cast<RadarViewable*>(this->owner_))
+        if (object == dynamic_cast<RadarViewable*>(this->owner_))
             return;
 
-        const WorldEntity* wePointer = object->getWorldEntity();
+        // Make sure the object hasn't been added yet
+        assert( this->radarObjects_.find(object) == this->radarObjects_.end() );
 
-        // Just to be sure that we actually have a WorldEntity.
-        // We could do a dynamic_cast, but that would be a lot slower.
-        if (!wePointer || !this->owner_)
+        // Create everything needed to display the object on the radar and add it to the map
+        Ogre::PanelOverlayElement* panel;
+        panel = static_cast<Ogre::PanelOverlayElement*>(
+            Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "RadarDot" + getUniqueNumberString()));
+        this->overlay_->add2D(panel);
+        // get right material
+        panel->setMaterialName(TextureGenerator::getMaterialName(
+            shapeMaterials_[object->getRadarObjectShape()], object->getRadarObjectColour()));
+        this->radarObjects_[object] = panel;
+    }
+
+    void HUDRadar::removeObject(RadarViewable* object)
+    {
+        // If object was added at all then remove it
+        std::map<RadarViewable*,Ogre::PanelOverlayElement*>::iterator it;
+        it = this->radarObjects_.find( object );
+        if( it != this->radarObjects_.end() )
         {
-            if (!wePointer)
-                CCOUT(2) << "Cannot display a non-WorldEntitiy on the radar" << std::endl;
-            if (!this->owner_)
-                CCOUT(2) << "No owner defined" << std::endl;
+            Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second);
+            this->radarObjects_.erase(it);
+        }
+    }
+
+    void HUDRadar::objectChanged( RadarViewable* rv )
+    {
+        if (rv == dynamic_cast<RadarViewable*>(this->owner_))
             return;
-        }
+        assert( this->radarObjects_.find(rv) != this->radarObjects_.end() );
+        Ogre::PanelOverlayElement* panel = this->radarObjects_[rv];
+        panel->setMaterialName(TextureGenerator::getMaterialName(
+            shapeMaterials_[rv->getRadarObjectShape()], rv->getRadarObjectColour()));
+    }
 
-        // try to find a panel already created
-        Ogre::PanelOverlayElement* panel;
-        //std::map<RadarViewable*, Ogre::PanelOverlayElement*>::iterator it = this->radarDots_.find(object);
-        if (itRadarDots_ == this->radarDots_.end())
-        {
-            // we have to create a new entry
-            panel = static_cast<Ogre::PanelOverlayElement*>(
-                Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "RadarDot" + getUniqueNumberString()));
-            radarDots_.push_back(panel);
-            // get right material
-            panel->setMaterialName(TextureGenerator::getMaterialName(
-                shapeMaterials_[object->getRadarObjectShape()], object->getRadarObjectColour()));
-            this->overlay_->add2D(panel);
-            this->itRadarDots_ = this->radarDots_.end();
-        }
-        else
-        {
-            panel = *itRadarDots_;
-            ++itRadarDots_;
-            const std::string& materialName = TextureGenerator::getMaterialName(
-                shapeMaterials_[object->getRadarObjectShape()], object->getRadarObjectColour());
-            if (materialName != panel->getMaterialName())
-                panel->setMaterialName(materialName);
-        }
-        panel->show();
-
-        // set size to fit distance...
-        float distance = (wePointer->getWorldPosition() - this->owner_->getPosition()).length();
-        // calculate the size with 1/distance dependency for simplicity (instead of exp(-distance * lambda)
-        float size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance);
-        panel->setDimensions(size, size);
-
-        // calc position on radar...
-        Vector2 coord = get2DViewcoordinates(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition());
-        coord *= Ogre::Math::PI / 3.5f; // small adjustment to make it fit the texture
-        panel->setPosition((1.0f + coord.x - size) * 0.5f, (1.0f - coord.y - size) * 0.5f);
-
-        if (bIsMarked)
-        {
-            this->marker_->show();
-            this->marker_->setDimensions(size * 1.5f, size * 1.5f);
-            this->marker_->setPosition((1.0f + coord.x - size * 1.5f) * 0.5f, (1.0f - coord.y - size * 1.5f) * 0.5f);
-        }
+    void HUDRadar::gatherObjects()
+    {
+        const std::set<RadarViewable*>& objectSet = this->getCreator()->getScene()->getRadar()->getRadarObjects();
+        std::set<RadarViewable*>::const_iterator it;
+        for( it=objectSet.begin(); it!=objectSet.end(); ++it )
+            this->addObject(*it);
     }
 
     void HUDRadar::radarTick(float dt)
     {
-        for (itRadarDots_ = radarDots_.begin(); itRadarDots_ != radarDots_.end(); ++itRadarDots_)
-            (*itRadarDots_)->hide();
-        this->itRadarDots_ = this->radarDots_.begin();
-        this->marker_->hide();
+        // Make sure the owner of the radar was defined
+        if( !this->owner_ )
+        {
+            CCOUT(0) << "No owner defined" << std::endl;
+            assert(0);
+        }
+
+        this->marker_->hide();      // in case that no object is in focus
+        // get the focus object
+        Radar* radar = this->getOwner()->getScene()->getRadar();
+        const RadarViewable* focusObject = radar->getFocus();
+
+        // update the distances for all objects
+        std::map<RadarViewable*,Ogre::PanelOverlayElement*>::iterator it;
+        for( it = this->radarObjects_.begin(); it != this->radarObjects_.end(); ++it )
+        {
+            // Make sure the object really is a WorldEntity
+            const WorldEntity* wePointer = it->first->getWorldEntity();
+            if( !wePointer )
+            {
+                CCOUT(0) << "Cannot display a non-WorldEntitiy on the radar" << std::endl;
+                assert(0);
+            }
+            bool isFocus = (it->first == focusObject);
+            // set size to fit distance...
+            float distance = (wePointer->getWorldPosition() - this->owner_->getPosition()).length();
+            // calculate the size with 1/distance dependency for simplicity (instead of exp(-distance * lambda)
+            float size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance);
+            it->second->setDimensions(size, size);
+
+            // calc position on radar...
+            Vector2 coord = get2DViewcoordinates(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition());
+            coord *= Ogre::Math::PI / 3.5f; // small adjustment to make it fit the texture
+            it->second->setPosition((1.0f + coord.x - size) * 0.5f, (1.0f - coord.y - size) * 0.5f);
+            it->second->show();
+
+            // if this object is in focus, then set the focus marker
+            if (isFocus)
+            {
+                this->marker_->setDimensions(size * 1.5f, size * 1.5f);
+                this->marker_->setPosition((1.0f + coord.x - size * 1.5f) * 0.5f, (1.0f - coord.y - size * 1.5f) * 0.5f);
+                this->marker_->show();
+            }
+        }
     }
 
     void HUDRadar::changedOwner()
     {
-        SUPER(HUDRadar, changedOwner);
+    SUPER(HUDRadar, changedOwner);
 
-        this->owner_ = orxonox_cast<Pawn*>(this->getOwner());
-    }
+    this->owner_ = orxonox_cast<Pawn*>(this->getOwner());
+    assert(this->radarObjects_.size()==0);
+    this->gatherObjects();
 }
+}
Index: code/trunk/src/modules/overlays/hud/HUDRadar.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDRadar.h	(revision 6906)
+++ code/trunk/src/modules/overlays/hud/HUDRadar.h	(revision 7163)
@@ -65,11 +65,16 @@
 
         // RadarListener interface
-        void displayObject(RadarViewable* viewable, bool bIsMarked);
+        virtual void addObject(RadarViewable* viewable);
+        virtual void removeObject(RadarViewable* viewable);
+        virtual void objectChanged( RadarViewable* rv );
         void radarTick(float dt);
+
+        void gatherObjects();
 
         std::map<RadarViewable::Shape, std::string> shapeMaterials_;
 
-        std::vector<Ogre::PanelOverlayElement*> radarDots_;
-        std::vector<Ogre::PanelOverlayElement*>::iterator itRadarDots_;
+//         std::vector<Ogre::PanelOverlayElement*> radarDots_;
+//         std::vector<Ogre::PanelOverlayElement*>::iterator itRadarDots_;
+        std::map<RadarViewable*, Ogre::PanelOverlayElement*> radarObjects_;
         Ogre::PanelOverlayElement* marker_;
 
Index: code/trunk/src/modules/pickup/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/pickup/CMakeLists.txt	(revision 6906)
+++ code/trunk/src/modules/pickup/CMakeLists.txt	(revision 7163)
@@ -1,3 +1,4 @@
 SET_SOURCE_FILES(PICKUP_SRC_FILES
+  CollectiblePickup.cc
   DroppedPickup.cc
   Pickup.cc
@@ -17,6 +18,4 @@
     PickupManager.h
     PickupRepresentation.h
-  DEFINE_SYMBOL
-    "PICKUP_SHARED_BUILD"
   PCH_FILE
     PickupPrecompiledHeaders.h
Index: code/trunk/src/modules/pickup/CollectiblePickup.cc
===================================================================
--- code/trunk/src/modules/pickup/CollectiblePickup.cc	(revision 7163)
+++ code/trunk/src/modules/pickup/CollectiblePickup.cc	(revision 7163)
@@ -0,0 +1,164 @@
+/*
+ *   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:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file CollectiblePickup.cc
+    @brief Implementation of the CollectiblePickup class.
+*/
+
+#include "CollectiblePickup.h"
+
+#include "core/CoreIncludes.h"
+#include "PickupCollection.h"
+
+namespace orxonox {
+
+    /**
+    @brief
+        Constructor.
+        Registers the object and initializes variables.
+    */
+    CollectiblePickup::CollectiblePickup() : isInCollection_(false)
+    {
+        RegisterObject(CollectiblePickup);
+
+        this->collection_ = NULL;
+    }
+
+    /**
+    @brief
+        Destructor.
+    */
+    CollectiblePickup::~CollectiblePickup()
+    {
+
+    }
+
+    /**
+    @brief
+        Is called by OrxonoxClass::destroy() before the object is actually destroyed.
+    */
+    void CollectiblePickup::preDestroy(void)
+    {
+        this->Pickupable::preDestroy();
+
+        // The PickupCollection has to be destroyed as well.
+        if(this->isInCollection())
+            this->collection_->Pickupable::destroy();
+    }
+
+    /**
+    @brief
+        Destroys a Pickupable.
+    */
+    void CollectiblePickup::destroyPickup(void)
+    {
+        if(!this->isInCollection()) // If the CollectiblePickup is not in a PickupCollection the destroyPickup method of Pickupable is called.
+            this->Pickupable::destroyPickup();
+        else // Else the ColectiblePickup is dropped and disabled,
+        {
+            this->drop(false);
+            if(this->isInCollection() && this->isEnabled()) // It is only disabled if it is enabled and still ina PickupCollection after having been dropped.
+            {
+                this->setDisabled();
+                this->collection_->pickupDisabled();
+            }
+        }
+    }
+
+    /**
+    @brief
+        Is called by the PickupCarrier when it is being destroyed.
+    */
+    void CollectiblePickup::carrierDestroyed(void)
+    {
+        if(!this->isInCollection())
+            this->Pickupable::destroy();
+        else // If the CollectiblePickup is part of a PickupCollection it is just dropped instead of destroyed.
+            this->drop(false);
+    }
+
+    /**
+    @brief
+        Is called when the pickup has transited from used to unused or the other way around.
+    */
+    void CollectiblePickup::changedUsed(void)
+    {
+        SUPER(CollectiblePickup, changedUsed);
+
+        if(this->isInCollection())
+            this->collection_->pickupChangedUsed(this->isUsed());
+    }
+
+    /**
+    @brief
+        Is called when the pickup has transited from picked up to dropped or the other way around.
+    */
+    void CollectiblePickup::changedPickedUp(void)
+    {
+        SUPER(CollectiblePickup, changedPickedUp);
+
+        if(this->isInCollection())
+            this->collection_->pickupChangedPickedUp(this->isPickedUp());
+    }
+
+    /**
+    @brief
+        Adds this CollectiblePickup to the input PickupCollection.
+    @param collection
+        A pointer to the PickupCollection to which the CollectiblePickup should be added.
+    @return
+        Returns true if the CollectiblePickup was successfully added to the PickupCollection.
+    */
+    bool CollectiblePickup::addToCollection(PickupCollection* collection)
+    {
+        if(this->isInCollection() || collection == NULL) //If the CollectiblePickup already is in a PickupCollection or if the input pointer is NULL.
+            return false;
+
+        this->isInCollection_ = true;
+        this->collection_ = collection;
+        return true;
+    }
+
+    /**
+    @brief
+        Removes this CollectiblePickup from its PickupCollection.
+    @return
+        Returns true if the CollectiblePickup was succcessfully removed.
+    */
+    bool CollectiblePickup::removeFromCollection(void)
+    {
+        if(!this->isInCollection()) //If the CollectiblePickup is not in a PickupCollection.
+            return false;
+
+        this->isInCollection_ = false;
+        this->collection_ = NULL;
+        return true;
+    }
+
+}
Index: code/trunk/src/modules/pickup/CollectiblePickup.h
===================================================================
--- code/trunk/src/modules/pickup/CollectiblePickup.h	(revision 7163)
+++ code/trunk/src/modules/pickup/CollectiblePickup.h	(revision 7163)
@@ -0,0 +1,82 @@
+/*
+ *   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:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file CollectiblePickup.h
+    @brief Definition of the CollectiblePickup class.
+*/
+
+#ifndef _CollectiblePickup_H__
+#define _CollectiblePickup_H__
+
+#include "pickup/PickupPrereqs.h"
+
+#include "interfaces/Pickupable.h"
+
+namespace orxonox {
+
+    /**
+    @brief
+        Collectible Pickup class. Any pickup inheriting from this class can be added to a PickupCollection and thus be part uf such.
+    @author
+        Damian 'Mozork' Frick
+    */
+    class _PickupExport CollectiblePickup : public Pickupable
+    {
+
+        public:
+            CollectiblePickup(); //!< Constructor.
+            virtual ~CollectiblePickup(); //! Destructor.
+
+            virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
+            virtual void changedPickedUp(void); //!< Is called when the pickup has transited from picked up to dropped or the other way around.
+
+            /**
+            @brief Check whether the given CollectiblePickup is par of a PickupCollection.
+            @return Returns true if the ColelctiblePickup is part of a PickupCollection.
+            */
+            bool isInCollection(void)
+                { return this->isInCollection_; }
+            
+            bool addToCollection(PickupCollection* collection); //!< Adds this CollectiblePickup to the input PickupCollection.
+            bool removeFromCollection(void); //!< Removes this CollectiblePickup from its PickupCollection.
+
+            void carrierDestroyed(void); //!< Is called by the PickupCarrier when it is being destroyed.
+
+        protected:
+            virtual void preDestroy(void); //!< Is called by OrxonoxClass::destroy() before the object is actually destroyed.
+            virtual void destroyPickup(void); //!< //!< Destroys a Pickupable.
+
+        private:
+            bool isInCollection_; //!< True if the CollectiblePickup is in a PickupCollection.
+            PickupCollection* collection_; //!< A pointer to the PickupCollection this CollectiblePickup is in.
+
+    };
+}
+
+#endif // _CollectiblePickup_H__
Index: code/trunk/src/modules/pickup/DroppedPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/DroppedPickup.cc	(revision 6906)
+++ code/trunk/src/modules/pickup/DroppedPickup.cc	(revision 7163)
@@ -41,7 +41,7 @@
 namespace orxonox
 {
-    
+
     CreateFactory(DroppedPickup);
-    
+
     /**
     @brief
@@ -51,5 +51,5 @@
     {
         RegisterObject(DroppedPickup);
-        
+
     }
 
@@ -67,10 +67,10 @@
     */
     DroppedPickup::DroppedPickup(BaseObject* creator, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance) : PickupSpawner(creator, pickup, triggerDistance, 5, 1)
-    {   
+    {
         RegisterObject(DroppedPickup);
 
         this->setPosition(carrier->getCarrierPosition());
         this->setActive(false);
-        
+
         //TODO: Do more elegantly.
         this->startRespawnTimer();
Index: code/trunk/src/modules/pickup/DroppedPickup.h
===================================================================
--- code/trunk/src/modules/pickup/DroppedPickup.h	(revision 6906)
+++ code/trunk/src/modules/pickup/DroppedPickup.h	(revision 7163)
@@ -41,5 +41,5 @@
 namespace orxonox
 {
-    
+
     /**
     @brief
Index: code/trunk/src/modules/pickup/Pickup.cc
===================================================================
--- code/trunk/src/modules/pickup/Pickup.cc	(revision 6906)
+++ code/trunk/src/modules/pickup/Pickup.cc	(revision 7163)
@@ -48,4 +48,6 @@
     /*static*/ const std::string Pickup::durationTypeOnce_s = "once";
     /*static*/ const std::string Pickup::durationTypeContinuous_s = "continuous";
+
+    CreateUnloadableFactory(Pickup);
 
     Pickup::Pickup(BaseObject* creator) : BaseObject(creator)
@@ -146,9 +148,9 @@
     void Pickup::setActivationType(const std::string& type)
     {
-        if(type == activationTypeImmediate_s)
+        if(Pickup::activationTypeImmediate_s.compare(type) == 0)
         {
             this->activationType_ = pickupActivationType::immediate;
         }
-        else if(type == activationTypeOnUse_s)
+        else if(Pickup::activationTypeOnUse_s.compare(type) == 0)
         {
             this->activationType_ = pickupActivationType::onUse;
@@ -168,9 +170,9 @@
     void Pickup::setDurationType(const std::string& type)
     {
-        if(type == durationTypeOnce_s)
+        if(Pickup::durationTypeOnce_s.compare(type) == 0)
         {
             this->durationType_ = pickupDurationType::once;
         }
-        else if(type == durationTypeContinuous_s)
+        else if(Pickup::durationTypeContinuous_s.compare(type) == 0)
         {
             this->durationType_ = pickupDurationType::continuous;
@@ -192,5 +194,5 @@
 
         //! Sets the Pickup to used if the Pickup has activation type 'immediate' and gets picked up.
-        if(this->getCarrier() != NULL && this->isPickedUp() && this->isImmediate())
+        if(this->isPickedUp() && this->isImmediate())
         {
             this->setUsed(true);
Index: code/trunk/src/modules/pickup/Pickup.h
===================================================================
--- code/trunk/src/modules/pickup/Pickup.h	(revision 6906)
+++ code/trunk/src/modules/pickup/Pickup.h	(revision 7163)
@@ -40,5 +40,5 @@
 #include "core/XMLPort.h"
 
-#include "interfaces/Pickupable.h"
+#include "CollectiblePickup.h"
 
 #include "tools/Timer.h"
@@ -74,11 +74,9 @@
         Damian 'Mozork' Frick
     */
-    class _PickupExport Pickup : public Pickupable, public BaseObject
+    class _PickupExport Pickup : public CollectiblePickup, public BaseObject
     {
 
-        protected:
+        public:
             Pickup(BaseObject* creator); //!< Constructor.
-
-        public:
             virtual ~Pickup(); //!< Destructor.
 
@@ -167,5 +165,5 @@
         private:
             void initialize(void); //!< Initializes the member variables.
-            
+
             //TODO: Problems, when there are more Timers needed? Solutions?
             Timer durationTimer_; //!< Timer at the disposal of each Class implementing Pickup.
Index: code/trunk/src/modules/pickup/PickupCollection.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupCollection.cc	(revision 6906)
+++ code/trunk/src/modules/pickup/PickupCollection.cc	(revision 7163)
@@ -35,4 +35,5 @@
 #include "core/XMLPort.h"
 #include "interfaces/PickupCarrier.h"
+#include "CollectiblePickup.h"
 #include "DroppedPickup.h"
 #include "PickupCollectionIdentifier.h"
@@ -42,5 +43,5 @@
 namespace orxonox
 {
- 
+
     CreateFactory(PickupCollection);
 
@@ -52,8 +53,13 @@
     {
         RegisterObject(PickupCollection);
-        
+
         this->pickupCollectionIdentifier_ = new PickupCollectionIdentifier(this);
-    }
-    
+        this->usedCounter_ = 0;
+        this->pickedUpCounter_ = 0;
+        this->disabledCounter_ = 0;
+        this->processingUsed_ = false;
+        this->processingPickedUp_ = false;
+    }
+
     /**
     @brief
@@ -62,12 +68,13 @@
     PickupCollection::~PickupCollection()
     {
-        //! Destroy all Pickupables constructing this PickupCollection.
-        for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
-        {
-            if((*it).get() != NULL)
-                (*it).get()->destroy();
-        }
-    }
-    
+        // Destroy all Pickupables constructing this PickupCollection.
+        for(std::vector<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+        {
+            (*it)->removeFromCollection();
+            (*it)->destroy();
+        }
+        this->pickups_.clear();
+    }
+
     /**
     @brief
@@ -77,10 +84,10 @@
     {
         SUPER(PickupCollection, XMLPort, xmlelement, mode);
-        
-        XMLPortObject(PickupCollection, Pickupable, "pickupables", addPickupable, getPickupable, xmlelement, mode);
-        
+
+        XMLPortObject(PickupCollection, CollectiblePickup, "pickupables", addPickupable, getPickupable, xmlelement, mode);
+
         this->initializeIdentifier();
     }
-    
+
     /**
     @brief
@@ -89,10 +96,10 @@
     void PickupCollection::initializeIdentifier(void)
     {
-        for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
-        {
-            this->pickupCollectionIdentifier_->addPickup((*it).get()->getPickupIdentifier());
-        }
-    }
-    
+        for(std::vector<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+        {
+            this->pickupCollectionIdentifier_->addPickup((*it)->getPickupIdentifier());
+        }
+    }
+
     /**
     @brief
@@ -103,12 +110,35 @@
     {
         SUPER(PickupCollection, changedUsed);
-        
-        //! Change used for all Pickupables this PickupCollection consists of.
-        for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
-        {
-            (*it).get()->setUsed(this->isUsed());
-        }
-    }
-    
+
+        this->processingUsed_ = true;
+        // Change used for all Pickupables this PickupCollection consists of.
+        for(std::vector<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+        {
+            (*it)->setUsed(this->isUsed());
+        }
+        this->processingUsed_ = false;
+
+        this->changedUsedAction();
+    }
+
+    /**
+    @brief
+        Helper method.
+        Checks whether due to changes in the used status of the pickups of this PickupCollection the used status of this PickupCollection has to change as well.
+    */
+    void PickupCollection::changedUsedAction(void)
+    {
+        if(this->processingUsed_)
+            return;
+
+        // If all the pickups are not in use but the PickupCollection is.
+        if(this->usedCounter_ == 0 && this->isUsed())
+            this->setUsed(false);
+
+        // If all the enabled pickups are in use but the PickupCollection is not.
+        if(this->usedCounter_ != 0 && this->usedCounter_ == this->pickups_.size()-this->disabledCounter_ && !this->isUsed())
+            this->setUsed(true);
+    }
+
     /**
     @brief
@@ -119,12 +149,15 @@
     {
         SUPER(PickupCollection, changedCarrier);
-        
-        //! Change the PickupCarrier for all Pickupables this PickupCollection consists of.
-        for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
-        {
-            (*it).get()->setCarrier(this->getCarrier()->getTarget(*it));
-        }
-    }
-    
+
+        // Change the PickupCarrier for all Pickupables this PickupCollection consists of.
+        for(std::vector<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+        {
+            if(this->getCarrier() == NULL)
+                (*it)->setCarrier(NULL);
+            else
+                (*it)->setCarrier(this->getCarrier()->getTarget(*it));
+        }
+    }
+
     /**
     @brief
@@ -135,12 +168,35 @@
     {
         SUPER(PickupCollection, changedPickedUp);
-        
-        //! Change the pickedUp status for all Pickupables this PickupCollection consists of.
-        for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
-        {
-            (*it).get()->setPickedUp(this->isPickedUp());
-        }
-    }
-    
+
+        this->processingPickedUp_ = true;
+        // Change the pickedUp status for all Pickupables this PickupCollection consists of.
+        for(std::vector<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+        {
+            (*it)->setPickedUp(this->isPickedUp());
+        }
+        this->processingPickedUp_ = false;
+
+        this->changedPickedUpAction();
+    }
+
+    /**
+    @brief
+        Helper method.
+        Checks whether due to changes in the picked up status of the pickups of this PickupCollection the picked up status of this PickupCollection has to change as well.
+    */
+    void PickupCollection::changedPickedUpAction(void)
+    {
+        if(this->processingPickedUp_)
+            return;
+
+        // If at least all the enabled pickups of this PickupCollection are no longer picked up. 
+        if(this->pickedUpCounter_ <= this->disabledCounter_ && this->isPickedUp())
+            this->Pickupable::destroy();
+
+        // If the PickupCollection is no longer picked up.
+        if(!this->isPickedUp())
+            this->pickedUpCounter_ = 0;
+    }
+
     /**
     @brief
@@ -154,18 +210,19 @@
         if(item == NULL)
             item = new PickupCollection(this);
-        
+
         SUPER(PickupCollection, clone, item);
-        
+
         PickupCollection* pickup = dynamic_cast<PickupCollection*>(item);
-        //! Clone all Pickupables this PickupCollection consist of.
-        for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
-        {
-            Pickupable* newPickup = (*it).get()->clone();
-            pickup->addPickupable(newPickup);
+        // Clone all Pickupables this PickupCollection consist of.
+        for(std::vector<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+        {
+            Pickupable* newPickup = (*it)->clone();
+            CollectiblePickup* collectible = static_cast<CollectiblePickup*>(newPickup);
+            pickup->addPickupable(collectible);
         }
 
         pickup->initializeIdentifier();
     }
-    
+
     /**
     @brief
@@ -178,13 +235,13 @@
     bool PickupCollection::isTarget(PickupCarrier* carrier) const
     {
-        for(std::vector<WeakPtr<Pickupable> >::const_iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
-        {
-            if(!carrier->isTarget((*it).get()))
+        for(std::vector<CollectiblePickup*>::const_iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+        {
+            if(!carrier->isTarget(*it))
                 return false;
         }
-        
+
         return true;
     }
-    
+
     /**
     @brief
@@ -198,5 +255,5 @@
         return this->pickupCollectionIdentifier_;
     }
-    
+
     /**
     @brief
@@ -207,14 +264,14 @@
         Returns true if successful,
     */
-    bool PickupCollection::addPickupable(Pickupable* pickup)
+    bool PickupCollection::addPickupable(CollectiblePickup* pickup)
     {
         if(pickup == NULL)
             return false;
-        
-        WeakPtr<Pickupable> ptr = pickup; //!< Create a weak pointer to be able to test in the constructor if the Pointer is still valid.
-        this->pickups_.push_back(ptr);
+
+        pickup->addToCollection(this);
+        this->pickups_.push_back(pickup);
         return true;
     }
-    
+
     /**
     @brief
@@ -227,7 +284,51 @@
     const Pickupable* PickupCollection::getPickupable(unsigned int index)
     {
-        return this->pickups_[index].get();
-    }
-        
+        return this->pickups_[index];
+    }
+
+    /**
+    @brief
+        Informs the PickupCollection, that one of its pickups has changed its used status to the input value.
+        This is used internally by the CollectiblePickup class.
+    @param changed
+        The value the used status has changed to. 
+    */
+    void PickupCollection::pickupChangedUsed(bool changed)
+    {
+        if(changed)
+            this->usedCounter_++;
+        else
+            this->usedCounter_--;
+
+        this->changedUsedAction();
+    }
+
+    /**
+    @brief
+        Informs the PickupCollection, that one of its pickups has changed its picked up status to the input value.
+        This is used internally by the CollectiblePickup class.
+    @param changed
+        The value the picked up status has changed to.
+    */
+    void PickupCollection::pickupChangedPickedUp(bool changed)
+    {
+        if(changed)
+            this->pickedUpCounter_++;
+        else
+            this->pickedUpCounter_--;
+
+        this->changedPickedUpAction();
+    }
+
+    /**
+    @brief
+        Informs the PickupCollection, that one of its pickups has been disabled.
+        This is used internally by the CollectiblePickup class.
+    */
+    void PickupCollection::pickupDisabled(void)
+    {
+        this->disabledCounter_++;
+    }
+
     /**
     @brief
@@ -245,4 +346,4 @@
         return true;
     }
-    
+
 }
Index: code/trunk/src/modules/pickup/PickupCollection.h
===================================================================
--- code/trunk/src/modules/pickup/PickupCollection.h	(revision 6906)
+++ code/trunk/src/modules/pickup/PickupCollection.h	(revision 7163)
@@ -37,6 +37,6 @@
 #include "PickupPrereqs.h"
 
-#include "interfaces/Pickupable.h"
 #include "core/BaseObject.h"
+#include "CollectiblePickup.h"
 
 #include <list>
@@ -47,16 +47,15 @@
     /**
     @brief
-        The PickupCollection combines different Pickupables to a coherent, single pickup and makes the seem (from the outside looking in) just as if they were just one Pickupable.
+        The PickupCollection combines different Pickupables to a coherent, single pickup and makes them seem (from the outside looking in) just as if they were just one Pickupable.
     @author
         Damian 'Mozork' Frick
     */
-    class _PickupExport PickupCollection : public Pickupable, public BaseObject
+    class _PickupExport PickupCollection : public CollectiblePickup, public BaseObject
     {
-        
+
         public:
-            
             PickupCollection(BaseObject* creator); //!< Default Constructor.
             virtual ~PickupCollection(); //!< Destructor.
-            
+
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Creates an instance of this Class through XML.
 
@@ -64,27 +63,40 @@
             virtual void changedCarrier(void); //!< Is called when the pickup has changed its PickupCarrier.
             virtual void changedPickedUp(void); //!< Is called when the pickup has transited from picked up to dropped or the other way around.
-            
+
             virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
-            
+
             virtual bool isTarget(PickupCarrier* carrier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this PickupCollection.
-            
+
             virtual const PickupIdentifier* getPickupIdentifier(void); //!< Get the PickupIdentifier of this PickupCollection.
-            
-            bool addPickupable(Pickupable* pickup); //!< Add the input Pickupable to list of Pickupables combined by this PickupCollection.
+
+            bool addPickupable(CollectiblePickup* pickup); //!< Add the input Pickupable to list of Pickupables combined by this PickupCollection.
             const Pickupable* getPickupable(unsigned int index); //!< Get the Pickupable at the given index.
-            
+
+            void pickupChangedUsed(bool changed); //!< Informs the PickupCollection, that one of its pickups has changed its used status to the input value.
+            void pickupChangedPickedUp(bool changed); //!< Informs the PickupCollection, that one of its pickups has changed its picked up status to the input value.
+            void pickupDisabled(void); //!< Informs the PickupCollection, that one of its pickups has been disabled.
+
         protected:
             void initializeIdentifier(void); //!< Initializes the PickupIdentifier for this pickup.
+
+            virtual bool createSpawner(void); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
+
+            PickupCollectionIdentifier* pickupCollectionIdentifier_; //!< The PickupCollectionIdentifier of this PickupCollection. Is used to distinguish different PickupCollections amongst themselves.
+
+        private:
+            void changedUsedAction(void); //!< Helper method.
+            void changedPickedUpAction(void); //!< Helper method.
             
-            virtual bool createSpawner(void); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
-            
-            PickupCollectionIdentifier* pickupCollectionIdentifier_; //!< The PickupCollectionIdentifier of this PickupCollection. Is used to distinguish different PickupCollections amongst themselves.
-            
-        private:
-            
-            std::vector<WeakPtr<Pickupable> > pickups_; //!< The list of the pointers of all the Pickupables this PickupCollection consists of. They are weak pointers to facilitate testing, whether the pointers are still valid.
-        
+            std::vector<CollectiblePickup*> pickups_; //!< The list of the pointers of all the Pickupables this PickupCollection consists of. They are weak pointers to facilitate testing, whether the pointers are still valid.
+
+            unsigned int usedCounter_; //!< Keeps track of the number of pickups of this PickupCollection, that are in use.
+            unsigned int pickedUpCounter_; //!< Keeps track of the number of pickups of this PickupCollection, that are picked up.
+            unsigned int disabledCounter_; //!< Keeps track of the number of pickups of this PickupCollection, that are disabled.
+
+            bool processingUsed_; //!< Boolean to ensure, that the PickupCollection doesn't update its used status while its internal state is inconsistent.
+            bool processingPickedUp_; //!< Boolean to ensure, that the PickupCollection doesn't update its picked upp status while its internal state is inconsistent.
+
     };
-    
+
 }
 
Index: code/trunk/src/modules/pickup/PickupCollectionIdentifier.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupCollectionIdentifier.cc	(revision 6906)
+++ code/trunk/src/modules/pickup/PickupCollectionIdentifier.cc	(revision 7163)
@@ -38,5 +38,5 @@
 namespace orxonox
 {
-    
+
     /**
     @brief
@@ -47,5 +47,5 @@
         RegisterObject(PickupCollectionIdentifier);
     }
-    
+
     /**
     @brief
@@ -54,5 +54,5 @@
     PickupCollectionIdentifier::~PickupCollectionIdentifier()
     {
-        
+
     }
 
@@ -67,23 +67,23 @@
     int PickupCollectionIdentifier::compare(const PickupIdentifier* identifier) const
     {
-        //! Slight un-niceity to cast the PickupIdentifier to a PickupCollectionIdentifier.
+        // Slight un-niceity to cast the PickupIdentifier to a PickupCollectionIdentifier.
         PickupIdentifier* temp = const_cast<PickupIdentifier*>(identifier);
         const PickupCollectionIdentifier* collectionIdentifier = dynamic_cast<PickupCollectionIdentifier*>(temp);
-        
-        //! If the input PickupIdentifier 'identifier' is no PickupCollectionIdentifier then just the two PickupIdentifiers are compared.
+
+        // If the input PickupIdentifier 'identifier' is no PickupCollectionIdentifier then just the two PickupIdentifiers are compared.
         if(collectionIdentifier == NULL)
         {
             return this->PickupIdentifier::compare(identifier);
         }
-        
-        //! If the number of Pickupables each of the two PickupCollectionIdentifiers contain differ, the one with less is considered smaller.
+
+        // If the number of Pickupables each of the two PickupCollectionIdentifiers contain differ, the one with less is considered smaller.
         if(this->identifiers_.size() != collectionIdentifier->identifiers_.size())
             return this->identifiers_.size()-collectionIdentifier->identifiers_.size();
-        
-        //! Compare the Pickupables of the two PickupCollectionIdentifiers one after the other. the one with the first 'smaller' one is considered smaller.
+
+        // Compare the Pickupables of the two PickupCollectionIdentifiers one after the other. the one with the first 'smaller' one is considered smaller.
         std::set<const PickupIdentifier*, PickupIdentifierCompare>::const_iterator it2 = collectionIdentifier->identifiers_.begin();
         for(std::set<const PickupIdentifier*, PickupIdentifierCompare>::const_iterator it = this->identifiers_.begin(); it != this->identifiers_.end(); it++)
         {
-            
+
             if((*it)->compare(*it2) < 0)
                 return -1;
@@ -91,9 +91,9 @@
                 return 1;
         }
-        
+
         //! Means they are equal.
         return 0;
     }
-    
+
     /**
     @brief
@@ -106,5 +106,5 @@
         this->identifiers_.insert(identifier);
     }
-    
+
 }
 
Index: code/trunk/src/modules/pickup/PickupCollectionIdentifier.h
===================================================================
--- code/trunk/src/modules/pickup/PickupCollectionIdentifier.h	(revision 6906)
+++ code/trunk/src/modules/pickup/PickupCollectionIdentifier.h	(revision 7163)
@@ -54,18 +54,18 @@
     class _PickupExport PickupCollectionIdentifier : public PickupIdentifier
     {
-        
+
         public:
             PickupCollectionIdentifier(Pickupable* pickup); //!< Constructor.
             ~PickupCollectionIdentifier(); //!< Destructor.
-            
+
             virtual int compare(const PickupIdentifier* identifier) const; //!< Compares a PickupCollectionIdentifier with a PickupIdentifier.
-            
+
             void addPickup(const PickupIdentifier* identifier); //!< Add a Pickupable to the PickupCollectionIdentifier.
-            
+
         private:
             std::set<const PickupIdentifier*, PickupIdentifierCompare> identifiers_; //!< The set of PickupIdentifiers of the Pickupables the PickupCollection with this PickupCollectionIdentifier consists of, ordered by the rule set by PickupIdentifierCompare.
-            
+
     };
-    
+
 }
 
Index: code/trunk/src/modules/pickup/PickupManager.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupManager.cc	(revision 6906)
+++ code/trunk/src/modules/pickup/PickupManager.cc	(revision 7163)
@@ -39,7 +39,9 @@
 #include "core/ScopedSingletonManager.h"
 #include "core/Identifier.h"
+#include "util/Convert.h"
 #include "interfaces/PickupCarrier.h"
 #include "infos/PlayerInfo.h"
 #include "worldentities/pawns/Pawn.h"
+#include "CollectiblePickup.h"
 #include "PickupRepresentation.h"
 
@@ -50,9 +52,9 @@
     // Register tolua_open function when loading the library
     DeclareToluaInterface(Pickup);
-    
-    ManageScopedSingleton(PickupManager, ScopeID::Graphics, false);
-    
+
+    ManageScopedSingleton(PickupManager, ScopeID::Root, false);
+
     /*static*/ const std::string PickupManager::guiName_s = "PickupInventory";
-    
+
     /**
     @brief
@@ -62,10 +64,15 @@
     {
         RegisterRootObject(PickupManager);
-        
+
+        //TODO: This doesn't work, yet.
+        if( GameMode::showsGraphics() )
+        {
+            GUIManager::getInstance().loadGUI(PickupManager::guiName_s);
+        }
         this->defaultRepresentation_ = new PickupRepresentation();
-        
+
         COUT(3) << "PickupManager created." << std::endl;
     }
-    
+
     /**
     @brief
@@ -77,10 +84,10 @@
         if(this->defaultRepresentation_ != NULL)
             this->defaultRepresentation_->destroy();
-        
+
         this->representations_.clear();
-        
+
         COUT(3) << "PickupManager destroyed." << std::endl;
     }
-    
+
     /**
     @brief
@@ -95,14 +102,14 @@
     */
     bool PickupManager::registerRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation)
-    {       
+    {
         if(identifier == NULL || representation == NULL || this->representations_.find(identifier) != this->representations_.end()) //!< If the Pickupable already has a Representation registered.
             return false;
-        
+
         this->representations_[identifier] = representation;
-        
+
         COUT(4) << "PickupRepresentation " << representation << " registered with the PickupManager." << std::endl;
         return true;
     }
-    
+
     /**
     @brief
@@ -116,18 +123,18 @@
     */
     bool PickupManager::unregisterRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation)
-    {       
+    {
         if(identifier == NULL || representation == NULL)
             return false;
-        
+
         std::map<const PickupIdentifier*, PickupRepresentation*, PickupIdentifierCompare>::iterator it = this->representations_.find(identifier);
         if(it == this->representations_.end()) //!< If the Pickupable is not registered in the first place.
             return false;
-        
+
         this->representations_.erase(it);
-        
+
         COUT(4) << "PickupRepresentation " << representation << " unregistered with the PickupManager." << std::endl;
         return true;
     }
-    
+
     /**
     @brief
@@ -146,67 +153,84 @@
             return this->defaultRepresentation_;
         }
-        
+
         return it->second;
     }
-    
-    PickupCarrier* PickupManager::getPawn(void)
-    {
+
+    int PickupManager::getNumPickups(void)
+    {
+        this->pickupsList_.clear();
+
         PlayerInfo* player = GUIManager::getInstance().getPlayer(PickupManager::guiName_s);
+        PickupCarrier* carrier = NULL;
         if (player != NULL)
-            return dynamic_cast<PickupCarrier*>(player->getControllableEntity());
+            carrier =  dynamic_cast<PickupCarrier*>(player->getControllableEntity());
         else
-            return NULL;
-    }
-    
-    int PickupManager::getNumCarrierChildren(PickupCarrier* carrier)
-    {
-        if(carrier == NULL)
             return 0;
-        return carrier->getNumCarrierChildren();
-    }
-            
-    PickupCarrier* PickupManager::getCarrierChild(int index, PickupCarrier* carrier)
-    {
-        if(carrier == NULL)
-            return NULL;
-        return carrier->getCarrierChild(index);
-    }
-    
-    const std::string& PickupManager::getCarrierName(orxonox::PickupCarrier* carrier)
-    {
-        if(carrier == NULL)
-            return BLANKSTRING;
-        return carrier->getCarrierName();
-    }
-    
-    PickupRepresentation* PickupManager::getPickupRepresentation(int index, PickupCarrier* carrier)
-    {
-        Pickupable* pickup = carrier->getPickup(index);
-        if(pickup == NULL)
-            return NULL;
-        
-        return this->getRepresentation(pickup->getPickupIdentifier());
-    }
-    
-    int PickupManager::getNumPickups(PickupCarrier* carrier)
-    {
-        if(carrier == NULL)
-            return 0;
-        return carrier->getNumPickups();
-    }
-    
-    void PickupManager::dropPickup(int index, PickupCarrier* carrier)
-    {
-        Pickupable* pickup = carrier->getPickup(index);
-        if(pickup != NULL)
-            carrier->drop(pickup);
-    }
-    
-    void PickupManager::usePickup(int index, PickupCarrier* carrier, bool use)
-    {
-        Pickupable* pickup = carrier->getPickup(index);
-        if(pickup != NULL)
+
+        std::vector<PickupCarrier*>* carriers = this->getAllCarriers(carrier);
+        for(std::vector<PickupCarrier*>::iterator it = carriers->begin(); it != carriers->end(); it++)
+        {
+            std::set<Pickupable*> pickups = (*it)->getPickups();
+            for(std::set<Pickupable*>::iterator pickup = pickups.begin(); pickup != pickups.end(); pickup++)
+            {
+                CollectiblePickup* collectible = orxonox_cast<CollectiblePickup*>(*pickup);
+                if(collectible == NULL || !collectible->isInCollection())
+                    this->pickupsList_.insert(std::pair<Pickupable*, WeakPtr<Pickupable> >(*pickup, WeakPtr<Pickupable>(*pickup)));
+            }
+        }
+        delete carriers;
+
+        this->pickupsIterator_ = this->pickupsList_.begin();
+        return this->pickupsList_.size();
+    }
+
+    std::vector<PickupCarrier*>* PickupManager::getAllCarriers(PickupCarrier* carrier)
+    {
+        //TODO: More efficiently.
+        std::vector<PickupCarrier*>* carriers = new std::vector<PickupCarrier*>();
+        carriers->insert(carriers->end(), carrier);
+        std::vector<PickupCarrier*>* children = carrier->getCarrierChildren();
+        for(std::vector<PickupCarrier*>::iterator it = children->begin(); it != children->end(); it++)
+        {
+            std::vector<PickupCarrier*>* childrensChildren = this->getAllCarriers(*it);
+            for(std::vector<PickupCarrier*>::iterator it2 = childrensChildren->begin(); it2 != childrensChildren->end(); it2++)
+            {
+                carriers->insert(carriers->end(), *it2);
+            }
+            delete childrensChildren;
+        }
+        delete children;
+        return carriers;
+    }
+
+    void PickupManager::dropPickup(orxonox::Pickupable* pickup)
+    {
+        std::map<Pickupable*, WeakPtr<Pickupable> >::iterator it = this->pickupsList_.find(pickup);
+        if(pickup == NULL || it == this->pickupsList_.end() || it->second.get() == NULL)
+            return;
+
+        if(!pickup->isPickedUp())
+            return;
+
+        PickupCarrier* carrier = pickup->getCarrier();
+        if(pickup != NULL && carrier != NULL)
+        {
+            pickup->drop(carrier);
+        }
+    }
+
+    void PickupManager::usePickup(orxonox::Pickupable* pickup, bool use)
+    {
+        std::map<Pickupable*, WeakPtr<Pickupable> >::iterator it = this->pickupsList_.find(pickup);
+        if(pickup == NULL || it == this->pickupsList_.end() || it->second.get() == NULL)
+            return;
+
+        if(!pickup->isPickedUp())
+            return;
+
+        PickupCarrier* carrier = pickup->getCarrier();
+        if(pickup != NULL && carrier != NULL)
             pickup->setUsed(use);
     }
-    
+
 }
Index: code/trunk/src/modules/pickup/PickupManager.h
===================================================================
--- code/trunk/src/modules/pickup/PickupManager.h	(revision 6906)
+++ code/trunk/src/modules/pickup/PickupManager.h	(revision 7163)
@@ -39,4 +39,5 @@
 #include <map>
 #include "util/Singleton.h"
+#include "core/WeakPtr.h"
 #include "pickup/PickupIdentifier.h"
 #include "PickupRepresentation.h"
@@ -59,38 +60,39 @@
     { // tolua_export
         friend class Singleton<PickupManager>;
-        
+
         public:
             PickupManager();
             virtual ~PickupManager();
-            
+
             static PickupManager& getInstance() { return Singleton<PickupManager>::getInstance(); } // tolua_export
-            
+
             bool registerRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation); //!< Registers a PickupRepresentation together with the PickupIdentifier of the Pickupable the PickupRepresentation represents.
             bool unregisterRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation); //!< Unegisters a PickupRepresentation together with the PickupIdentifier of the Pickupable the PickupRepresentation represents.
             PickupRepresentation* getRepresentation(const PickupIdentifier* identifier); //!< Get the PickupRepresentation representing the Pickupable with the input PickupIdentifier.
-            
+
             // tolua_begin
-            orxonox::PickupCarrier* getPawn(void);
-            
-            int getNumCarrierChildren(orxonox::PickupCarrier* carrier);
-            orxonox::PickupCarrier* getCarrierChild(int index, orxonox::PickupCarrier* carrier);
-            
-            const std::string& getCarrierName(orxonox::PickupCarrier* carrier);
-            
-            int getNumPickups(orxonox::PickupCarrier* carrier);
-            PickupRepresentation* getPickupRepresentation(int index, orxonox::PickupCarrier* carrier);
-            void dropPickup(int index, orxonox::PickupCarrier* carrier);
-            void usePickup(int index, orxonox::PickupCarrier* carrier, bool use);
+            int getNumPickups(void);
+            orxonox::Pickupable* popPickup(void) { return (this->pickupsIterator_++)->first; }
+            orxonox::PickupRepresentation* getPickupRepresentation(orxonox::Pickupable* pickup) { if(pickup != NULL) return this->getRepresentation(pickup->getPickupIdentifier()); return NULL; }
+
+            void dropPickup(orxonox::Pickupable* pickup);
+            void usePickup(orxonox::Pickupable* pickup, bool use);
+            bool isValidPickup(orxonox::Pickupable* pickup) { std::map<Pickupable*, WeakPtr<Pickupable> >::iterator it = this->pickupsList_.find(pickup); if(it == this->pickupsList_.end()) return false; return it->second.get() != NULL; }
             // tolua_end
-            
+
         private:
             static PickupManager* singletonPtr_s;
             static const std::string guiName_s;
-            
+
             PickupRepresentation* defaultRepresentation_; //!< The default PickupRepresentation.
             std::map<const PickupIdentifier*, PickupRepresentation*, PickupIdentifierCompare> representations_; //!< Map linking PickupIdentifiers (representing types if Pickupables) and PickupRepresentations.
-        
+
+            std::map<Pickupable*, WeakPtr<Pickupable> > pickupsList_;
+            std::map<Pickupable*, WeakPtr<Pickupable> >::iterator pickupsIterator_;
+
+            std::vector<PickupCarrier*>* getAllCarriers(PickupCarrier* carrier);
+
     }; // tolua_export
-    
+
 } // tolua_export
 
Index: code/trunk/src/modules/pickup/PickupPrereqs.h
===================================================================
--- code/trunk/src/modules/pickup/PickupPrereqs.h	(revision 6906)
+++ code/trunk/src/modules/pickup/PickupPrereqs.h	(revision 7163)
@@ -43,5 +43,5 @@
 //-----------------------------------------------------------------------
 
-#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD)
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(PICKUP_STATIC_BUILD)
 #  ifdef PICKUP_SHARED_BUILD
 #    define _PickupExport __declspec(dllexport)
@@ -65,5 +65,6 @@
 namespace orxonox
 {
-    
+
+    class CollectiblePickup;
     class DroppedPickup;
     class Pickup;
@@ -75,8 +76,10 @@
 
     //items
+    class DronePickup;
     class HealthPickup;
     class InvisiblePickup;
     class MetaPickup;
     class SpeedPickup;
+    class ShieldPickup;
 
 }
Index: code/trunk/src/modules/pickup/PickupRepresentation.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupRepresentation.cc	(revision 6906)
+++ code/trunk/src/modules/pickup/PickupRepresentation.cc	(revision 7163)
@@ -41,7 +41,7 @@
 namespace orxonox
 {
-    
+
     CreateFactory(PickupRepresentation);
-    
+
     /**
     @brief
@@ -52,8 +52,8 @@
     {
         RegisterObject(PickupRepresentation);
-        
+
         this->initialize();
     }
-    
+
     /**
     @brief
@@ -63,8 +63,8 @@
     {
         RegisterObject(PickupRepresentation);
-        
+
         this->initialize();
     }
-    
+
     /**
     @brief
@@ -75,9 +75,9 @@
         if(this->spawnerRepresentation_ != NULL)
             this->spawnerRepresentation_->destroy();
-        
+
         if(this->pickup_ != NULL)
             PickupManager::getInstance().unregisterRepresentation(this->pickup_->getPickupIdentifier(), this);
     }
-    
+
     /**
     @brief
@@ -91,5 +91,5 @@
         this->inventoryRepresentation_ = "Default";
     }
-    
+
     /**
     @brief
@@ -99,5 +99,5 @@
     {
         SUPER(PickupRepresentation, XMLPort, xmlelement, mode);
-        
+
         XMLPortParam(PickupRepresentation, "pickupName", setPickupName, getPickupName, xmlelement, mode);
         XMLPortParam(PickupRepresentation, "pickupDescription", setPickupDescription, getPickupDescription, xmlelement, mode);
@@ -106,13 +106,13 @@
         XMLPortObject(PickupRepresentation, Pickupable, "pickup", setPickup, getPickup, xmlelement, mode);
         XMLPortObject(PickupRepresentation, StaticEntity, "spawner-representation", setSpawnerRepresentation, getSpawnerRepresentationIndex, xmlelement, mode);
-        
+
         PickupManager::getInstance().registerRepresentation(this->pickup_->getPickupIdentifier(), this); //!< Registers the PickupRepresentation with the PickupManager through the PickupIdentifier of the Pickupable it represents.
-        
+
         if(this->spawnerRepresentation_ != NULL)
             this->spawnerRepresentation_->setVisible(false);
-        
+
         COUT(4) << "PickupRepresentation created: name: '" << this->name_ << "', description: '" << this->description_ << "', spawnerTemplate: '" << this->spawnerTemplate_ << "'." << std::endl;
     }
-    
+
     /**
     @brief
@@ -136,14 +136,14 @@
             this->addTemplate(this->spawnerTemplate_);
         }
-        
+
         StaticEntity* representation = this->spawnerRepresentation_;
         representation->setVisible(true);
-        
+
         this->addTemplate(this->spawnerTemplate_);
         this->spawnerRepresentation_->setVisible(false);
-        
+
         return representation;
     }
-    
+
     /**
     @brief
@@ -171,4 +171,4 @@
         return representation;
     }
-    
+
 }
Index: code/trunk/src/modules/pickup/PickupRepresentation.h
===================================================================
--- code/trunk/src/modules/pickup/PickupRepresentation.h	(revision 6906)
+++ code/trunk/src/modules/pickup/PickupRepresentation.h	(revision 7163)
@@ -56,12 +56,12 @@
         : public BaseObject
     { // tolua_export
-        
+
         public:
             PickupRepresentation(); //!< Constructor
             PickupRepresentation(BaseObject* creator); //!< Default constructor.
             virtual ~PickupRepresentation(); //!< Destructor.
-            
+
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-            
+
             /**
             @brief Set the name of the Pickupable represented by this PickupRepresentation.
@@ -102,5 +102,5 @@
             inline void setPickup(Pickupable* pickup)
                 { this->pickup_ = pickup; }
-                
+
             /**
             @brief Get the name of the Pickupable represented by this PickupRepresentation.
@@ -138,22 +138,22 @@
             inline const Pickupable* getPickup(unsigned int index)
                 { if(index == 0) return this->pickup_; return NULL; }
-                
+
             StaticEntity* getSpawnerRepresentation(PickupSpawner* spawner); //!< Get a spawnerRepresentation for a specific PickupSpawner.
-        
+
         private:
             void initialize(void); //!< Initializes the member variables of this PickupRepresentation.
             StaticEntity* getDefaultSpawnerRepresentation(PickupSpawner* spawner); //!< Get the default spawnerRepresentation for a specific PickupSpawner.
-            
+
             std::string name_; //!< The name of the Pickupable represented by this PickupRepresentation.
             std::string description_; //!< The description of the Pickupable represented by this PickupRepresentation.
             std::string spawnerTemplate_; //!<  The name of the template of this PickupRepresentation.
             StaticEntity* spawnerRepresentation_; //!< The spawnerRepresentation of this PickupRepresentation.
-            std::string inventoryRepresentation_; //!< The name of an image representing the pickup in the PickupInventory. TODO: Exact format and placement of image?
-            
+            std::string inventoryRepresentation_; //!< The name of an image representing the pickup in the PickupInventory.
+
             Pickupable* pickup_; //!< The Pickupable that is represented by this PickupRepresentation.
-            
+
     }; // tolua_export
 
 } // tolua_export
-    
+
 #endif // _PickupRepresentation_H__
Index: code/trunk/src/modules/pickup/PickupSpawner.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupSpawner.cc	(revision 6906)
+++ code/trunk/src/modules/pickup/PickupSpawner.cc	(revision 7163)
@@ -55,5 +55,5 @@
     {
         RegisterObject(PickupSpawner);
-        
+
         this->initialize();
     }
@@ -76,7 +76,7 @@
     {
         RegisterObject(PickupSpawner);
-        
+
         this->initialize();
-  
+
         this->pickup_ = pickup;
 
@@ -84,5 +84,5 @@
         this->respawnTime_ = respawnTime;
         this->setMaxSpawnedItems(maxSpawnedItems);
-        
+
         if(this->pickup_ == NULL)
         {
@@ -107,4 +107,5 @@
         this->maxSpawnedItems_ = INF;
         this->spawnsRemaining_ = INF;
+        this->selfDestruct_ = false;
     }
 
@@ -115,5 +116,5 @@
     PickupSpawner::~PickupSpawner()
     {
-        if(this->pickup_ != NULL)
+        if(this->selfDestruct_ && this->pickup_ != NULL)
             this->pickup_->destroy();
     }
@@ -132,9 +133,9 @@
 
         XMLPortObject(PickupSpawner, Pickupable, "pickup", setPickupable, getPickupable, xmlelement, mode);
-        
+
         XMLPortParam(PickupSpawner, "triggerDistance", setTriggerDistance, getTriggerDistance, xmlelement, mode);
         XMLPortParam(PickupSpawner, "respawnTime", setRespawnTime, getRespawnTime, xmlelement, mode);
         XMLPortParam(PickupSpawner, "maxSpawnedItems", setMaxSpawnedItems, getMaxSpawnedItems, xmlelement, mode);
-        
+
         if(this->pickup_ == NULL)
         {
@@ -150,5 +151,5 @@
         }
     }
-    
+
     /**
     @brief
@@ -161,5 +162,5 @@
         this->setVisible(this->isActive());
     }
-     
+
     /**
     @brief
@@ -172,8 +173,10 @@
     {
         SUPER(PickupSpawner, tick, dt);
-        
+
         //! If the PickupSpawner is active.
         if (this->isActive())
         {
+            SmartPtr<PickupSpawner> temp = this; //Create a smart pointer to keep the PickupSpawner alive until we iterated through all Pawns (in case a Pawn takes the last pickup)
+
             //! Iterate trough all Pawns.
             for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
@@ -189,5 +192,5 @@
         }
     }
-    
+
     /**
     @brief
@@ -201,5 +204,5 @@
         this->spawnsRemaining_ = items;
     }
-    
+
     /**
     @brief
@@ -223,10 +226,10 @@
         else
         {
-            COUT(3) << "PickupSpawner empty, selfdestruct initialized." << std::endl;
+            COUT(4) << "PickupSpawner (&" << this << ") empty, selfdestruct initialized." << std::endl;
             this->setActive(false);
             this->destroy();
         }
     }
-    
+
     /**
     @brief
@@ -237,5 +240,5 @@
         this->respawnTimer_.setTimer(this->respawnTime_, false, createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback, this)));
     }
-    
+
     /**
     @brief
@@ -248,16 +251,16 @@
         if(this->pickup_ != NULL)
         {
-            COUT(1) << "In PickupSpawner: setPickupable called, with this->pickup_ already set." << std::endl;
+            COUT(1) << "In PickupSpawner (&" << this << "): setPickupable called, with this->pickup_ already set." << std::endl;
             return;
         }
         if(pickup == NULL)
         {
-            COUT(1) << "In PickupSpawner: Argument of setPickupable is NULL." << std::endl;
+            COUT(1) << "In PickupSpawner (&" << this << "): Argument of setPickupable is NULL." << std::endl;
             return;
         }
-        
+
         this->pickup_ = pickup;
     }
-    
+
     /**
     @brief
@@ -282,6 +285,6 @@
         if (this->isActive()) //!< Checks whether PickupSpawner is active.
         {
-            COUT(3) << "PickupSpawner triggered and active." << std::endl;
-            
+            COUT(4) << "PickupSpawner (&" << this << ") triggered and active." << std::endl;
+
             PickupCarrier* carrier = dynamic_cast<PickupCarrier*>(pawn);
             if(carrier == NULL)
@@ -290,22 +293,21 @@
                 return;
             }
-            
+
             if(!carrier->isTarget(this->pickup_))
             {
-                COUT(4) << "PickupSpawner triggered but Pawn wasn't a target of the Pickupable." << std::endl;
+                COUT(4) << "PickupSpawner (&" << this << ") triggered but Pawn wasn't a target of the Pickupable." << std::endl;
                 return;
             }
-            
+
             PickupCarrier* target = carrier->getTarget(this->pickup_);
             Pickupable* pickup = this->getPickup();
-            
+
             if(target != NULL && pickup != NULL)
             {
-                if(target->pickup(pickup))
-                {
+                if(pickup->pickup(target))
                     this->decrementSpawnsRemaining();
-                }
                 else
                 {
+                    this->selfDestruct_ = true;
                     pickup->destroy();
                 }
@@ -314,12 +316,11 @@
             {
                 if(target == NULL)
-                    COUT(1) << "PickupSpawner: Pickupable has no target." << std::endl;
-                
+                    COUT(1) << "PickupSpawner (&" << this << "): Pickupable has no target." << std::endl;
+
                 if(pickup == NULL)
-                {
-                    COUT(1) << "PickupSpawner: getPickup produced an error, no Pickupable created." << std::endl;
-                }
+                    COUT(1) << "PickupSpawner (&" << this << "): getPickup produced an error, no Pickupable created." << std::endl;
                 else
                 {
+                    this->selfDestruct_ = true;
                     pickup->destroy();
                 }
@@ -333,5 +334,5 @@
     @return
         The Pickupable created.
-    */    
+    */
     Pickupable* PickupSpawner::getPickup(void)
     {
@@ -341,5 +342,5 @@
             return NULL;
         }
-        
+
         Pickupable* pickup = this->pickup_->clone();
         return pickup;
@@ -352,5 +353,5 @@
     void PickupSpawner::respawnTimerCallback()
     {
-        COUT(3) << "PickupSpawner reactivated." << std::endl;
+        COUT(4) << "PickupSpawner (&" << this << ") reactivated." << std::endl;
 
         this->setActive(true);
Index: code/trunk/src/modules/pickup/PickupSpawner.h
===================================================================
--- code/trunk/src/modules/pickup/PickupSpawner.h	(revision 6906)
+++ code/trunk/src/modules/pickup/PickupSpawner.h	(revision 7163)
@@ -101,17 +101,17 @@
         protected:
             void decrementSpawnsRemaining(void); //!< Decrements the number of remaining spawns.
-                        
+
             void startRespawnTimer(void);
-            
+
             virtual Pickupable* getPickup(void); //!< Creates a new Pickupable.
-            
+
             void setPickupable(Pickupable* pickup); //!< Sets a Pickupable for the PickupSpawner to spawn.
             const Pickupable* getPickupable(void); //!< Get the Pickupable that is spawned by this PickupSpawner.
-            
+
             Pickupable* pickup_; //!< The pickup to be spawned.
 
         private:
             void initialize(void);
-            
+
             void trigger(Pawn* pawn); //!< Method called when a Pawn is close enough.
             void respawnTimerCallback(); //!< Method called when the timer runs out.
@@ -125,4 +125,6 @@
             Timer respawnTimer_; //!< Timer used for re-activating.
 
+            bool selfDestruct_; //!< True if the PickupSpawner is selfdestructing.
+
             static const int INF = -1; //!< Constant for infinity.
     };
Index: code/trunk/src/modules/pickup/items/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/pickup/items/CMakeLists.txt	(revision 6906)
+++ code/trunk/src/modules/pickup/items/CMakeLists.txt	(revision 7163)
@@ -3,4 +3,6 @@
   InvisiblePickup.cc
   MetaPickup.cc
+  DronePickup.cc
   SpeedPickup.cc
+  ShieldPickup.cc
 )
Index: code/trunk/src/modules/pickup/items/DronePickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/DronePickup.cc	(revision 7163)
+++ code/trunk/src/modules/pickup/items/DronePickup.cc	(revision 7163)
@@ -0,0 +1,199 @@
+/*
+ *   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:
+ *      Lukas Gasser
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file DronePickup.cc
+    @brief Implementation of the DronePickup class.
+*/
+
+#include "DronePickup.h"
+#include "worldentities/Drone.h"
+#include "controllers/DroneController.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/StringUtils.h"
+
+#include "worldentities/pawns/Pawn.h"
+#include "pickup/PickupIdentifier.h"
+
+#include <sstream>
+
+namespace orxonox
+{
+
+    CreateFactory(DronePickup);
+
+    /**
+    @brief
+        Constructor. Registers the object and initializes the member variables.
+    */
+    DronePickup::DronePickup(BaseObject* creator) : Pickup(creator)
+    {
+        RegisterObject(DronePickup);
+
+        this->initialize();
+    }
+
+    /**
+    @brief
+        Destructor.
+    */
+    DronePickup::~DronePickup()
+    {
+
+    }
+
+    /**
+    @brief
+        Initializes the member variables.
+    */
+    void DronePickup::initialize(void)
+    {
+        this->addTarget(ClassIdentifier<Pawn>::getIdentifier());
+        this->setDurationTypeDirect(pickupDurationType::once);
+        this->droneTemplate_ = "";
+    }
+
+    /**
+    @brief
+        Initializes the PickupIdentifier of this pickup.
+    */
+    void DronePickup::initializeIdentifier(void)
+    {
+        std::string val = this->getDroneTemplate();
+        std::string type = "droneTemplate";
+        this->pickupIdentifier_->addParameter(type, val);
+    }
+
+    /**
+    @brief
+        Method for creating a DronePickup object through XML.
+    */
+    void DronePickup::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode)
+    {
+        SUPER(DronePickup, XMLPort, xmlelement, mode);
+        XMLPortParam(DronePickup, "droneTemplate", setDroneTemplate, getDroneTemplate, xmlelement, mode);
+
+        this->initializeIdentifier();
+    }
+
+    void DronePickup::setDroneTemplate(std::string templatename){
+        droneTemplate_ = templatename;
+    }
+
+    const std::string& DronePickup::getDroneTemplate() const
+    {
+        return droneTemplate_;
+    }
+
+    /**
+    @brief
+        Is called when the pickup has transited from used to unused or the other way around.
+    */
+    void DronePickup::changedUsed(void)
+    {
+        SUPER(DronePickup, changedUsed);
+
+        //! If the pickup is not picked up nothing must be done.
+        if(!this->isPickedUp())
+            return;
+
+        //! If the pickup has transited to used.
+        if(this->isUsed())
+        {
+
+                Pawn* pawn = this->carrierToPawnHelper();
+                if(pawn == NULL) //!< If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
+                    this->Pickupable::destroy();
+
+                //Attach to pawn
+                Drone* drone = new Drone(pawn->getCreator()); // this is neccessary because the projectiles fired need a valid creator for the particlespawner (when colliding against something)
+                drone->addTemplate(this->getDroneTemplate());
+
+                Controller* controller = drone->getController();
+                DroneController* droneController = dynamic_cast<DroneController*>(controller);
+                if(droneController != NULL)
+                {
+                    droneController->setOwner(pawn);
+                }
+
+                Vector3 spawnPosition = pawn->getWorldPosition() + Vector3(30,0,-30);
+                drone->setPosition(spawnPosition);
+
+                //! The pickup has been used up.
+                this->setUsed(false);
+        }
+        else
+        {
+            //! If either the pickup can only be used once or it is continuous and used up, it is destroyed upon setting it to unused.
+            if(this->isOnce() || (this->isContinuous() ))
+            {
+                this->Pickupable::destroy();
+            }
+        }
+    }
+
+    /**
+    @brief
+        Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
+    @return
+        A pointer to the Pawn, or NULL if the conversion failed.
+    */
+    Pawn* DronePickup::carrierToPawnHelper(void)
+    {
+        PickupCarrier* carrier = this->getCarrier();
+        Pawn* pawn = dynamic_cast<Pawn*>(carrier);
+
+        if(pawn == NULL)
+        {
+            COUT(1) << "Invalid PickupCarrier in DronePickup." << std::endl;
+        }
+
+        return pawn;
+    }
+
+    /**
+    @brief
+        Creates a duplicate of the input OrxonoxClass.
+    @param item
+        A pointer to the Orxonox class.
+    */
+    void DronePickup::clone(OrxonoxClass*& item)
+    {
+        if(item == NULL)
+            item = new DronePickup(this);
+
+        SUPER(DronePickup, clone, item);
+
+        DronePickup* pickup = dynamic_cast<DronePickup*>(item);
+        pickup->setDroneTemplate(this->getDroneTemplate());
+
+        pickup->initializeIdentifier();
+    }
+}
Index: code/trunk/src/modules/pickup/items/DronePickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/DronePickup.h	(revision 7163)
+++ code/trunk/src/modules/pickup/items/DronePickup.h	(revision 7163)
@@ -0,0 +1,79 @@
+/*
+ *   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:
+ *      Lukas Gasser
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file DronePickup.h
+    @brief Declaration of the DronePickup class.
+*/
+
+#ifndef _DronePickup_H__
+#define _DronePickup_H__
+
+#include "pickup/PickupPrereqs.h"
+
+#include <string>
+#include <worldentities/pawns/Pawn.h>
+#include <worldentities/Drone.h>
+
+#include "worldentities/StaticEntity.h"
+
+#include "pickup/Pickup.h"
+#include "tools/interfaces/Tickable.h"
+
+namespace orxonox {
+
+
+    class _PickupExport DronePickup : public Pickup, public Tickable
+    {
+        public:
+
+            DronePickup(BaseObject* creator); //!< Constructor.
+            virtual ~DronePickup(); //!< Destructor.
+
+            virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a DronePickup object through XML.
+
+            virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
+            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
+
+            void setDroneTemplate(std::string templatename);
+            const std::string& getDroneTemplate() const;
+
+        protected:
+            void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
+
+        private:
+            void initialize(void); //!< Initializes the member variables.
+            std::string droneTemplate_;
+            Pawn* carrierToPawnHelper(void); //!< Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
+
+
+
+    };
+}
+
+#endif // _DronePickup_H__
Index: code/trunk/src/modules/pickup/items/HealthPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/HealthPickup.cc	(revision 6906)
+++ code/trunk/src/modules/pickup/items/HealthPickup.cc	(revision 7163)
@@ -45,11 +45,11 @@
 namespace orxonox
 {
-    
+
     /*static*/ const std::string HealthPickup::healthTypeLimited_s = "limited";
     /*static*/ const std::string HealthPickup::healthTypeTemporary_s = "temporary";
     /*static*/ const std::string HealthPickup::healthTypePermanent_s = "permanent";
-    
+
     CreateFactory(HealthPickup);
-    
+
     /**
     @brief
@@ -59,8 +59,8 @@
     {
         RegisterObject(HealthPickup);
-        
+
         this->initialize();
     }
-    
+
     /**
     @brief
@@ -69,13 +69,13 @@
     HealthPickup::~HealthPickup()
     {
-        
-    }
-    
-    /**
-    @brief 
+
+    }
+
+    /**
+    @brief
         Initializes the member variables.
     */
     void HealthPickup::initialize(void)
-    {        
+    {
         this->health_ = 0;
         this->healthRate_ = 0;
@@ -83,8 +83,8 @@
         this->maxHealthSave_ = 0;
         this->maxHealthOverwrite_ = 0;
-        
+
         this->addTarget(ClassIdentifier<Pawn>::getIdentifier());
     }
-    
+
     /**
     @brief
@@ -98,9 +98,9 @@
         std::string val1 = stream.str();
         this->pickupIdentifier_->addParameter(type1, val1);
-        
+
         std::string val2 = this->getHealthType();
         std::string type2 = "healthType";
         this->pickupIdentifier_->addParameter(type2, val2);
-        
+
         stream.clear();
         stream << this->getHealthRate();
@@ -109,5 +109,5 @@
         this->pickupIdentifier_->addParameter(type3, val3);
     }
-    
+
     /**
     @brief
@@ -117,15 +117,15 @@
     {
         SUPER(HealthPickup, XMLPort, xmlelement, mode);
-        
+
         XMLPortParam(HealthPickup, "health", setHealth, getHealth, xmlelement, mode);
         XMLPortParam(HealthPickup, "healthRate", setHealthRate, getHealthRate, xmlelement, mode);
         XMLPortParam(HealthPickup, "healthType", setHealthType, getHealthType, xmlelement, mode);
-        
+
         if(!this->isContinuous())
             this->healthRate_ = 0.0;
-        
+
         this->initializeIdentifier();
     }
-    
+
     /**
     @brief
@@ -138,11 +138,11 @@
     {
         SUPER(HealthPickup, tick, dt);
-        
+
         if(this->isContinuous() && this->isUsed())
         {
             Pawn* pawn = this->carrierToPawnHelper();
             if(pawn == NULL) //!< If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
-                this->destroy();
-            
+                this->Pickupable::destroy();
+
             //! Calculate the health that is added this tick.
             float health = dt*this->getHealthRate();
@@ -152,5 +152,5 @@
             float fullHealth = pawn->getHealth() + health;
             this->setHealth(this->getHealth()-health);
-                    
+
             switch(this->getHealthTypeDirect())
             {
@@ -173,5 +173,5 @@
                     COUT(1) << "Invalid healthType in HealthPickup." << std::endl;
             }
-            
+
             //! If all health has been transfered.
             if(this->getHealth() == 0)
@@ -181,5 +181,5 @@
         }
     }
-    
+
     /**
     @brief
@@ -189,9 +189,9 @@
     {
         SUPER(HealthPickup, changedUsed);
-        
+
         //! If the pickup is not picked up nothing must be done.
-        if(!this->isPickedUp())
+        if(!this->isPickedUp()) //TODO: Needed?
             return;
-        
+
         //! If the pickup has transited to used.
         if(this->isUsed())
@@ -201,6 +201,6 @@
                 Pawn* pawn = this->carrierToPawnHelper();
                 if(pawn == NULL) //!< If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.
-                    this->destroy();
-                
+                    this->Pickupable::destroy();
+
                 float health = 0;
                 switch(this->getHealthTypeDirect())
@@ -226,5 +226,5 @@
                         COUT(1) << "Invalid healthType in HealthPickup." << std::endl;
                 }
-                
+
                 //! The pickup has been used up.
                 this->setUsed(false);
@@ -237,12 +237,12 @@
                 PickupCarrier* carrier = this->getCarrier();
                 Pawn* pawn = dynamic_cast<Pawn*>(carrier);
-                
+
                 if(pawn == NULL)
                 {
                     COUT(1) << "Something went horribly wrong in Health Pickup. PickupCarrier is no Pawn." << std::endl;
-                    this->destroy();
+                    this->Pickupable::destroy();
                     return;
                 }
-                
+
                 if(pawn->getMaxHealth() == this->maxHealthOverwrite_)
                 {
@@ -252,13 +252,13 @@
                 }
             }
-            
+
             //! If either the pickup can only be used once or it is continuous and used up, it is destroyed upon setting it to unused.
             if(this->isOnce() || (this->isContinuous() && this->getHealth() == 0))
             {
-                this->destroy();
-            }
-        }
-    }
-    
+                this->Pickupable::destroy();
+            }
+        }
+    }
+
     /**
     @brief
@@ -271,13 +271,13 @@
         PickupCarrier* carrier = this->getCarrier();
         Pawn* pawn = dynamic_cast<Pawn*>(carrier);
-        
+
         if(pawn == NULL)
         {
             COUT(1) << "Invalid PickupCarrier in HealthPickup." << std::endl;
         }
-        
+
         return pawn;
     }
-    
+
     /**
     @brief
@@ -290,15 +290,15 @@
         if(item == NULL)
             item = new HealthPickup(this);
-        
+
         SUPER(HealthPickup, clone, item);
-        
+
         HealthPickup* pickup = dynamic_cast<HealthPickup*>(item);
         pickup->setHealth(this->getHealth());
         pickup->setHealthRate(this->getHealthRate());
         pickup->setHealthTypeDirect(this->getHealthTypeDirect());
-        
+
         pickup->initializeIdentifier();
     }
-    
+
     /**
     @brief
@@ -322,5 +322,5 @@
         }
     }
-    
+
     /**
     @brief
@@ -341,5 +341,5 @@
         }
     }
-    
+
     /**
     @brief
@@ -356,8 +356,8 @@
         else
         {
-            COUT(1) << "Invalid healthSpeed in HealthPickup." << std::endl; 
-        }
-    }
-    
+            COUT(1) << "Invalid healthSpeed in HealthPickup." << std::endl;
+        }
+    }
+
     /**
     @brief
Index: code/trunk/src/modules/pickup/items/HealthPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/HealthPickup.h	(revision 6906)
+++ code/trunk/src/modules/pickup/items/HealthPickup.h	(revision 7163)
@@ -45,5 +45,5 @@
 
 namespace orxonox {
-    
+
     //! Enum for the type of the HealthPickup
     namespace pickupHealthType
@@ -56,5 +56,5 @@
         };
     }
-    
+
     /**
     @brief
@@ -71,14 +71,14 @@
     {
         public:
-        
+
             HealthPickup(BaseObject* creator); //!< Constructor.
             virtual ~HealthPickup(); //!< Destructor.
-            
+
             virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a HealthPickup object through XML.
             virtual void tick(float dt); //!< Is called every tick.
-            
+
             virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
             virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
-            
+
             /**
             @brief Get the health that is transfered to the Pawn upon usage of this pickup.
@@ -93,13 +93,13 @@
             inline float getHealthRate(void)
                 { return this->healthRate_; }
-                
+
             /**
             @brief Get the type of HealthPickup, this pickup is.
-            @return Returns the health type as an enum. 
+            @return Returns the health type as an enum.
             */
             inline pickupHealthType::Value getHealthTypeDirect(void)
                 { return this->healthType_; }
             const std::string& getHealthType(void); //!< Get the health type of this pickup.
-            
+
         protected:
             void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
@@ -107,5 +107,5 @@
             void setHealth(float health); //!< Sets the health.
             void setHealthRate(float speed); //!< Set the rate at which health is transferred if the pickup is continuous.
-            
+
             /**
             @brief Set the health type of this pickup.
@@ -115,9 +115,9 @@
                 { this->healthType_ = type; }
             void setHealthType(std::string type); //!< Set the type of the HealthPickup.
-        
+
         private:
             void initialize(void); //!< Initializes the member variables.
             Pawn* carrierToPawnHelper(void); //!< Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
-            
+
             float health_; //!< The health that is transferred to the Pawn.
             float healthRate_; //!< The rate at which the health is transferred.
@@ -125,10 +125,10 @@
             float maxHealthOverwrite_; //!< Helper to remember with which value we overwrote the maxHealh, to detect if someone else changed it as well.
             pickupHealthType::Value healthType_; //!< The type of the HealthPickup.
-            
+
             //! Strings for the health types.
             static const std::string healthTypeLimited_s;
             static const std::string healthTypeTemporary_s;
             static const std::string healthTypePermanent_s;
-        
+
     };
 }
Index: code/trunk/src/modules/pickup/items/InvisiblePickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/InvisiblePickup.cc	(revision 6906)
+++ code/trunk/src/modules/pickup/items/InvisiblePickup.cc	(revision 7163)
@@ -34,18 +34,20 @@
 #include "InvisiblePickup.h"
 
+#include <sstream>
+#include <OgreEntity.h>
+#include <OgreAnimationState.h>
+
+#include "util/StringUtils.h"
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
-#include "util/StringUtils.h"
 
 #include "worldentities/pawns/Pawn.h"
 #include "pickup/PickupIdentifier.h"
 
-#include <sstream>
-
 namespace orxonox
 {
 
     CreateFactory(InvisiblePickup);
-    
+
     /**
     @brief
@@ -56,7 +58,7 @@
         RegisterObject(InvisiblePickup);
         //! Defines who is allowed to pick up the pickup.
-        this->initialize(); 
-    }
-    
+        this->initialize();
+    }
+
     /**
     @brief
@@ -64,8 +66,8 @@
     */
     InvisiblePickup::~InvisiblePickup()
-    {        
-    }
-    
-    
+    {
+    }
+
+
     void InvisiblePickup::initializeIdentifier(void)
     {
@@ -76,5 +78,5 @@
         this->pickupIdentifier_->addParameter(type1, val1);
     }
-    
+
     /**
     @brief
@@ -93,10 +95,10 @@
     void InvisiblePickup::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode)
     {
-        SUPER(InvisiblePickup, XMLPort, xmlelement, mode);    
+        SUPER(InvisiblePickup, XMLPort, xmlelement, mode);
         XMLPortParam(InvisiblePickup, "duration", setDuration, getDuration, xmlelement, mode);
-        
+
         this->initializeIdentifier();
     }
-    
+
     /**
     @brief
@@ -106,9 +108,9 @@
     {
         SUPER(InvisiblePickup, changedUsed);
-        
+
         //! If the pickup is not picked up nothing must be done.
         if(!this->isPickedUp())
             return;
-        
+
         if (this->isUsed())
         {
@@ -121,13 +123,15 @@
                 this->startPickupTimer(this->getDuration());
             }
+
             this->setInvisible(true);
+
         }
         else
         {
             this->setInvisible(false);
-        
+
             if(!this->getTimer()->isActive() && this->getTimer()->getRemainingTime() == this->getDuration())
             {
-                this->destroy();
+                this->Pickupable::destroy();
             }
             else
@@ -136,7 +140,7 @@
             }
         }
-        
-    }
-    
+
+    }
+
     /**
     @brief
@@ -149,5 +153,5 @@
         PickupCarrier* carrier = this->getCarrier();
         Pawn* pawn = dynamic_cast<Pawn*>(carrier);
-        
+
         if(pawn == NULL)
         {
@@ -156,5 +160,5 @@
         return pawn;
     }
-    
+
     /**
     @brief
@@ -167,12 +171,12 @@
         if(item == NULL)
             item = new InvisiblePickup(this);
-        
+
         SUPER(InvisiblePickup, clone, item);
-        
+
         InvisiblePickup* pickup = dynamic_cast<InvisiblePickup*>(item);
         pickup->setDuration(this->getDuration());
         pickup->initializeIdentifier();
     }
-    
+
     /**
     @brief
@@ -186,9 +190,21 @@
         if(pawn == NULL)
             return false;
-        
+
         pawn->setVisible(!invisibility);
+        pawn->setRadarVisibility(!invisibility);
+
+// Test to change Material at runtime!
+
+//      Ogre::MaterialPtr mat = this->mesh_.getEntity()->getSubEntity(0)->getMaterial();
+//      mat->setDiffuse(0.4, 0.3, 0.1, 0.1);
+//      mat->setAmbient(0.3, 0.7, 0.8);
+//      mat->setSpecular(0.5, 0.5, 0.5, 0.1);
+//      Ogre::SceneBlendType sbt = Ogre::SBT_ADD;
+//
+//      mat->setSceneBlending(sbt);
+
         return true;
     }
-    
+
     /**
     @brief
@@ -209,5 +225,5 @@
         }
     }
-    
+
     void InvisiblePickup::pickupTimerCallback(void)
     {
Index: code/trunk/src/modules/pickup/items/InvisiblePickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/InvisiblePickup.h	(revision 6906)
+++ code/trunk/src/modules/pickup/items/InvisiblePickup.h	(revision 7163)
@@ -38,11 +38,11 @@
 
 #include <string>
+
 #include <worldentities/pawns/Pawn.h>
 #include "worldentities/StaticEntity.h"
-
 #include "pickup/Pickup.h"
 
 namespace orxonox {
-        
+
     /**
     @brief
@@ -57,5 +57,5 @@
     {
         public:
-        
+
             InvisiblePickup(BaseObject* creator); //!< Constructor.
             virtual ~InvisiblePickup(); //!< Destructor.
@@ -63,5 +63,5 @@
             virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
             virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
-            
+
             /**
             @brief Checks whether the Pawn is invisible.
@@ -72,5 +72,5 @@
             inline float getDuration()
                 { return this->duration_; }
- 
+
         protected:
             bool setInvisible(bool invisibility); //!< Set the Pawn to be invisible or visible again.
@@ -78,5 +78,5 @@
             void initializeIdentifier(void);
             virtual void pickupTimerCallback(void); //!< Function that gets called when the timer ends.
-        
+
         private:
             void initialize(void); //!< Initializes the member variables.
Index: code/trunk/src/modules/pickup/items/MetaPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/MetaPickup.cc	(revision 6906)
+++ code/trunk/src/modules/pickup/items/MetaPickup.cc	(revision 7163)
@@ -34,4 +34,5 @@
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
+#include "worldentities/pawns/Pawn.h"
 #include "interfaces/PickupCarrier.h"
 #include "pickup/PickupIdentifier.h"
@@ -40,12 +41,14 @@
 
 namespace orxonox {
- 
+
     CreateFactory(MetaPickup);
-    
+
     //! Setting the static variables to their values.
     /*static*/ const std::string MetaPickup::metaTypeNone_s = "none";
     /*static*/ const std::string MetaPickup::metaTypeUse_s = "use";
     /*static*/ const std::string MetaPickup::metaTypeDrop_s = "drop";
-    
+    /*static*/ const std::string MetaPickup::metaTypeDestroy_s = "destroy";
+    /*static*/ const std::string MetaPickup::metaTypeDestroyCarrier_s = "destroyCarrier";
+
     /**
     @brief
@@ -55,8 +58,8 @@
     {
         RegisterObject(MetaPickup);
-        
+
         this->initialize();
     }
-    
+
     /**
     @brief
@@ -65,7 +68,7 @@
     MetaPickup::~MetaPickup()
     {
-        
-    }
-    
+
+    }
+
     /**
     @brief
@@ -75,10 +78,10 @@
     {
         this->addTarget(ClassIdentifier<PickupCarrier>::getIdentifier());
-        
+
         this->setActivationTypeDirect(pickupActivationType::immediate);
         this->setDurationTypeDirect(pickupDurationType::once);
         this->metaType_ = pickupMetaType::none;
     }
-    
+
     /**
     @brief
@@ -91,5 +94,5 @@
         this->pickupIdentifier_->addParameter(type, val);
     }
-    
+
     /**
     @brief
@@ -99,10 +102,10 @@
     {
         SUPER(MetaPickup, XMLPort, xmlelement, mode);
-        
+
         XMLPortParam(MetaPickup, "metaType", setMetaType, getMetaType, xmlelement, mode);
-        
+
         this->initializeIdentifier();
     }
-    
+
     /**
     @brief
@@ -113,5 +116,5 @@
     {
         SUPER(MetaPickup, changedUsed);
-        
+
         //! If the MetaPickup transited to used.
         if(this->isUsed())
@@ -120,6 +123,12 @@
             if(this->getMetaTypeDirect() != pickupMetaType::none && carrier != NULL)
             {
+                if(this->getMetaTypeDirect() == pickupMetaType::destroyCarrier)
+                {
+                    Pawn* pawn = orxonox_cast<Pawn*>(carrier);
+                    pawn->kill();
+                    return;
+                }
                 std::set<Pickupable*> pickups = carrier->getPickups();
-                //! Set all Pickupables carried by the PickupCarrier either to used or drop them, depending o the meta type.
+                //! Set all Pickupables carried by the PickupCarrier either to used or drop them, depending on the meta type.
                 for(std::set<Pickupable*>::iterator it = pickups.begin(); it != pickups.end(); it++)
                 {
@@ -136,13 +145,20 @@
                         if(pickup != NULL && pickup != this)
                         {
-                            carrier->drop(pickup);
+                            pickup->drop();
+                        }
+                    }
+                    if(this->getMetaTypeDirect() == pickupMetaType::destroy)
+                    {
+                        if(pickup != NULL && pickup != this)
+                        {
+                            pickup->Pickupable::destroy();
                         }
                     }
                 }
             }
-            this->destroy();
-        }
-    }
-        
+            this->Pickupable::destroy();
+        }
+    }
+
     /**
     @brief
@@ -155,13 +171,13 @@
         if(item == NULL)
             item = new MetaPickup(this);
-        
+
         SUPER(MetaPickup, clone, item);
-        
+
         MetaPickup* pickup = dynamic_cast<MetaPickup*>(item);
         pickup->setMetaTypeDirect(this->getMetaTypeDirect());
-        
+
         pickup->initializeIdentifier();
     }
-    
+
     /**
     @brief
@@ -180,9 +196,13 @@
             case pickupMetaType::drop:
                 return MetaPickup::metaTypeDrop_s;
+            case pickupMetaType::destroy:
+                return MetaPickup::metaTypeDestroy_s;
+            case pickupMetaType::destroyCarrier:
+                return MetaPickup::metaTypeDestroyCarrier_s;
             default:
                 return BLANKSTRING;
         }
     }
-    
+
     /**
     @brief
@@ -205,5 +225,15 @@
             this->setMetaTypeDirect(pickupMetaType::drop);
         }
-    }
-    
+        else if(type == MetaPickup::metaTypeDestroy_s)
+        {
+            this->setMetaTypeDirect(pickupMetaType::destroy);
+        }
+        else if(type == MetaPickup::metaTypeDestroyCarrier_s)
+        {
+            this->setMetaTypeDirect(pickupMetaType::destroyCarrier);
+        }
+        else
+            COUT(2) << "Invalid metaType '" << type << "' in MetaPickup." << std::endl;
+    }
+
 }
Index: code/trunk/src/modules/pickup/items/MetaPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/MetaPickup.h	(revision 6906)
+++ code/trunk/src/modules/pickup/items/MetaPickup.h	(revision 7163)
@@ -48,11 +48,17 @@
             none,
             use,
-            drop
+            drop,
+            destroy,
+            destroyCarrier
         };
     }
-    
+
     /**
     @brief
-        The MetaPickup is a pickup that can, depending on the parameters, either drop all pickups of the PickupCarrier that picks it up, or use all the unused pickups of the PickupCarrier, that picks it up. The parameter to set for this is the metaType and it can be used with the values 'none', 'drop' and 'use'.
+        The MetaPickup is a pickup that can, depending on the parameter 'metaType', do different things. If the 'metaType' is set to
+        1) 'use', all the pickups, the PickupCarrier has, are immediately set to used upon pickup of the MetaPickup.
+        2) 'drop', all the pickups, the PickupCarrier has, are immediately dropped upon pickup of the MetaPickup.
+        3) 'destroy', all the pickups, the PickupCarrier has, are immediately destroyed upon pickup of the MetaPickup.
+        4) 'destroyCarrier', the PickupCarrier is immediately destroyed upon pickup of the MetaPickup.
     @author
         Damian 'Mozork' Frick
@@ -60,14 +66,14 @@
     class _PickupExport MetaPickup : public Pickup
     {
-        
+
         public:
             MetaPickup(BaseObject* creator); //!< Constructor. Registers and initializes the object.
             virtual ~MetaPickup(); //!< Destructor.
-            
+
             virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a MetaPickup object through XML.
-            
+
             virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
             virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
-            
+
             /**
             @brief Returns the meta type of the MetaPickup.
@@ -77,8 +83,8 @@
                 { return this->metaType_; }
             const std::string& getMetaType(void); //!< Get the meta type of this MetaPickup.
-            
+
         protected:
             void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
-            
+
             /**
             @brief Set the meta type of the MetaPickup.
@@ -88,16 +94,18 @@
                 { this->metaType_ =  type; }
             void setMetaType(const std::string& type); //!< Set the meta type of this MetaPickup.
-            
+
         private:
             void initialize(void); //!< Initializes the member variables.
-            
+
             pickupMetaType::Value metaType_; //!< The meta type of the MetaPickup, determines which actions are taken.
-            
+
             //! Static strings for the meta types.
             static const std::string metaTypeNone_s;
             static const std::string metaTypeUse_s;
             static const std::string metaTypeDrop_s;
-            
-        
+            static const std::string metaTypeDestroy_s;
+            static const std::string metaTypeDestroyCarrier_s;
+
+
     };
 
Index: code/trunk/src/modules/pickup/items/ShieldPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/ShieldPickup.cc	(revision 7163)
+++ code/trunk/src/modules/pickup/items/ShieldPickup.cc	(revision 7163)
@@ -0,0 +1,274 @@
+/*
+ *   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:
+ *      Eric Beier
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file ShieldPickup.cc
+    @brief Implementation of the ShieldPickup class.
+*/
+
+#include "ShieldPickup.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/StringUtils.h"
+
+#include "worldentities/pawns/SpaceShip.h"
+#include "items/Engine.h"
+#include "pickup/PickupIdentifier.h"
+
+#include <sstream>
+
+
+namespace orxonox
+{
+    CreateFactory(ShieldPickup);
+
+    /**
+    @brief
+        Constructor. Registers the object and initializes the member variables.
+    */
+    ShieldPickup::ShieldPickup(BaseObject* creator) : Pickup(creator)
+    {
+        RegisterObject(ShieldPickup);
+
+        this->initialize();
+    }
+
+    /**
+    @brief
+        Destructor.
+    */
+    ShieldPickup::~ShieldPickup()
+    {
+
+    }
+
+    /**
+    @brief
+    Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
+    @return
+    A pointer to the Pawn, or NULL if the conversion failed.
+    */
+    Pawn* ShieldPickup::carrierToPawnHelper(void)
+    {
+        PickupCarrier* carrier = this->getCarrier();
+        Pawn* pawn = dynamic_cast<Pawn*>(carrier);
+
+        if(pawn == NULL)
+        {
+            COUT(1) << "Invalid PickupCarrier in ShieldPickup." << std::endl;
+        }
+        return pawn;
+    }
+
+    /**
+    @brief
+        Initializes the member variables.
+    */
+    void ShieldPickup::initialize(void)
+    {
+        this->duration_ = 0.0f;
+        this->shieldAbsorption_ = 0.0f;
+        this->shieldHealth_ = 0.0f;
+
+        this->addTarget(ClassIdentifier<Pawn>::getIdentifier());
+    }
+
+    /**
+    @brief
+        Initializes the PickupIdentifier of this pickup.
+    */
+    void ShieldPickup::initializeIdentifier(void)
+    {
+        std::stringstream stream;
+        stream << this->getDuration();
+        std::string type1 = "duration";
+        std::string val1 = stream.str();
+        this->pickupIdentifier_->addParameter(type1, val1);
+
+        stream.clear();
+        stream << this->getShieldHealth();
+        std::string type2 = "ShieldHealth";
+        std::string val2 = stream.str();
+        this->pickupIdentifier_->addParameter(type2, val2);
+
+        stream.clear();
+        stream << this->getShieldAbsorption();
+        std::string type3 = "ShieldAbsorption";
+        std::string val3 = stream.str();
+        this->pickupIdentifier_->addParameter(type3, val3);
+
+    }
+
+    /**
+    @brief
+        Method for creating a ShieldPickup object through XML.
+    */
+    void ShieldPickup::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode)
+    {
+        SUPER(ShieldPickup, XMLPort, xmlelement, mode);
+
+        XMLPortParam(ShieldPickup, "duration", setDuration, getDuration, xmlelement, mode);
+        XMLPortParam(ShieldPickup, "shieldhealth", setShieldHealth, getShieldHealth, xmlelement, mode);
+        XMLPortParam(ShieldPickup, "shieldabsorption", setShieldAbsorption, getShieldAbsorption, xmlelement, mode);
+
+        this->initializeIdentifier();
+    }
+
+    /**
+    @brief
+        Is called when the pickup has transited from used to unused or the other way around.
+    */
+    void ShieldPickup::changedUsed(void)
+    {
+        SUPER(ShieldPickup, changedUsed);
+
+        //! If the pickup is not picked up nothing must be done.
+        if(!this->isPickedUp())
+            return;
+
+        Pawn* pawn = this->carrierToPawnHelper();
+        if(pawn == NULL)
+            this->Pickupable::destroy();
+
+        //! If the pickup has transited to used.
+        if(this->isUsed())
+        {
+            if(!this->getTimer()->isActive() && this->getTimer()->getRemainingTime() > 0.0f)
+            {
+                this->getTimer()->unpauseTimer();
+            }
+            else
+            {
+                this->startPickupTimer(this->getDuration());
+            }
+            pawn->setShieldAbsorption(this->getShieldAbsorption());
+            pawn->setShieldHealth(this->getShieldHealth());
+        }
+        else
+        {
+            pawn->setShieldAbsorption(0.0f);
+            this->setShieldHealth(pawn->getShieldHealth());
+            pawn->setShieldHealth(0.0f);
+
+            if(this->isOnce())
+            {
+                if(!this->getTimer()->isActive() && this->getTimer()->getRemainingTime() == this->getDuration())
+                {
+                    this->Pickupable::destroy();
+                }
+                else
+                {
+                    this->getTimer()->pauseTimer();
+                }
+            }
+        }
+    }
+
+    /**
+    @brief
+        Creates a duplicate of the input OrxonoxClass.
+    @param item
+        A pointer to the Orxonox class.
+    */
+    void ShieldPickup::clone(OrxonoxClass*& item)
+    {
+        if(item == NULL)
+            item = new ShieldPickup(this);
+
+        SUPER(ShieldPickup, clone, item);
+
+        ShieldPickup* pickup = dynamic_cast<ShieldPickup*>(item);
+        pickup->setDuration(this->getDuration());
+        pickup->setShieldAbsorption(this->getShieldAbsorption());
+        pickup->setShieldHealth(this->getShieldHealth());
+        pickup->initializeIdentifier();
+    }
+
+    /**
+    @brief
+    Sets the percentage the shield absorbs of the dealt damage.
+    @param shieldAbsorption
+    The shieldAbsorption. Has to be between 0 and 1
+    */
+    void ShieldPickup::setShieldAbsorption(float shieldAbsorption)
+    {
+        if (shieldAbsorption>=0 && shieldAbsorption<=1)
+        {
+            this->shieldAbsorption_=shieldAbsorption;
+        }
+        else
+        {
+            COUT(1) << "Invalid Absorption in ShieldPickup." << std::endl;
+            this->shieldAbsorption_=0;
+        }
+    }
+
+    /**
+    @brief
+    Sets the health of the shield.
+    @param shieldHealth
+    The shieldHealth
+    */
+    void ShieldPickup::setShieldHealth(float shieldHealth)
+    {
+        if (shieldHealth>=0)
+        {
+            this->shieldHealth_=shieldHealth;
+        }
+        else
+        {
+            COUT(1) << "Invalid Shieldhealth in ShieldPickup." << std::endl;
+            this->shieldHealth_=0;
+        }
+    }
+
+    /**
+    @brief
+        Sets the duration.
+    @param duration
+        The duration
+    */
+    void ShieldPickup::setDuration(float duration)
+    {
+        if(duration >= 0.0f)
+        {
+            this->duration_ = duration;
+        }
+        else
+        {
+            COUT(1) << "Invalid duration in ShieldPickup." << std::endl;
+            this->duration_ = 0.0f;
+        }
+    }
+
+    void ShieldPickup::pickupTimerCallback(void)
+    {
+        this->setUsed(false);
+    }
+}
Index: code/trunk/src/modules/pickup/items/ShieldPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/ShieldPickup.h	(revision 7163)
+++ code/trunk/src/modules/pickup/items/ShieldPickup.h	(revision 7163)
@@ -0,0 +1,99 @@
+
+/*
+ *   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:
+ *      Eric Beier
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file ShieldPickup.h
+    @brief Declaration of the ShieldPickup class.
+*/
+
+#ifndef _ShieldPickup_H__
+#define _ShieldPickup_H__
+
+#include "pickup/PickupPrereqs.h"
+
+#include <string>
+#include "worldentities/pawns/Pawn.h"
+#include "worldentities/StaticEntity.h"
+
+#include "pickup/Pickup.h"
+
+namespace orxonox {
+
+    /**
+    @brief
+        A Pickup which can add a Shield to the Pawn.
+
+        1) The percentage: The percentage the shield takes from the damage dealt to a Pawn
+        2) The hit points: The amount of damage points a shield can teake before collapsing
+        3) The activation type: 'immediate' or 'onUse'. defines if the item is used when it's picked up or only after the player chooses to use it.
+        4) The duration: the activation time of the pickup.
+
+    @author
+        Eric Beier
+    */
+    class _PickupExport ShieldPickup : public Pickup
+    {
+        public:
+
+            ShieldPickup(BaseObject* creator); //!< Constructor.
+            virtual ~ShieldPickup(); //!< Destructor.
+
+            virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a HealthPickup object through XML.
+
+            virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
+            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
+
+            inline float getDuration(void)
+                { return this->duration_; }
+            inline float getShieldHealth()
+                { return this->shieldHealth_; }
+            inline float getShieldAbsorption()
+                { return this->shieldAbsorption_; }
+
+        protected:
+            void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
+
+            virtual void pickupTimerCallback(void); //!< Function that gets called when timer ends.
+
+            void setDuration(float duration);
+            void setShieldHealth(float shieldHealth);
+            void setShieldAbsorption(float shieldAbsorption);
+
+        private:
+            void initialize(void); //!< Initializes the member variables.
+            Pawn* carrierToPawnHelper(void); //!< Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
+
+            float duration_; //!< The health that is transferred to the Pawn.
+            float shieldHealth_;
+            float shieldAbsorption_; // Has to be between 0 and 1
+
+    };
+}
+
+#endif // _ShieldPickup_H__
Index: code/trunk/src/modules/pickup/items/SpeedPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/SpeedPickup.cc	(revision 6906)
+++ code/trunk/src/modules/pickup/items/SpeedPickup.cc	(revision 7163)
@@ -136,6 +136,6 @@
         Engine* engine = this->carrierToEngineHelper();
         if(engine == NULL) //!< If the PickupCarrier is no Engine, then this pickup is useless and therefore is destroyed.
-            this->destroy();
-        
+            this->Pickupable::destroy();
+
         //! If the pickup has transited to used.
         if(this->isUsed())
@@ -156,10 +156,10 @@
             engine->setSpeedAdd(0.0f);
             engine->setSpeedMultiply(1.0f);
-            
+
             if(this->isOnce())
             {
                 if(!this->getTimer()->isActive() && this->getTimer()->getRemainingTime() == this->getDuration())
                 {
-                    this->destroy();
+                    this->Pickupable::destroy();
                 }
                 else
@@ -186,5 +186,5 @@
             COUT(1) << "Invalid PickupCarrier in SpeedPickup." << std::endl;
         }
-        
+
         return engine;
     }
@@ -269,5 +269,5 @@
 
     void SpeedPickup::pickupTimerCallback(void)
-    {       
+    {
         this->setUsed(false);
     }
Index: code/trunk/src/modules/pickup/items/SpeedPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/SpeedPickup.h	(revision 6906)
+++ code/trunk/src/modules/pickup/items/SpeedPickup.h	(revision 7163)
@@ -78,5 +78,5 @@
         protected:
             void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
-            
+
             virtual void pickupTimerCallback(void); //!< Function that gets called when timer ends.
 
Index: code/trunk/src/modules/pong/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/pong/CMakeLists.txt	(revision 6906)
+++ code/trunk/src/modules/pong/CMakeLists.txt	(revision 7163)
@@ -14,6 +14,4 @@
   MODULE
   FIND_HEADER_FILES
-  DEFINE_SYMBOL
-    "PONG_SHARED_BUILD"
   LINK_LIBRARIES
     orxonox
Index: code/trunk/src/modules/pong/PongBall.h
===================================================================
--- code/trunk/src/modules/pong/PongBall.h	(revision 6906)
+++ code/trunk/src/modules/pong/PongBall.h	(revision 7163)
@@ -45,6 +45,4 @@
             virtual void tick(float dt);
 
-            void registerVariables();
-
             void setFieldDimension(float width, float height)
                 { this->fieldWidth_ = width; this->fieldHeight_ = height; }
@@ -74,4 +72,6 @@
 
         private:
+            void registerVariables();
+
             float fieldWidth_;
             float fieldHeight_;
Index: code/trunk/src/modules/pong/PongBat.h
===================================================================
--- code/trunk/src/modules/pong/PongBat.h	(revision 6906)
+++ code/trunk/src/modules/pong/PongBat.h	(revision 7163)
@@ -41,5 +41,4 @@
             virtual ~PongBat() {}
 
-            void registerVariables();
             virtual void tick(float dt);
 
@@ -65,4 +64,6 @@
 
         private:
+            void registerVariables();
+
             float movement_;
             bool bMoveLocal_;
Index: code/trunk/src/modules/pong/PongPrereqs.h
===================================================================
--- code/trunk/src/modules/pong/PongPrereqs.h	(revision 6906)
+++ code/trunk/src/modules/pong/PongPrereqs.h	(revision 7163)
@@ -43,5 +43,5 @@
 //-----------------------------------------------------------------------
 
-#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD)
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(PONG_STATIC_BUILD)
 #  ifdef PONG_SHARED_BUILD
 #    define _PongExport __declspec(dllexport)
Index: code/trunk/src/modules/questsystem/AddQuest.cc
===================================================================
--- code/trunk/src/modules/questsystem/AddQuest.cc	(revision 6906)
+++ code/trunk/src/modules/questsystem/AddQuest.cc	(revision 7163)
@@ -68,5 +68,5 @@
         SUPER(AddQuest, XMLPort, xmlelement, mode);
 
-        COUT(3) << "New AddQuest, with target Quest {" << this->getQuestId() << "}, created." << std::endl;
+        COUT(4) << "New AddQuest, with target Quest {" << this->getQuestId() << "}, created." << std::endl;
     }
 
@@ -87,5 +87,5 @@
         }
 
-        COUT(3) << "AddQuest on player: " << player << " ." << std::endl;
+        COUT(5) << "AddQuest on player: " << player << " ." << std::endl;
 
         try
@@ -103,5 +103,5 @@
         }
 
-        COUT(3) << "Quest {" << this->getQuestId() << "} successfully added to player: " << player << " ." << std::endl;
+        COUT(4) << "Quest {" << this->getQuestId() << "} successfully added to player: " << player << " ." << std::endl;
         return true;
     }
Index: code/trunk/src/modules/questsystem/AddQuestHint.cc
===================================================================
--- code/trunk/src/modules/questsystem/AddQuestHint.cc	(revision 6906)
+++ code/trunk/src/modules/questsystem/AddQuestHint.cc	(revision 7163)
@@ -72,5 +72,5 @@
         XMLPortParam(AddQuestHint, "hintId", setHintId, getHintId, xmlelement, mode);
 
-        COUT(3) << "New AddQuestHint, with target QuestHint {" << this->getHintId() << "}, created." << std::endl;
+        COUT(4) << "New AddQuestHint, with target QuestHint {" << this->getHintId() << "}, created." << std::endl;
     }
 
@@ -85,5 +85,5 @@
     bool AddQuestHint::setHintId(const std::string & id)
     {
-        if(!QuestItem::isId(id))
+        if(id.compare(BLANKSTRING) == 0)
         {
             COUT(2) << "Invalid id. QuestItem id {" << id << "} could not be set." << std::endl;
@@ -111,5 +111,5 @@
         }
 
-        COUT(3) << "AddQuestHint on player: " << player << " ." << std::endl;
+        COUT(5) << "AddQuestHint on player: " << player << " ." << std::endl;
 
         try
@@ -127,5 +127,5 @@
         }
 
-        COUT(3) << "QuestHint {" << this->getHintId() << "} successfully added to player: " << player << " ." << std::endl;
+        COUT(4) << "QuestHint {" << this->getHintId() << "} successfully added to player: " << player << " ." << std::endl;
         return true;
 
Index: code/trunk/src/modules/questsystem/AddReward.cc
===================================================================
--- code/trunk/src/modules/questsystem/AddReward.cc	(revision 6906)
+++ code/trunk/src/modules/questsystem/AddReward.cc	(revision 7163)
@@ -68,5 +68,5 @@
         XMLPortObject(AddReward, Rewardable, "", addRewardable, getRewardables, xmlelement, mode);
 
-        COUT(3) << "New AddReward, with " << this->rewards_.size() << " Rewardables created." << std::endl;
+        COUT(4) << "New AddReward, with " << this->rewards_.size() << " Rewardables created." << std::endl;
     }
 
@@ -103,5 +103,5 @@
     bool AddReward::invoke(PlayerInfo* player)
     {
-        COUT(3) << "AddReward on player: " << player << " ." << std::endl;
+        COUT(5) << "AddReward on player: " << player << " ." << std::endl;
 
         bool check = true;
@@ -111,5 +111,5 @@
         }
 
-        COUT(3) << "Rewardable successfully added to player." << player << " ." << std::endl;
+        COUT(4) << "Rewardable successfully added to player." << player << " ." << std::endl;
 
         return check;
Index: code/trunk/src/modules/questsystem/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/questsystem/CMakeLists.txt	(revision 6906)
+++ code/trunk/src/modules/questsystem/CMakeLists.txt	(revision 7163)
@@ -12,6 +12,4 @@
   QuestEffect.cc
   QuestEffectBeacon.cc
-  QuestGUINode.cc
-  QuestGUI.cc
   QuestHint.cc
   QuestItem.cc
@@ -28,6 +26,7 @@
   TOLUA_FILES
     QuestManager.h
-  DEFINE_SYMBOL
-    "QUESTSYSTEM_SHARED_BUILD"
+    QuestDescription.h
+    Quest.h
+    QuestHint.h
   PCH_FILE
     QuestsystemPrecompiledHeaders.h
Index: code/trunk/src/modules/questsystem/ChangeQuestStatus.cc
===================================================================
--- code/trunk/src/modules/questsystem/ChangeQuestStatus.cc	(revision 6906)
+++ code/trunk/src/modules/questsystem/ChangeQuestStatus.cc	(revision 7163)
@@ -78,5 +78,5 @@
     bool ChangeQuestStatus::setQuestId(const std::string & id)
     {
-        if(!QuestItem::isId(id))
+        if(id.compare(BLANKSTRING) == 0)
         {
             COUT(2) << "Invalid id. QuestItem id {" << id << "} could not be set." << std::endl;
Index: code/trunk/src/modules/questsystem/CompleteQuest.cc
===================================================================
--- code/trunk/src/modules/questsystem/CompleteQuest.cc	(revision 6906)
+++ code/trunk/src/modules/questsystem/CompleteQuest.cc	(revision 7163)
@@ -68,5 +68,5 @@
         SUPER(CompleteQuest, XMLPort, xmlelement, mode);
 
-        COUT(3) << "New CompleteQuest, with target Quest {" << this->getQuestId() << "}, created." << std::endl;
+        COUT(4) << "New CompleteQuest, with target Quest {" << this->getQuestId() << "}, created." << std::endl;
     }
 
@@ -87,5 +87,5 @@
         }
 
-        COUT(3) << "CompleteQuest on player: " << player << " ." << std::endl;
+        COUT(5) << "CompleteQuest on player: " << player << " ." << std::endl;
 
         Quest* quest;
@@ -105,5 +105,5 @@
         }
 
-        COUT(3) << "Quest {" << quest->getId() << "} successfully completed by player: " << player << " ." << std::endl;
+        COUT(4) << "Quest {" << quest->getId() << "} successfully completed by player: " << player << " ." << std::endl;
         return true;
     }
Index: code/trunk/src/modules/questsystem/FailQuest.cc
===================================================================
--- code/trunk/src/modules/questsystem/FailQuest.cc	(revision 6906)
+++ code/trunk/src/modules/questsystem/FailQuest.cc	(revision 7163)
@@ -68,5 +68,5 @@
         SUPER(FailQuest, XMLPort, xmlelement, mode);
 
-        COUT(3) << "New FailQUest, with target Quest {" << this->getQuestId() << "}, created." << std::endl;
+        COUT(4) << "New FailQUest, with target Quest {" << this->getQuestId() << "}, created." << std::endl;
     }
 
@@ -87,5 +87,5 @@
         }
 
-        COUT(3) << "FailQuest on player: " << player << " ." << std::endl;
+        COUT(4) << "FailQuest on player: " << player << " ." << std::endl;
 
         Quest* quest;
@@ -104,5 +104,5 @@
         }
 
-        COUT(3) << "Quest {" << quest->getId() << "} failed by player: " << player << " ." << std::endl;
+        COUT(4) << "Quest {" << quest->getId() << "} failed by player: " << player << " ." << std::endl;
         return true;
     }
Index: code/trunk/src/modules/questsystem/GlobalQuest.cc
===================================================================
--- code/trunk/src/modules/questsystem/GlobalQuest.cc	(revision 6906)
+++ code/trunk/src/modules/questsystem/GlobalQuest.cc	(revision 7163)
@@ -70,5 +70,5 @@
         XMLPortObject(GlobalQuest, QuestEffect, "reward-effects", addRewardEffect, getRewardEffects, xmlelement, mode);
 
-        COUT(3) << "New GlobalQuest {" << this->getId() << "} created." << std::endl;
+        COUT(4) << "New GlobalQuest {" << this->getId() << "} created." << std::endl;
     }
 
@@ -253,5 +253,5 @@
         this->rewards_.push_back(effect); //!< Add the QuestEffect to the list.
 
-        COUT(3) << "Reward effect was added to Quest {" << this->getId() << "}." << std::endl;
+        COUT(4) << "Reward effect was added to Quest {" << this->getId() << "}." << std::endl;
         return true;
     }
Index: code/trunk/src/modules/questsystem/LocalQuest.cc
===================================================================
--- code/trunk/src/modules/questsystem/LocalQuest.cc	(revision 6906)
+++ code/trunk/src/modules/questsystem/LocalQuest.cc	(revision 7163)
@@ -68,5 +68,5 @@
         SUPER(LocalQuest, XMLPort, xmlelement, mode);
 
-        COUT(3) << "New LocalQuest {" << this->getId() << "} created." << std::endl;
+        COUT(4) << "New LocalQuest {" << this->getId() << "} created." << std::endl;
     }
 
Index: code/trunk/src/modules/questsystem/Quest.cc
===================================================================
--- code/trunk/src/modules/questsystem/Quest.cc	(revision 6906)
+++ code/trunk/src/modules/questsystem/Quest.cc	(revision 7163)
@@ -61,5 +61,6 @@
     Quest::~Quest()
     {
-
+        if(this->isRegistered())
+            QuestManager::getInstance().unregisterQuest(this);
     }
 
@@ -98,5 +99,5 @@
         this->parentQuest_ = quest;
 
-        COUT(3) << "Parent Quest {" << quest->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
+        COUT(4) << "Parent Quest {" << quest->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
         return true;
     }
@@ -121,5 +122,5 @@
         this->subQuests_.push_back(quest); //!< Adds the Quest to the end of the list of subquests.
 
-        COUT(3) << "Sub Quest {" << quest->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
+        COUT(4) << "Sub Quest {" << quest->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
         return true;
     }
@@ -145,5 +146,5 @@
         this->hints_.push_back(hint); //!< Adds the QuestHint to the end of the list of QuestHints.
 
-        COUT(3) << "QuestHint {" << hint->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
+        COUT(4) << "QuestHint {" << hint->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
         return true;
     }
@@ -167,5 +168,5 @@
         this->failEffects_.push_back(effect); //!< Adds the QuestEffect to the end of the list of fail QuestEffects.
 
-        COUT(3) << "A FailEffect was added to Quest {" << this->getId() << "}." << std::endl;
+        COUT(4) << "A FailEffect was added to Quest {" << this->getId() << "}." << std::endl;
         return true;
     }
@@ -189,5 +190,5 @@
         this->completeEffects_.push_back(effect); //!< Adds the QuestEffect to the end of the list of complete QuestEffects.
 
-        COUT(3) << "A CompleteEffect was added to Quest {" << this->getId() << "}." << std::endl;
+        COUT(4) << "A CompleteEffect was added to Quest {" << this->getId() << "}." << std::endl;
         return true;
     }
Index: code/trunk/src/modules/questsystem/Quest.h
===================================================================
--- code/trunk/src/modules/questsystem/Quest.h	(revision 6906)
+++ code/trunk/src/modules/questsystem/Quest.h	(revision 7163)
@@ -41,6 +41,6 @@
 #include "QuestItem.h"
 
-namespace orxonox
-{
+namespace orxonox // tolua_export
+{ // tolua_export
     namespace QuestStatus
     {
@@ -67,6 +67,7 @@
         Damian 'Mozork' Frick
     */
-    class _QuestsystemExport Quest : public QuestItem
-    {
+    class _QuestsystemExport Quest // tolua_export
+        : public QuestItem
+    { // tolua_export
         public:
             Quest(BaseObject* creator);
@@ -97,7 +98,7 @@
 
             bool isInactive(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'inactive'.
-            bool isActive(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'active'.
-            bool isFailed(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'failed'.
-            bool isCompleted(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'completed'.
+            bool isActive(const orxonox::PlayerInfo* player) const; // tolua_export //!< Returns true if the quest status for the specific player is 'active'.
+            bool isFailed(const orxonox::PlayerInfo* player) const; // tolua_export //!< Returns true if the quest status for the specific player is 'failed'.
+            bool isCompleted(const orxonox::PlayerInfo* player) const; // tolua_export //!< Returns true if the quest status for the specific player is 'completed'.
 
             bool start(PlayerInfo* player); //!< Sets a Quest to active.
@@ -151,7 +152,7 @@
             bool addCompleteEffect(QuestEffect* effect); //!< Adds an QuestEffect to the list of complete QuestEffects.
 
-    };
+    }; // tolua_export
 
-}
+} // tolua_export
 
 #endif /* _Quest_H__ */
Index: code/trunk/src/modules/questsystem/QuestDescription.cc
===================================================================
--- code/trunk/src/modules/questsystem/QuestDescription.cc	(revision 6906)
+++ code/trunk/src/modules/questsystem/QuestDescription.cc	(revision 7163)
@@ -74,5 +74,5 @@
         XMLPortParam(QuestDescription, "completeMessage", setCompleteMessage, getCompleteMessage, xmlelement, mode);
 
-        COUT(3) << "New QuestDescription with title '" << this->getTitle() << "' created." << std::endl;
+        COUT(4) << "New QuestDescription with title '" << this->getTitle() << "' created." << std::endl;
     }
 
@@ -89,5 +89,5 @@
         Make sure the messages meet the conditions.
     */
-    bool QuestDescription::notificationHelper(const std::string & item, const std::string & status) const
+    bool QuestDescription::notificationHelper(const std::string & item, const std::string & status)
     {
         std::string message;
@@ -122,5 +122,5 @@
         }
 
-        QuestNotification* notification = new QuestNotification(message);
+        QuestNotification* notification = new QuestNotification(this, message);
         notification->send();
         return true;
Index: code/trunk/src/modules/questsystem/QuestDescription.h
===================================================================
--- code/trunk/src/modules/questsystem/QuestDescription.h	(revision 6906)
+++ code/trunk/src/modules/questsystem/QuestDescription.h	(revision 7163)
@@ -83,5 +83,5 @@
             @return Returns a string containing the fail message of the QuestDescription.
             */
-            inline const std::string & getFailMessage(void) const
+            inline const std::string & getFailMessage(void)
                 { return this->failMessage_; }
 
@@ -90,5 +90,5 @@
             @return Returns a string containing the complete message of the QuestDescription.
             */
-            inline const std::string & getCompleteMessage(void) const
+            inline const std::string & getCompleteMessage(void)
                 { return this->completeMessage_; }
 
@@ -97,5 +97,5 @@
             @return Returns true if successful.
             */
-            inline bool sendAddHintNotification(void) const
+            inline bool sendAddHintNotification(void)
                 { return notificationHelper("hint", ""); }
 
@@ -104,5 +104,5 @@
             @return Returns true if successful.
             */
-            inline bool sendAddQuestNotification(void) const
+            inline bool sendAddQuestNotification(void)
                 { return notificationHelper("quest", "start"); }
 
@@ -111,5 +111,5 @@
             @return Returns true if successful.
             */
-            inline bool sendFailQuestNotification(void) const
+            inline bool sendFailQuestNotification(void)
                 { return notificationHelper("quest", "fail"); }
 
@@ -118,5 +118,5 @@
             @return Returns true if successful.
             */
-            inline bool sendCompleteQuestNotification(void) const
+            inline bool sendCompleteQuestNotification(void)
                 { return notificationHelper("quest", "complete"); }
 
@@ -127,5 +127,5 @@
             std::string completeMessage_; //!< The message displayed when the Quest is completed.
 
-            bool notificationHelper(const std::string & item, const std::string & status) const; //!< Helper for sending QuestDescriptions as Notifications.
+            bool notificationHelper(const std::string & item, const std::string & status); //!< Helper for sending QuestDescriptions as Notifications.
 
             /**
Index: code/trunk/src/modules/questsystem/QuestEffectBeacon.cc
===================================================================
--- code/trunk/src/modules/questsystem/QuestEffectBeacon.cc	(revision 6906)
+++ code/trunk/src/modules/questsystem/QuestEffectBeacon.cc	(revision 7163)
@@ -78,5 +78,5 @@
         XMLPortEventSink(QuestEffectBeacon, BaseObject, "execute", execute, xmlelement, mode); //TODO: Change BaseObject to MultiTrigger as soon as MultiTrigger is the base of all triggers.
 
-        COUT(3) << "New QuestEffectBeacon created." << std::endl;
+        COUT(4) << "New QuestEffectBeacon created." << std::endl;
     }
 
@@ -112,10 +112,10 @@
         MultiTriggerContainer* mTrigger = orxonox_cast<MultiTriggerContainer*>(trigger);
         Pawn* pawn = NULL;
-        
+
         //! If the trigger is neither a Playertrigger nor a MultiTrigger (i.e. a MultitriggerContainer) we can do anything with it.
         if(pTrigger == NULL && mTrigger == NULL)
             return false;
-        
-        // If the trigger is a PlayerTrigger.        
+
+        // If the trigger is a PlayerTrigger.
         if(pTrigger != NULL)
         {
@@ -125,5 +125,5 @@
                 pawn = pTrigger->getTriggeringPlayer();
         }
-        
+
         // If the trigger is a MultiTrigger (i.e. a MultiTriggerContainer)
         if(mTrigger != NULL)
@@ -134,5 +134,5 @@
         if(pawn == NULL)
         {
-            COUT(2) << "The QuestEffectBeacon was triggered by an entity other than a Pawn." << std::endl;
+            COUT(4) << "The QuestEffectBeacon was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << std::endl;
             return false;
         }
@@ -147,5 +147,5 @@
         }
 
-        COUT(3) << "QuestEffectBeacon executed on player: " << player << " ." << std::endl;
+        COUT(4) << "QuestEffectBeacon executed on player: " << player << " ." << std::endl;
 
         bool check = QuestEffect::invokeEffects(player, this->effects_); //!< Invoke the QuestEffects on the PlayerInfo.
@@ -249,5 +249,5 @@
         this->effects_.push_back(effect);
 
-        COUT(3) << "A QuestEffect was added to a QuestEffectBeacon." << std::endl;
+        COUT(4) << "A QuestEffect was added to a QuestEffectBeacon." << std::endl;
         return true;
     }
Index: code/trunk/src/modules/questsystem/QuestGUI.cc
===================================================================
--- code/trunk/src/modules/questsystem/QuestGUI.cc	(revision 6906)
+++ 	(revision )
@@ -1,274 +1,0 @@
-/*
- *   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:
- *      Damian 'Mozork' Frick
- *   Co-authors:
- *      ...
- *
- */
-
-#include "QuestGUI.h"
-
-#include <sstream>
-#include <CEGUIWindow.h>
-#include <CEGUIWindowManager.h>
-
-#include "core/CoreIncludes.h"
-#include "Quest.h"
-#include "QuestHint.h"
-#include "QuestItem.h"
-#include "QuestGUINode.h"
-#include "QuestManager.h"
-
-namespace orxonox {
-
-    /**
-    @brief
-        Constructor. Registers and initializes the object.
-    @param
-        The player the GUI is for.
-    */
-    QuestGUI::QuestGUI(PlayerInfo* player)
-    {
-        RegisterRootObject(QuestGUI);
-
-        this->player_ = player;
-        this->windowManager_ = CEGUI::WindowManager::getSingletonPtr(); //!< Get CEGUI WindowManager.
-        this->rootWindow_ = NULL;
-        this->root_ = new QuestGUINode(); //!< Create empty root node.
-
-        COUT(3) << "New QuestGUI created." << std::endl;
-    }
-
-    /**
-    @brief
-        Destructor.
-    */
-    QuestGUI::~QuestGUI()
-    {
-        COUT(3) << "Destroying QuestGUI..." << std::endl;
-
-        this->clear(); //!< Clearing the GUI and in the process destroying all QuestGUINodes.
-
-        //! Destroying the windows in the this->windows_ list.
-        for(std::list<CEGUI::Window*>::iterator it = this->windows_.begin(); it != this->windows_.end(); it++)
-        {
-            if(*it != NULL)
-                (*it)->destroy();
-        }
-        this->windows_.clear();
-
-        if(this->root_ != NULL)
-            this->root_->destroy();
-    }
-
-    /**
-    @brief
-        Get the root CEGUI Window of the GUI.
-    @return
-        Returns the root CEGUI Window of the GUI.
-    */
-    CEGUI::Window* QuestGUI::getGUI(void)
-    {
-        this->update(); //!< Update the GUI.
-
-        return this->rootWindow_;
-    }
-
-    /**
-    @brief
-        Update the GUI.
-    */
-    void QuestGUI::update(void)
-    {
-        COUT(3) << "Updating QuestGUI..." << std::endl;
-
-        this->clear(); //!< Clear the GUI.
-
-        int depth = 0;
-        int index = 0;
-
-        //! Create root window.
-        this->rootWindow_ = this->windowManager_->createWindow("MenuWidgets/ScrollablePane", "QuestGUI/Quests");
-        this->rootWindow_->setSize(CEGUI::UVector2(CEGUI::UDim(1, 0),CEGUI::UDim(1, 0)));
-
-        //! Iterate through all Quests.
-        std::map<std::string, Quest*> quests = QuestManager::getInstance().getQuests();
-        for(std::map<std::string, Quest*>::iterator it = quests.begin(); it != quests.end(); it++)
-        {
-            Quest* quest = it->second;
-            if(quest->getParentQuest() == NULL && !quest->isInactive(this->player_)) //!< If the Quest isn't inactive and a root Quest (meaning it has no parent.), create a Node.
-            {
-                index = createNode(this->root_, quest, depth, index);
-            }
-        }
-        COUT(3) << "Updating QuestGUI done." << std::endl;
-    }
-
-    /**
-    @brief
-        Clear the QuestGUI.
-    */
-    void QuestGUI::clear(void)
-    {
-        COUT(3) << "Clearing QuestGUI..." << std::endl;
-
-        //! Clear all nodes.
-        for(std::map<CEGUI::Window*, QuestGUINode*>::iterator it = this->nodes_.begin(); it != this->nodes_.end(); it++)
-        {
-            QuestGUINode* node = it->second;
-            if(node == NULL)
-            {
-                COUT(1) << "Node is NULL!";
-                continue;
-            }
-            std::string* str = new std::string();
-            node->getName(*str);
-            COUT(3) << "Clearing Node '" << *str << "' ..." << std::endl;
-            delete str;
-            node->destroy();
-        }
-        this->nodes_.clear();
-
-        //! Clear root window.
-        if(this->rootWindow_ != NULL)
-            this->rootWindow_->destroy();
-
-        COUT(3) << "Clearing QuestGUI done." << std::endl;
-    }
-
-    /**
-    @brief
-        Get a CEGUI Window to use.
-        Windows that are no longer used are collected with giveWindow, and are given out again with getWindow, so save some time recreating new windows everytime.
-        The retreived window is of type "MenuWidgets/TabButton".
-    @return
-        Returns a CEGUI Window of type "MenuWidgets/TabButton".
-    */
-    CEGUI::Window* QuestGUI::getWindow(void)
-    {
-        if(!this->windows_.empty()) //!< If there are windows in the list.
-        {
-            CEGUI::Window* window = this->windows_.back();
-            this->windows_.pop_back();
-            return window;
-        }
-
-        //!< Else create a new one.
-        std::ostringstream stream;
-        stream << "QuestGUI/Quests/EmptyWindows/" << this->windows_.size()+1;
-        return this->windowManager_->createWindow("MenuWidgets/TabButton", stream.str());
-    }
-
-    /**
-    @brief
-        Return a no longer needed CEGUI Window for reuse.
-    @param window
-        The CEGUI window ot be returned.
-    */
-    void QuestGUI::giveWindow(CEGUI::Window* window)
-    {
-        if(window == NULL)
-            return;
-        this->windows_.push_back(window);
-        this->rootWindow_->removeChildWindow(window); //!< Remove the window as child of the rootWindow.
-        std::ostringstream stream;
-        stream << "QuestGUI/Quests/EmptyWindows/" << this->windows_.size();
-        window->rename(stream.str());
-    }
-
-    /**
-    @brief
-        Finde the QuestGUINode belonging to the input CEGUI Window.
-    @param window
-        A pointer to a CEGUI Window.
-    @return
-        A pointer to the QuestGUI Node belonging to the input CEGUI Window.
-    */
-    /*static*/ QuestGUINode* QuestGUI::findNode(CEGUI::Window* window)
-    {
-        for(std::map<PlayerInfo*, QuestGUI*>::iterator it = QuestManager::getInstance().questGUIs_.begin(); it != QuestManager::getInstance().questGUIs_.end(); it++)
-        {
-            QuestGUI* gui = it->second;
-            std::map<CEGUI::Window*, QuestGUINode*>::iterator node = gui->nodes_.find(window);
-            if(node != gui->nodes_.end()) return node->second;
-        }
-        return NULL;
-    }
-
-    /**
-    @brief
-        Recursive method to create Nodes for all Quests an Hints the given Quest is a parent to.
-    @param parent
-        Pointer to the parent QuestGUINode.
-    @param item
-        The QuestItem the QuestGUINode is created for.
-    @param depth
-        Parameter to define how much the list item has to be indented.
-    @param index
-        "Counter" for Quests and Hints.
-    @return
-        Returns the index.
-    */
-    int QuestGUI::createNode(QuestGUINode* parent, QuestItem* item, int depth, int index)
-    {
-        QuestGUINode* node = new QuestGUINode(this, parent, item, depth, index); //!< Create a new QuestGUINode.
-
-        this->nodes_.insert(std::pair<CEGUI::Window*, QuestGUINode*>(node->getWindow(),node)); //!< Insert the node and its window in the nodes_ map.
-
-        index++;
-
-        //! Check if the QuestItem is a Quest, if not (it's a QuestHint) it just returns.
-        Quest* quest = dynamic_cast<Quest*>(item);
-        if(quest == NULL)
-          return index;
-
-        //! Iterate through all subQuests.
-        std::list<Quest*> quests = quest->getSubQuestList();
-        for(std::list<Quest*>::iterator it = quests.begin(); it != quests.end(); it++)
-        {
-            Quest* quest = *it;
-            if(!quest->isInactive(this->player_)) //!< Add node if the subQuest is not inactive.
-            {
-                index = createNode(node, quest, depth+1, index);
-            }
-        }
-
-        //! Iterate through all hints.
-        std::list<QuestHint*> hints = quest->getHintsList();
-        int tempIndex = index; //!< Preserve the index, since for the hints we start anew with index 0.
-        index = 0;
-        for(std::list<QuestHint*>::iterator it = hints.begin(); it != hints.end(); it++)
-        {
-            QuestHint* hint = *it;
-            if(hint->isActive(this->player_)) //!< Add node if the hint is active.
-            {
-                index = createNode(node, hint, depth+1, index);
-            }
-        }
-        index = tempIndex; //!< Reset the index to the original level.
-
-        return index;
-    }
-
-}
-
Index: code/trunk/src/modules/questsystem/QuestGUI.h
===================================================================
--- code/trunk/src/modules/questsystem/QuestGUI.h	(revision 6906)
+++ 	(revision )
@@ -1,109 +1,0 @@
-/*
- *   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:
- *      Damian 'Mozork' Frick
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @file
-    @brief Definition of the QuestGIU class.
-*/
-
-#ifndef _QuestGUI_H__
-#define _QuestGUI_H__
-
-#include "questsystem/QuestsystemPrereqs.h"
-
-#include <list>
-#include <map>
-#include <string>
-#include <CEGUIForwardRefs.h>
-
-#include "core/OrxonoxClass.h"
-
-namespace orxonox {
-
-    /**
-    @brief
-        Handles the GUI for the Questsystem.
-    @author
-        Damian 'Mozork' Frick
-    */
-    class _QuestsystemExport QuestGUI : public OrxonoxClass
-    {
-
-        public:
-
-            QuestGUI(PlayerInfo* player);
-            virtual ~QuestGUI();
-
-            void update(void); //!< Update the GUI.
-            CEGUI::Window* getGUI(void); //!< Get the root CEGUI Window of the GUI.
-
-            CEGUI::Window* getWindow(void); //!< Get a CEGUI Window to use.
-            void giveWindow(CEGUI::Window* window); //!< Return a no longer needed CEGUI Window for reuse.
-
-            static QuestGUINode* findNode(CEGUI::Window* window); //!< Finde the QuestGUINode belonging to the input CEGUI Window.
-
-            /**
-            @brief Retreive the CEGUI WindowManager.
-            @return Returns the CEGUI WindoWManager.
-            */
-            inline CEGUI::WindowManager* getWindowManager(void)
-                { return this->windowManager_; }
-            /**
-            @brief Retrieve the root window.
-            @return Returns the root window.
-            */
-            inline CEGUI::Window* getRootWindow(void)
-                { return this->rootWindow_; }
-            /**
-            @brief Retreive the player.
-            @return Returns the player.
-            */
-            inline PlayerInfo* getPlayer(void)
-                { return this->player_; }
-
-        private:
-
-            int createNode(QuestGUINode* parent, QuestItem* item, int depth, int index); //!< Recursive method to create Nodes for all Quests an Hints the given Quest is a parent to.
-
-            void clear(void); //!< Clear the QuestGUI.
-
-            QuestGUINode* root_; //!< An empty QuestGUINode being the parent of all otherwise parent-less nodes.
-
-            CEGUI::WindowManager* windowManager_; //!< The CEGUI WindowManager.
-            CEGUI::Window* rootWindow_; //!< The root CEGUI Window of the GUI.
-            PlayerInfo* player_; //!< The player that owns the GUI.
-
-            std::map<CEGUI::Window*, QuestGUINode*> nodes_; //!< A list of all QuestGUINodes, ordered by their respective CEGUI Windows.
-            std::list<CEGUI::Window*> windows_; //!< A list of windows to be used.
-
-    };
-
-}
-
-#endif /* _QuestGUI_H__ */
-
Index: code/trunk/src/modules/questsystem/QuestGUINode.cc
===================================================================
--- code/trunk/src/modules/questsystem/QuestGUINode.cc	(revision 6906)
+++ 	(revision )
@@ -1,399 +1,0 @@
-/*
- *   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:
- *      Damian 'Mozork' Frick
- *   Co-authors:
- *      ...
- *
- */
-
-#include "QuestGUINode.h"
-
-#include <sstream>
-
-#include <CEGUIWindowManager.h>
-#include <elements/CEGUIFrameWindow.h>
-#include <elements/CEGUIPushButton.h>
-#include <falagard/CEGUIFalWidgetLookFeel.h>
-#include <falagard/CEGUIFalWidgetLookManager.h>
-
-#include "core/CoreIncludes.h"
-#include "Quest.h"
-#include "QuestHint.h"
-#include "QuestItem.h"
-#include "QuestDescription.h"
-#include "QuestGUI.h"
-
-namespace orxonox {
-
-    /**
-    @brief
-        Default Constructor. Registers and initializes the object.
-    */
-    QuestGUINode::QuestGUINode(void)
-    {
-        this->initialize();
-    }
-
-    /**
-    @brief
-        Constructor. Registers and initializes the object.
-    @param gui
-        The QuestGUi the node beongs to.
-    @param parent
-        The parent node of the newly created node.
-    @param item
-        The QuestItem the  newly created node is for.
-    @param depth
-        Parameter to define how much the list item has to be indented.
-    @param index
-        "Counter" for Quests and Hints.
-    */
-    QuestGUINode::QuestGUINode(QuestGUI* gui, QuestGUINode* parent, QuestItem* item, int depth, int index)
-    {
-        this->initialize();
-
-        this->gui_ = gui;
-        this->parent_ = parent;
-        this->item_ = item;
-        this->depth_ = depth;
-        this->index_ = index;
-
-        this->createWindow();
-
-        COUT(3) << "New QuestGUINode '" << this->window_->getName() << "' created." << std::endl;
-    }
-
-    /**
-    @brief
-        Destructor.
-    @todo
-        Destroying everything?
-    */
-    QuestGUINode::~QuestGUINode(void)
-    {
-        if(this->window_ != NULL)
-            this->window_->destroy();
-        if(this->details_ != NULL)
-        {
-            this->details_->destroy();
-        }
-    }
-
-    /**
-    @brief
-        Initialize the object.
-    */
-    void QuestGUINode::initialize(void)
-    {
-        RegisterRootObject(QuestGUINode);
-
-        this->parent_ = NULL;
-        this->item_ = NULL;
-        this->window_ = NULL;
-        this->details_ = NULL;
-        this->depth_ = 0;
-        this->index_ = 0;
-        this->visible_ = true;
-    }
-
-    void QuestGUINode::toggleVisibility(void)
-    {
-
-    }
-
-    /**
-    @brief
-        Sets the input buffer to the name of the node.
-    @param buffer
-        The buffer that is set to the name of the node.
-    @todo
-        Needed?
-    */
-    void QuestGUINode::getName(std::string & buffer)
-    {
-        if(this->window_ != NULL)
-        {
-            buffer = this->window_->getName().c_str();
-        }
-        else
-        {
-            buffer.erase();
-        }
-    }
-
-    /**
-    @brief
-        Creates the details window.
-    @return
-        Returns the details window.
-    @todo
-        Return necessary?
-    */
-    CEGUI::Window* QuestGUINode::getDetails(void)
-    {
-
-        if(this->details_ == NULL) //!< If the details window was not already created.
-        {
-            std::ostringstream stream;
-
-            //! Create the main window for the details.
-            stream << this->window_->getName() << "/Details";
-            const QuestDescription* description = this->item_->getDescription();
-            this->details_ = this->gui_->getWindowManager()->createWindow("MenuWidgets/FrameWindow", stream.str());
-            this->details_->setSize(CEGUI::UVector2(CEGUI::UDim(0.7f, 0),CEGUI::UDim(0.7f, 0)));
-            this->details_->setPosition(CEGUI::UVector2(CEGUI::UDim(0.1f, 0),CEGUI::UDim(0.1f, 0)));
-            this->details_->setText(description->getTitle());
-            this->details_->setAlpha(1.0);
-            this->details_->setInheritsAlpha(false);
-            this->details_->setProperty("CloseButtonEnabled", "True");
-            this->details_->subscribeEvent(CEGUI::FrameWindow::EventCloseClicked, CEGUI::Event::Subscriber(&QuestGUINode::closeDetails, this));
-
-            //! Create a ScrollablePane.
-            stream << "/Scrollable";
-            CEGUI::Window* window = this->gui_->getWindowManager()->createWindow("MenuWidgets/ScrollablePane", stream.str());
-            window->setSize(CEGUI::UVector2(CEGUI::UDim(1.0, -2*QuestGUINode::BORDER_WIDTH),CEGUI::UDim(1.0, -QuestGUINode::TITLE_HEIGHT)));
-            window->setPosition(CEGUI::UVector2(CEGUI::UDim(0, (float)QuestGUINode::BORDER_WIDTH),CEGUI::UDim(0, (float)QuestGUINode::TITLE_HEIGHT)));
-            this->details_->addChildWindow(window);
-
-            int height;
-            int offset = 0;
-
-            //! Display the status of the QuestItem if it is a Quest.
-            Quest* quest = dynamic_cast<Quest*>(this->item_);
-            if(quest != NULL) //!< If the QuestItem is a Quest
-            {
-                stream.str("");
-                stream << this->details_->getName() << "/Status";
-                CEGUI::Window* statusWindow = this->gui_->getWindowManager()->createWindow("MenuWidgets/StaticText", stream.str());
-                window->addChildWindow(statusWindow);
-                std::string status;
-                if(quest->isActive(this->gui_->getPlayer()))
-                {
-                    status = "This quest is active.";
-                }
-                else if(quest->isCompleted(this->gui_->getPlayer()))
-                {
-                    status = "This quest was completed.";
-                }
-                else if(quest->isFailed(this->gui_->getPlayer()))
-                {
-                    status = "This quest was failed.";
-                }
-                statusWindow->setProperty("HorzFormatting", "WordWrapLeftAligned");
-                statusWindow->setProperty("VertFormatting", "TopAligned");
-                statusWindow->setText(status);
-                statusWindow->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0),CEGUI::UDim(0, (float)offset)));
-                statusWindow->setSize(CEGUI::UVector2(CEGUI::UDim(1.0, (float)-QuestGUINode::SCROLLBAR_WIDTH),CEGUI::UDim(1.0f, 0)));
-                height = setHeight(statusWindow);
-
-                offset += height;
-            }
-
-            //! Create title pane for the description.
-            stream.str("");
-            stream << this->details_->getName() << "/Description";
-            stream << "/Title";
-            CEGUI::Window* descriptionWindowTitle = this->gui_->getWindowManager()->createWindow("MenuWidgets/StaticText", stream.str());
-            window->addChildWindow(descriptionWindowTitle);
-            descriptionWindowTitle->setProperty("HorzFormatting", "HorzCentred");
-            descriptionWindowTitle->setProperty("VertFormatting", "TopAligned");
-            descriptionWindowTitle->setText("Description:");
-            descriptionWindowTitle->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0),CEGUI::UDim(0, (float)offset)));
-            descriptionWindowTitle->setSize(CEGUI::UVector2(CEGUI::UDim(1.0f, -QuestGUINode::SCROLLBAR_WIDTH),CEGUI::UDim(1.0f, 0)));
-
-            offset += setHeight(descriptionWindowTitle);
-
-            //! Display the Description of the QuestItem.
-            stream.str("");
-            stream << this->details_->getName() << "/Description";
-            CEGUI::Window* descriptionWindow = this->gui_->getWindowManager()->createWindow("MenuWidgets/StaticText", stream.str());
-            window->addChildWindow(descriptionWindow);
-            descriptionWindow->setProperty("HorzFormatting", "WordWrapLeftAligned");
-            descriptionWindow->setProperty("VertFormatting", "TopAligned");
-            descriptionWindow->setText(description->getDescription());
-            descriptionWindow->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0),CEGUI::UDim(0, (float)offset)));
-            descriptionWindow->setSize(CEGUI::UVector2(CEGUI::UDim(1.0, (float)-QuestGUINode::SCROLLBAR_WIDTH),CEGUI::UDim(1.0f, 0)));
-            height = setHeight(descriptionWindow);
-
-            offset += height;
-
-            //! Display a list of hints if the QuestItem is a Quest.
-            bool title = true;
-            if(quest != NULL)
-            {
-                for(std::list<QuestGUINode*>::iterator it = this->subNodes_.begin(); it != this->subNodes_.end(); it++)
-                {
-                    if(dynamic_cast<QuestHint*>((*it)->item_) != NULL) //!< If the subNode belongs to a QuestHint.
-                    {
-                        if(title) //!< If no title pane for the QuestHints has been created, create one.
-                        {
-                            stream.str("");
-                            stream << this->details_->getName() << "/Hints/Title";
-                            CEGUI::Window* hintsTitle = this->gui_->getWindowManager()->createWindow("MenuWidgets/StaticText", stream.str());
-                            window->addChildWindow(hintsTitle);
-                            hintsTitle->setProperty("HorzFormatting", "HorzCentred");
-                            hintsTitle->setProperty("VertFormatting", "TopAligned");
-                            hintsTitle->setText("Hints:");
-                            hintsTitle->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0),CEGUI::UDim(0, (float)offset)));
-                            hintsTitle->setSize(CEGUI::UVector2(CEGUI::UDim(1.0, -QuestGUINode::SCROLLBAR_WIDTH),CEGUI::UDim(1.0, 0)));
-                            offset += setHeight(hintsTitle);;
-                            title = false;
-                        }
-                        QuestGUINode* node = *it;
-                        node->window_->setSize(CEGUI::UVector2(CEGUI::UDim(1.0f, (float)-QuestGUINode::SCROLLBAR_WIDTH),CEGUI::UDim(0, (float)QuestGUINode::BUTTON_HEIGHT)));
-                        node->window_->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0),CEGUI::UDim(0, (float)offset)));
-                        window->addChildWindow(node->window_);
-                        offset += QuestGUINode::BUTTON_HEIGHT;
-                    }
-                }
-            }
-
-            COUT(3) << "Show Details: " << this->details_->getName() << std::endl;
-        }
-
-        return this->details_;
-    }
-
-    /**
-    @brief
-        Opens the details window for the Quest/QuestHint clicked on.
-    */
-    bool QuestGUINode::openDetails(const CEGUI::EventArgs& e)
-    {
-        COUT(3) << "Open QuestItem..." << std::endl;
-
-        //CEGUI::Window* window = this->gui_->getRootWindow();
-        CEGUI::Window* window = this->gui_->getWindowManager()->getWindow("orxonox/QuestGUI/Background");
-
-        if(window != NULL)
-            window->addChildWindow(this->getDetails());
-
-        return true;
-    }
-
-    /**
-    @brief
-        Close the details window.
-    */
-    bool QuestGUINode::closeDetails(const CEGUI::EventArgs& e)
-    {
-        //CEGUI::Window* window = this->gui_->getRootWindow();
-        CEGUI::Window* window = this->gui_->getWindowManager()->getWindow("orxonox/QuestGUI/Background");
-        window->removeChildWindow(this->details_);
-
-        return true;
-    }
-
-    /**
-    @brief
-        Helper method for setHeight(). Gets the StaticTextArea for an input CEGUI Window.
-    @param window
-        The CEGUI window.
-    @return
-        Returns a CEGUI Rect.
-    */
-    /*static*/ CEGUI::Rect QuestGUINode::getStaticTextArea(const CEGUI::Window* window)
-    {
-        const CEGUI::WidgetLookFeel& lookAndFeel = CEGUI::WidgetLookManager::getSingleton().getWidgetLook(window->getLookNFeel());
-
-        return lookAndFeel.getNamedArea("WithFrameTextRenderArea").getArea().getPixelRect(*window);
-    }
-
-    /**
-    @brief
-        Helper method to adjust the height of an input Window (of type StaticText) to the text it holds.
-    @param window
-        The  CEGUI Window (of type StaticText) for which the height is to be adjusted to the text.
-    @return
-        Returns the set height.
-    */
-    /*static*/ int QuestGUINode::setHeight(CEGUI::Window* window)
-    {
-        //! Get the area the text is formatted and drawn into.
-        const CEGUI::Rect formattedArea = getStaticTextArea(window);
-
-        //! Calculate the pixel height of the frame by subtracting the height of the area above from the total height of the window.
-        const float frameHeight = window->getUnclippedPixelRect().getHeight() - formattedArea.getHeight();
-
-        //! Get the formatted line count - using the formatting area obtained above.
-        const float lines = (float)(window->getFont()->getFormattedLineCount(window->getText(), formattedArea, CEGUI::WordWrapLeftAligned));
-
-        //! Calculate pixel height of window, which is the number of formatted lines multiplied by the spacing of the font, plus the pixel height of the frame.
-        const float height = lines * window->getFont()->getLineSpacing() + frameHeight;
-
-        //! Set the height to the window.
-        window->setHeight(CEGUI::UDim(0, height));
-
-        //Debug
-        const CEGUI::Rect newArea = getStaticTextArea(window);
-
-        return static_cast<int>(height);
-    }
-
-    /**
-    @brief
-        Update the position list item.
-    */
-    void QuestGUINode::updatePosition(void)
-    {
-        this->window_->setPosition(CEGUI::UVector2(CEGUI::UDim(0, (float)(QuestGUINode::INDENT_WIDTH*this->depth_)),CEGUI::UDim(0, (float)(QuestGUINode::BUTTON_HEIGHT*this->index_))));
-        this->window_->setSize(CEGUI::UVector2(CEGUI::UDim(1, (float)(-QuestGUINode::INDENT_WIDTH*this->depth_-QuestGUINode::SCROLLBAR_WIDTH)),CEGUI::UDim(0, (float)QuestGUINode::BUTTON_HEIGHT)));
-    }
-
-    /**
-    @brief
-        Helper method to create the CEGUI Window the node.
-    */
-    void QuestGUINode::createWindow(void)
-    {
-        Quest* quest = dynamic_cast<Quest*>(this->item_);
-
-        this->window_ = this->gui_->getWindow();
-        std::ostringstream stream;
-        stream << "QuestGUI/Quests/";
-        if(quest == NULL)
-        {
-            stream << this->parent_->index_ << "/Hints/";
-        }
-        stream << this->index_;
-
-        this->window_->rename(stream.str());
-        this->window_->setText(this->item_->getDescription()->getTitle());
-
-        this->parent_->subNodes_.push_back(this);
-
-        if(dynamic_cast<Quest*>(this->item_) != NULL)
-        {
-            this->gui_->getRootWindow()->addChildWindow(this->window_);
-            this->updatePosition();
-        }
-        else
-        {
-            this->window_->setDestroyedByParent(false);
-        }
-
-        this->window_->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&QuestGUINode::openDetails, this));
-    }
-
-}
-
Index: code/trunk/src/modules/questsystem/QuestGUINode.h
===================================================================
--- code/trunk/src/modules/questsystem/QuestGUINode.h	(revision 6906)
+++ 	(revision )
@@ -1,98 +1,0 @@
-/*
- *   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:
- *      Damian 'Mozork' Frick
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _QuestGUINode_H__
-#define _QuestGUINode_H__
-
-#include "questsystem/QuestsystemPrereqs.h"
-
-#include <list>
-#include <string>
-#include <CEGUIForwardRefs.h>
-#include "core/OrxonoxClass.h"
-
-
-namespace orxonox {
-
-    class _QuestsystemExport QuestGUINode : public OrxonoxClass
-    {
-
-        public:
-
-            QuestGUINode(void);
-            QuestGUINode(QuestGUI* gui, QuestGUINode* parent, QuestItem* item, int depth, int index);
-            virtual ~QuestGUINode(void);
-
-            void toggleVisibility(void);
-
-            void getName(std::string & buffer); //!< Sets the input buffer to the name of the node.
-            /**
-            @brief Retreive the window of this node.
-            @return The CEGUI Window of this node.
-            */
-            inline CEGUI::Window* getWindow(void)
-                { return this->window_; }
-
-            bool openDetails(const CEGUI::EventArgs& e); //!< Opens the details window for the Quest/QuestHint clicked on.
-            bool closeDetails(const CEGUI::EventArgs& e); //!< Close the details window.
-
-        private:
-            CEGUI::Window* getDetails(void); //!< Creates the details window.
-
-            void initialize(void); //!< Initialize the object.
-            void updatePosition(void); //!< Update the position list item.
-            void createWindow(void); //!< Helper method to create the CEGUI Window the node.
-            static CEGUI::Rect getStaticTextArea(const CEGUI::Window* window); //Helper method for setHeight(). Gets the StaticTextArea for an input CEGUI Window.
-            static int setHeight(CEGUI::Window* window); //Helper method to adjust the height of an input Window (of type StaticText) to the text it holds.
-
-            bool visible_; //!< Boolean determining the visibility of the node.
-
-            QuestGUI* gui_; //!< The QuestGUI this node belongs to.
-            QuestGUINode* parent_; //!< The parent node.
-            std::list<QuestGUINode*> subNodes_; //!< A list of all subnodes.
-            QuestItem* item_; //!< QuestItem belonging to this node.
-
-            int depth_; //!< The depth (resp. indentation) of this node in the list of Quests. (Irrelevant for QuestHints)
-            int index_; //!< The index of this node in the list of Quests, resp. in the list of QuestHints, if the node belongs to a QuestHint, rather than a Quest.
-
-            CEGUI::Window* window_; //!< The list window of this node.
-            CEGUI::Window* details_; //!< The details window of this node.
-
-            //! Some magic numbers
-            static const int TITLE_HEIGHT = 26;
-            static const int BORDER_WIDTH = 5;
-            static const int SCROLLBAR_WIDTH = 13;
-            static const int BUTTON_HEIGHT = 30;
-            static const int INDENT_WIDTH = 20;
-
-    };
-
-}
-
-#endif /* _QuestGUINode_H__ */
-
Index: code/trunk/src/modules/questsystem/QuestHint.cc
===================================================================
--- code/trunk/src/modules/questsystem/QuestHint.cc	(revision 6906)
+++ code/trunk/src/modules/questsystem/QuestHint.cc	(revision 7163)
@@ -59,5 +59,6 @@
     QuestHint::~QuestHint()
     {
-
+        if(this->isRegistered())
+            QuestManager::getInstance().unregisterHint(this);
     }
 
@@ -72,5 +73,5 @@
         QuestManager::getInstance().registerHint(this); //!< Registers the QuestHint with the QuestManager.
 
-        COUT(3) << "New QuestHint {" << this->getId() << "} created." << std::endl;
+        COUT(4) << "New QuestHint {" << this->getId() << "} created." << std::endl;
     }
 
@@ -125,10 +126,10 @@
             else
             {
-                COUT(2) << "An already active questHint was trying to get activated." << std::endl;
+                COUT(4) << "An already active questHint was trying to get activated." << std::endl;
                 return false;
             }
         }
 
-        COUT(2) << "A hint of a non-active quest was trying to get activated." << std::endl;
+        COUT(4) << "A hint of a non-active quest was trying to get activated." << std::endl;
         return false;
     }
Index: code/trunk/src/modules/questsystem/QuestHint.h
===================================================================
--- code/trunk/src/modules/questsystem/QuestHint.h	(revision 6906)
+++ code/trunk/src/modules/questsystem/QuestHint.h	(revision 7163)
@@ -40,6 +40,6 @@
 #include "QuestItem.h"
 
-namespace orxonox
-{
+namespace orxonox // tolua_export
+{ // tolua_export
     namespace QuestHintStatus
     {
@@ -66,6 +66,7 @@
         Damian 'Mozork' Frick
     */
-    class _QuestsystemExport QuestHint : public QuestItem
-    {
+    class _QuestsystemExport QuestHint // tolua_export
+        : public QuestItem
+    { // tolua_export
 
         public:
@@ -91,7 +92,7 @@
             std::map<const PlayerInfo*, QuestHintStatus::Value> playerStatus_; //!< List of the states for each player, with the Player-pointer as key.
 
-    };
+    }; // tolua_export
 
-}
+} // tolua_export
 
 #endif /* _QuestHint_H__ */
Index: code/trunk/src/modules/questsystem/QuestItem.cc
===================================================================
--- code/trunk/src/modules/questsystem/QuestItem.cc	(revision 6906)
+++ code/trunk/src/modules/questsystem/QuestItem.cc	(revision 7163)
@@ -40,4 +40,7 @@
 namespace orxonox
 {
+
+    CreateUnloadableFactory(QuestItem);
+
     /**
     @brief
@@ -46,4 +49,6 @@
     QuestItem::QuestItem(BaseObject* creator) : BaseObject(creator)
     {
+        this->registered_ = false;
+
         RegisterObject(QuestItem);
     }
@@ -79,5 +84,5 @@
     void QuestItem::setId(const std::string & id)
     {
-        if(!isId(id)) //!< Checks whether the id is a valid id.
+        if(id.compare(BLANKSTRING) == 0) //!< Checks whether the id is a valid id.
         {
             COUT(2) << "Invalid id. QuestItem id {" << id << "} could not be set." << std::endl;
@@ -88,16 +93,3 @@
     }
 
-    /**
-    @brief
-        Checks whether an input id is of the required form.
-    @param id
-        The id to be checked.
-    @return
-        Returns true if the string is likely to be of the required form.
-    */
-    /*static*/ bool QuestItem::isId(const std::string & id)
-    {
-        return id.size() >= 32;
-    }
-
 }
Index: code/trunk/src/modules/questsystem/QuestItem.h
===================================================================
--- code/trunk/src/modules/questsystem/QuestItem.h	(revision 6906)
+++ code/trunk/src/modules/questsystem/QuestItem.h	(revision 7163)
@@ -41,4 +41,5 @@
 #include <string>
 #include "core/BaseObject.h"
+#include "QuestManager.h"
 
 namespace orxonox
@@ -71,8 +72,18 @@
             @return Returns a pointer to the QuestDescription object of the QuestItem.
             */
-            inline const QuestDescription* getDescription(void) const
+            inline QuestDescription* getDescription(void) const
                 { return this->description_; }
 
-            static bool isId(const std::string & id); //!< Checks whether a given id is valid.
+            /**
+            @brief Check whether the QuestItem is registered with the QuestManager.
+            @return Returns true if the QuestItem is registered with the QuestManager.
+            */
+            inline bool isRegistered(void)
+                { return this->registered_; }
+            /**
+            @brief Set the QuestItem as being registered with the QuestManager.
+            */
+            inline void setRegistered(void)
+                { this->registered_ = true; }
 
         protected:
@@ -90,4 +101,6 @@
             QuestDescription* description_; //!< The QuestDescription of the QuestItem.
 
+            bool registered_;
+
     };
 
Index: code/trunk/src/modules/questsystem/QuestListener.cc
===================================================================
--- code/trunk/src/modules/questsystem/QuestListener.cc	(revision 6906)
+++ code/trunk/src/modules/questsystem/QuestListener.cc	(revision 7163)
@@ -74,7 +74,8 @@
         XMLPortParam(QuestListener, "mode", setMode, getMode, xmlelement, mode);
 
-        this->quest_->addListener(this); //!< Adds the QuestListener to the Quests list of listeners.
-
-        COUT(3) << "QuestListener created for quest: {" << this->quest_->getId() << "} with mode '" << this->getMode() << "'." << std::endl;
+        if(this->quest_ != NULL)
+            this->quest_->addListener(this); //!< Adds the QuestListener to the Quests list of listeners.
+
+        COUT(4) << "QuestListener created for quest: {" << this->quest_->getId() << "} with mode '" << this->getMode() << "'." << std::endl;
     }
 
Index: code/trunk/src/modules/questsystem/QuestManager.cc
===================================================================
--- code/trunk/src/modules/questsystem/QuestManager.cc	(revision 6906)
+++ code/trunk/src/modules/questsystem/QuestManager.cc	(revision 7163)
@@ -74,9 +74,5 @@
     QuestManager::~QuestManager()
     {
-        for(std::map<PlayerInfo*, QuestGUI*>::iterator it = this->questGUIs_.begin(); it != this->questGUIs_.end(); it++)
-        {
-            it->second->destroy();
-        }
-        this->questGUIs_.clear();
+
     }
 
@@ -114,5 +110,6 @@
         if(result.second) //!< If inserting was a success.
         {
-            COUT(3) << "Quest with questId {" << quest->getId() << "} successfully inserted." << std::endl;
+            quest->setRegistered();
+            COUT(4) << "Quest with questId {" << quest->getId() << "} successfully inserted." << std::endl;
             return true;
         }
@@ -122,4 +119,13 @@
            return false;
         }
+    }
+
+    /**
+    @brief
+        Unregisters a Quest in the QuestManager.
+    */
+    bool QuestManager::unregisterQuest(Quest* quest)
+    {
+        return this->questMap_.erase(quest->getId()) == 1;
     }
 
@@ -146,5 +152,6 @@
         if(result.second) //!< If inserting was a success.
         {
-            COUT(3) << "QuestHint with hintId {" << hint->getId() << "} successfully inserted." << std::endl;
+            hint->setRegistered();
+            COUT(4) << "QuestHint with hintId {" << hint->getId() << "} successfully inserted." << std::endl;
             return true;
         }
@@ -154,4 +161,13 @@
            return false;
         }
+    }
+
+    /**
+    @brief
+        Unregisters a QuestHint in the QuestManager.
+    */
+    bool QuestManager::unregisterHint(QuestHint* hint)
+    {
+        return this->hintMap_.erase(hint->getId()) == 1;
     }
 
@@ -169,5 +185,5 @@
     Quest* QuestManager::findQuest(const std::string & questId)
     {
-        if(!QuestItem::isId(questId)) //!< Check vor validity of the given id.
+        if(questId.compare(BLANKSTRING) == 1) //!< Check vor validity of the given id.
         {
             ThrowException(Argument, "Invalid questId.");
@@ -203,5 +219,5 @@
     QuestHint* QuestManager::findHint(const std::string & hintId)
     {
-        if(!QuestItem::isId(hintId)) //!< Check vor validity of the given id.
+        if(hintId.compare(BLANKSTRING) == 1) //!< Check vor validity of the given id.
         {
             ThrowException(Argument, "Invalid hintId.");
@@ -224,21 +240,79 @@
     }
 
-    /**
-    @brief
-        Retreive the main window for the GUI.
-        This is for the use in the lua script tu start the QuestGUI.
-    @param guiName
-        The name of the GUI.
-    @return
-        Returns a CEGUI Window.
-    */
-    CEGUI::Window* QuestManager::getQuestGUI(const std::string & guiName)
-    {
-        PlayerInfo* player = this->retrievePlayer(guiName);
-
-        if(this->questGUIs_.find(player) == this->questGUIs_.end()) //!< Create a new GUI, if there is none, yet.
-            this->questGUIs_[player] = new QuestGUI(player);
-
-        return this->questGUIs_[player]->getGUI();
+    int QuestManager::getNumParentQuests(PlayerInfo* player)
+    {
+        int numQuests = 0;
+        for(std::map<std::string, Quest*>::iterator it = this->questMap_.begin(); it != this->questMap_.end(); it++)
+        {
+            if(it->second->getParentQuest() == NULL && !it->second->isInactive(player))
+                numQuests++;
+        }
+        return numQuests;
+    }
+
+    Quest* QuestManager::getParentQuest(PlayerInfo* player, int index)
+    {
+        for(std::map<std::string, Quest*>::iterator it = this->questMap_.begin(); it != this->questMap_.end(); it++)
+        {
+            if(it->second->getParentQuest() == NULL && !it->second->isInactive(player) && index-- == 0)
+                return it->second;
+        }
+        return NULL;
+    }
+
+    int QuestManager::getNumSubQuests(Quest* quest, PlayerInfo* player)
+    {
+        std::list<Quest*> quests = quest->getSubQuestList();
+        int numQuests = 0;
+        for(std::list<Quest*>::iterator it = quests.begin(); it != quests.end(); it++)
+        {
+            if(!(*it)->isInactive(player))
+                numQuests++;
+        }
+        return numQuests;
+    }
+
+    Quest* QuestManager::getSubQuest(Quest* quest, PlayerInfo* player, int index)
+    {
+        std::list<Quest*> quests = quest->getSubQuestList();
+        for(std::list<Quest*>::iterator it = quests.begin(); it != quests.end(); it++)
+        {
+            if(!(*it)->isInactive(player) && index-- == 0)
+                return *it;
+        }
+        return NULL;
+    }
+
+    int QuestManager::getNumHints(Quest* quest, PlayerInfo* player)
+    {
+        std::list<QuestHint*> hints = quest->getHintsList();
+        int numHints = 0;
+        for(std::list<QuestHint*>::iterator it = hints.begin(); it != hints.end(); it++)
+        {
+            if((*it)->isActive(player))
+                numHints++;
+        }
+        return numHints;
+    }
+
+    QuestHint* QuestManager::getHints(Quest* quest, PlayerInfo* player, int index)
+    {
+        std::list<QuestHint*> hints = quest->getHintsList();
+        for(std::list<QuestHint*>::iterator it = hints.begin(); it != hints.end(); it++)
+        {
+            if((*it)->isActive(player) && index-- == 0)
+                return *it;
+        }
+        return NULL;
+    }
+
+    QuestDescription* QuestManager::getDescription(Quest* item)
+    {
+        return item->getDescription();
+    }
+
+    QuestDescription* QuestManager::getDescription(QuestHint* item)
+    {
+        return item->getDescription();
     }
 
Index: code/trunk/src/modules/questsystem/QuestManager.h
===================================================================
--- code/trunk/src/modules/questsystem/QuestManager.h	(revision 6906)
+++ code/trunk/src/modules/questsystem/QuestManager.h	(revision 7163)
@@ -36,5 +36,4 @@
 
 #include "questsystem/QuestsystemPrereqs.h"
-#include <CEGUIForwardRefs.h>
 
 #include <list>
@@ -44,6 +43,4 @@
 #include "util/Singleton.h"
 #include "core/OrxonoxClass.h"
-
-#include "QuestGUI.h"
 
 // tolua_begin
@@ -63,5 +60,4 @@
 
             friend class Singleton<QuestManager>;
-            friend class QuestGUI;
 
         public:
@@ -72,9 +68,22 @@
             static QuestManager& getInstance() { return Singleton<QuestManager>::getInstance(); } // tolua_export
 
-            //! Retrieve the main window for the GUI.
-            CEGUI::Window* getQuestGUI(const std::string & guiName); // tolua_export
+            // tolua_begin
+            int getNumParentQuests(orxonox::PlayerInfo* player);
+            Quest* getParentQuest(orxonox::PlayerInfo* player, int index);
+
+            int getNumSubQuests(Quest* quest, orxonox::PlayerInfo* player);
+            Quest* getSubQuest(Quest* quest, orxonox::PlayerInfo* player, int index);
+
+            int getNumHints(Quest* quest, orxonox::PlayerInfo* player);
+            QuestHint* getHints(Quest* quest, orxonox::PlayerInfo* player, int index);
+
+            QuestDescription* getDescription(Quest* item);
+            QuestDescription* getDescription(QuestHint* item);
+            // tolua_end
 
             bool registerQuest(Quest* quest); //!< Registers a Quest in the QuestManager.
-            bool registerHint(QuestHint* quest); //!< Registers a QuestHint in the QuestManager.
+            bool unregisterQuest(Quest* quest); //!< Unregisters a Quest in the QuestManager.
+            bool registerHint(QuestHint* hint); //!< Registers a QuestHint in the QuestManager.
+            bool unregisterHint(QuestHint* hint); //!< Unregisters a QuestHint in the QuestManager.
 
             Quest* findQuest(const std::string & questId); //!< Returns the Quest with the input id.
@@ -91,6 +100,4 @@
             std::map<std::string, QuestHint*> hintMap_; //!< All QuestHints registered by their id's.
 
-            std::map<PlayerInfo*, QuestGUI*> questGUIs_; //!< All GUI's registered by the players.
-
     }; // tolua_export
 
Index: code/trunk/src/modules/questsystem/QuestNotification.cc
===================================================================
--- code/trunk/src/modules/questsystem/QuestNotification.cc	(revision 6906)
+++ code/trunk/src/modules/questsystem/QuestNotification.cc	(revision 7163)
@@ -32,16 +32,32 @@
 namespace orxonox {
 
-    const std::string QuestNotification::SENDER("questsystem");
+    /*static*/ const std::string QuestNotification::SENDER("questsystem");
 
+    CreateUnloadableFactory(QuestNotification);
+
+    /**
+    @brief
+        Default Constructor. Creates a useless QuestNotification.
+    */
     QuestNotification::QuestNotification(BaseObject* creator) : Notification(creator)
     {
-        this->initialize();
+        RegisterObject(QuestNotification);
     }
 
-    QuestNotification::QuestNotification(const std::string & message) : Notification(message)
+    /**
+    @brief
+        Creates a QuestNotification with the input message.
+    @param message
+        The message to be sent.
+    */
+    QuestNotification::QuestNotification(BaseObject* creator, const std::string & message) : Notification(creator, message)
     {
-        this->initialize();
+        RegisterObject(QuestNotification);
     }
 
+    /**
+    @brief
+        Destructor.
+    */
     QuestNotification::~QuestNotification()
     {
@@ -49,4 +65,10 @@
     }
 
+    /**
+    @brief
+        Send the QuestNotification.
+    @return
+        Returns true if successful.
+    */
     bool QuestNotification::send(void)
     {
@@ -54,9 +76,4 @@
     }
 
-    void QuestNotification::initialize(void)
-    {
-        RegisterObject(QuestNotification);
-    }
-
 
 }
Index: code/trunk/src/modules/questsystem/QuestNotification.h
===================================================================
--- code/trunk/src/modules/questsystem/QuestNotification.h	(revision 6906)
+++ code/trunk/src/modules/questsystem/QuestNotification.h	(revision 7163)
@@ -39,5 +39,5 @@
     /**
     @brief
-
+        The QuestNotification is a special Notification that has the single property that it is only sent by the questsystem.
     @author
         Damian 'Mozork' Frick
@@ -46,14 +46,12 @@
     {
         public:
-            QuestNotification(BaseObject* creator);
-            QuestNotification(const std::string & message);
-            virtual ~QuestNotification();
+            QuestNotification(BaseObject* creator); //!< Default Constructor.
+            QuestNotification(BaseObject* creator, const std::string & message); //!< Constructor.
+            virtual ~QuestNotification(); //!< Destructor.
 
-            bool send(void);
+            bool send(void); //!< Send the QuestNotification.
 
         private:
-            static const std::string SENDER;
-
-            void initialize(void);
+            static const std::string SENDER; //!< A string identifying the questsystem as the sender.
 
     };
Index: code/trunk/src/modules/questsystem/QuestsystemPrereqs.h
===================================================================
--- code/trunk/src/modules/questsystem/QuestsystemPrereqs.h	(revision 6906)
+++ code/trunk/src/modules/questsystem/QuestsystemPrereqs.h	(revision 7163)
@@ -43,5 +43,5 @@
 //-----------------------------------------------------------------------
 
-#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD)
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(QUESTSYSTEM_STATIC_BUILD)
 #  ifdef QUESTSYSTEM_SHARED_BUILD
 #    define _QuestsystemExport __declspec(dllexport)
@@ -77,6 +77,4 @@
     class QuestEffect;
     class QuestEffectBeacon;
-    class QuestGUI;
-    class QuestGUINode;
     class QuestHint;
     class QuestItem;
Index: code/trunk/src/modules/questsystem/notifications/Notification.cc
===================================================================
--- code/trunk/src/modules/questsystem/notifications/Notification.cc	(revision 6906)
+++ code/trunk/src/modules/questsystem/notifications/Notification.cc	(revision 7163)
@@ -40,4 +40,6 @@
 {
 
+    CreateUnloadableFactory(Notification);
+
     /**
     @brief
@@ -56,5 +58,5 @@
         The message of the Notification.
     */
-    Notification::Notification(const std::string & message) : BaseObject(NULL)
+    Notification::Notification(BaseObject* creator, const std::string & message) : BaseObject(creator)
     {
         this->message_ = message;
@@ -67,4 +69,5 @@
     Notification::~Notification()
     {
+
     }
 
Index: code/trunk/src/modules/questsystem/notifications/Notification.h
===================================================================
--- code/trunk/src/modules/questsystem/notifications/Notification.h	(revision 6906)
+++ code/trunk/src/modules/questsystem/notifications/Notification.h	(revision 7163)
@@ -53,5 +53,5 @@
         public:
             Notification(BaseObject* creator);
-            Notification(const std::string & message);
+            Notification(BaseObject* creator, const std::string & message);
             virtual ~Notification();
 
Index: code/trunk/src/modules/questsystem/notifications/NotificationManager.cc
===================================================================
--- code/trunk/src/modules/questsystem/notifications/NotificationManager.cc	(revision 6906)
+++ code/trunk/src/modules/questsystem/notifications/NotificationManager.cc	(revision 7163)
@@ -66,4 +66,5 @@
     NotificationManager::~NotificationManager()
     {
+
     }
 
@@ -101,10 +102,68 @@
                 this->notificationLists_[it->second]->insert(std::pair<std::time_t,Notification*>(time,notification)); //!< Insert the Notification in the Notifications list of the current NotificationListener.
                 it->first->update(notification, time); //!< Update the listener.
+                std::map<Notification*, unsigned int>::iterator counterIt = this->listenerCounter_.find(notification);
+                if(counterIt == this->listenerCounter_.end())
+                    this->listenerCounter_[notification] = 1;
+                else
+                    this->listenerCounter_[notification] = counterIt->second + 1;
             }
         }
 
-        COUT(3) << "Notification registered with the NotificationManager." << std::endl;
+        COUT(4) << "Notification registered with the NotificationManager." << std::endl;
 
         return true;
+    }
+
+    /**
+    @brief
+        Unregisters a Notification within the NotificationManager.
+    @param notification
+        A pointer to the Notification to be unregistered.
+    @param listener
+        A pointer to the NotificationListener the Notification is unregistered for.
+    */
+    void NotificationManager::unregisterNotification(Notification* notification, NotificationListener* listener)
+    {
+        assert(notification);
+        assert(listener);
+
+        // If the Notification was removed from the list of Notifications of the input NotificationListener, the counter for the Notification of the number of NotificationListeners it is present in is decremented.
+        if(this->removeNotification(notification, *(this->notificationLists_.find(this->listenerList_.find(listener)->second)->second)))
+            this->listenerCounter_[notification] = this->listenerCounter_[notification] - 1;
+
+        // If the Notification is no longer present in any of the NotificationListeners it can be removed from the map of all Notifications and be destroyed.
+        if(this->listenerCounter_[notification] == (unsigned int) 0)
+        {
+            this->removeNotification(notification, this->allNotificationsList_);
+            this->listenerCounter_.erase(notification);
+            notification->destroy();
+        }
+
+        COUT(4) << "Notification unregistered with the NotificationManager." << std::endl;
+    }
+
+    /**
+    @brief
+        Helper method that removes an input notification form an input map.
+    @param notification
+        A pointer to the notification to be removed.
+    @param map
+        The map the notification should be removed from.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationManager::removeNotification(Notification* notification, std::multimap<std::time_t, Notification*>& map)
+    {
+        // Iterates through all items in the map until the Notification is found.
+        //TODO: Do more efficiently?
+        for(std::multimap<std::time_t, Notification*>::iterator it = map.begin(); it != map.end(); it++)
+        {
+            if(it->second == notification)
+            {
+                map.erase(it);
+                return true;
+            }
+        }
+        return false;
     }
 
@@ -130,5 +189,5 @@
         {
             this->notificationLists_[index] = &this->allNotificationsList_;
-            COUT(3) << "NotificationListener registered with the NotificationManager." << std::endl;
+            COUT(4) << "NotificationListener registered with the NotificationManager." << std::endl;
             return true;
         }
@@ -142,5 +201,10 @@
             if(set.find(it->second->getSender()) != set.end()) //!< Checks whether the overlay has the sender of the current notification as target.
             {
-                map.insert(std::pair<std::time_t,Notification*>(it->first, it->second));
+                map.insert(std::pair<std::time_t, Notification*>(it->first, it->second));
+                std::map<Notification*, unsigned int>::iterator counterIt = this->listenerCounter_.find(it->second);
+                if(counterIt == this->listenerCounter_.end())
+                    this->listenerCounter_[it->second] = 1;
+                else
+                    this->listenerCounter_[it->second] = counterIt->second + 1;
             }
         }
@@ -148,7 +212,36 @@
         listener->update(); //!< Update the listener.
 
-        COUT(3) << "NotificationListener registered with the NotificationManager." << std::endl;
+        COUT(4) << "NotificationListener registered with the NotificationManager." << std::endl;
 
         return true;
+    }
+
+    /**
+    @brief
+        Unregisters a NotificationListener withing the NotificationManager.
+    */
+    void NotificationManager::unregisterListener(NotificationListener* listener)
+    {
+        assert(listener);
+
+        int identifier = this->listenerList_.find(listener)->second;
+        std::multimap<std::time_t, Notification*>* map = this->notificationLists_.find(identifier)->second;
+
+        // Make sure all Notifications are removed.
+        std::multimap<std::time_t, Notification*>::iterator it = map->begin();
+        while(it != map->end())
+        {
+            this->unregisterNotification(it->second, listener);
+            it = map->begin();
+        }
+
+        this->listenerList_.erase(listener);
+        this->notificationLists_.erase(identifier);
+
+        // If the map is not the map of all notifications, delete it.
+        if(map != &this->allNotificationsList_)
+            delete map;
+
+        COUT(4) << "NotificationListener unregistered with the NotificationManager." << std::endl;
     }
 
Index: code/trunk/src/modules/questsystem/notifications/NotificationManager.h
===================================================================
--- code/trunk/src/modules/questsystem/notifications/NotificationManager.h	(revision 6906)
+++ code/trunk/src/modules/questsystem/notifications/NotificationManager.h	(revision 7163)
@@ -60,9 +60,11 @@
             virtual ~NotificationManager();
 
-            static const std::string ALL;
-            static const std::string NONE;
+            static const std::string ALL; //!< Static string to indicate a sender that sends to all NotificationListeners.
+            static const std::string NONE; //!< Static string to indicare a sender that sends to no specific NotificationListener.
 
             bool registerNotification(Notification* notification); //!< Registers a Notification within the NotificationManager.
+            void unregisterNotification(Notification* notification, NotificationListener* listener); //!< Unregisters a Notification within the NotificationManager.
             bool registerListener(NotificationListener* listener); //!< Registers a NotificationListener within the NotificationManager.
+            void unregisterListener(NotificationListener* listener); //!< Unregisters a NotificationListener withing the NotificationManager.
 
             bool getNotifications(NotificationListener* listener, std::multimap<std::time_t,Notification*>* map, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd); //!< Returns the Notifications for a specific NotificationListener in a specified timeframe.
@@ -90,10 +92,12 @@
             static NotificationManager* singletonPtr_s;
 
-            int highestIndex_; //!< This variable holds the highest index (resp. key) in notificationLists_s, to secure that  no key appears twice.
+            int highestIndex_; //!< This variable holds the highest index (resp. key) in notificationLists_s, to secure that no key appears twice.
 
-            std::multimap<std::time_t,Notification*> allNotificationsList_; //!< Container where all notifications are stored (together with their respecive timestamps).
+            std::multimap<std::time_t,Notification*> allNotificationsList_; //!< Container where all notifications are stored.
             std::map<NotificationListener*,int> listenerList_; //!< Container where all NotificationListeners are stored with a number as identifier.
             std::map<int,std::multimap<std::time_t,Notification*>*> notificationLists_; //!< Container where all Notifications, for each identifier (associated with a NotificationListener), are stored.
+            std::map<Notification*, unsigned int> listenerCounter_; //!< A container to store the number of NotificationListeners a Notification is registered with.
 
+            bool removeNotification(Notification* notification, std::multimap<std::time_t, Notification*>& map); //!< Helper method that removes an input notification form an input map.
 
     };
Index: code/trunk/src/modules/questsystem/notifications/NotificationQueue.cc
===================================================================
--- code/trunk/src/modules/questsystem/notifications/NotificationQueue.cc	(revision 6906)
+++ code/trunk/src/modules/questsystem/notifications/NotificationQueue.cc	(revision 7163)
@@ -34,6 +34,5 @@
 #include "NotificationQueue.h"
 
-#include <sstream>
-
+#include "util/Convert.h"
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
@@ -56,4 +55,6 @@
     NotificationQueue::NotificationQueue(BaseObject* creator) : OverlayGroup(creator)
     {
+        this->registered_ = false;
+
         RegisterObject(NotificationQueue);
         this->initialize();
@@ -68,4 +69,7 @@
         this->targets_.clear();
         this->clear();
+
+        if(this->registered_)
+            NotificationManager::getInstance().unregisterListener(this);
     }
 
@@ -81,4 +85,5 @@
 
         NotificationManager::getInstance().registerListener(this);
+        this->registered_ = true;
     }
 
@@ -118,5 +123,5 @@
         XMLPortParam(NotificationQueue, "position", setPosition, getPosition, xmlElement, mode);
 
-        COUT(3) << "NotificationQueue created." << std::endl;
+        COUT(3) << "NotificationQueue '" << this->getName() << "' created." << std::endl;
     }
 
@@ -173,5 +178,5 @@
         delete notifications;
 
-        COUT(3) << "NotificationQueue updated." << std::endl;
+        COUT(4) << "NotificationQueue '" << this->getName() << "' updated." << std::endl;
     }
 
@@ -196,5 +201,5 @@
         }
 
-        COUT(3) << "NotificationQueue updated. A new Notifications has been added." << std::endl;
+        COUT(4) << "NotificationQueue '" << this->getName() << "' updated. A new Notifications has been added." << std::endl;
     }
 
@@ -397,7 +402,5 @@
         std::string timeString = std::ctime(&time);
         timeString.erase(timeString.length()-1);
-        std::ostringstream stream;
-        stream << reinterpret_cast<unsigned long>(notification);
-        const std::string& addressString = stream.str();
+        const std::string& addressString = multi_cast<std::string>(reinterpret_cast<unsigned long>(notification));
         container->name = "NotificationOverlay(" + timeString + ")&" + addressString;
 
@@ -422,4 +425,7 @@
         if(this->size_ == 0) //!< You cannot remove anything if the queue is empty.
             return false;
+
+        // Unregister the NotificationQueue with the NotificationManager.
+        NotificationManager::getInstance().unregisterNotification(container->notification, this);
 
         this->removeElement(container->overlay);
@@ -443,5 +449,5 @@
         {
             this->removeContainer(*it);
-            it = this->containers_.begin(); //TODO: Needed?
+            it = this->containers_.begin();
         }
     }
Index: code/trunk/src/modules/questsystem/notifications/NotificationQueue.h
===================================================================
--- code/trunk/src/modules/questsystem/notifications/NotificationQueue.h	(revision 6906)
+++ code/trunk/src/modules/questsystem/notifications/NotificationQueue.h	(revision 7163)
@@ -71,4 +71,5 @@
 
         Creating a NotificationQueue through XML goes as follows:
+        Be aware that the NotificationQueue must be inside the <Level></Level> tags or bad things will happen.
         <NotificationQueue
             name = "SuperQueue" //Name of your OverlayQueue.
@@ -185,4 +186,6 @@
             NotificationOverlayContainer timeLimit_; //!< Helper object to check against to determine whether Notifications have expired.
 
+            bool registered_; //!< Helper variable to remember whether the NotificationQueue is registered already.
+
             void initialize(void); //!< Initializes the object.
             void setDefaults(void); //!< Helper method to set the default values.
Index: code/trunk/src/modules/weapons/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/weapons/CMakeLists.txt	(revision 6906)
+++ code/trunk/src/modules/weapons/CMakeLists.txt	(revision 7163)
@@ -1,4 +1,5 @@
 SET_SOURCE_FILES(WEAPONS_SRC_FILES
   MuzzleFlash.cc
+  RocketController.cc
 )
 
@@ -12,6 +13,4 @@
   PCH_FILE
     WeaponsPrecompiledHeaders.h
-  DEFINE_SYMBOL
-    "WEAPONS_SHARED_BUILD"
   LINK_LIBRARIES
     orxonox
Index: code/trunk/src/modules/weapons/RocketController.cc
===================================================================
--- code/trunk/src/modules/weapons/RocketController.cc	(revision 7163)
+++ code/trunk/src/modules/weapons/RocketController.cc	(revision 7163)
@@ -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:
+*     Gabriel Nadler, Originalfile: Oli Scheuss
+*   Co-authors:
+*      ...
+*
+*/
+
+#include "RocketController.h"
+#include "projectiles/SimpleRocket.h"
+#include "util/Math.h"
+#include "weapons/projectiles/SimpleRocket.h"
+#include "util/Debug.h"
+#include "weapons/weaponmodes/SimpleRocketFire.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+    Constructor.
+    */
+    RocketController::RocketController(BaseObject* creator) : Controller(creator)
+    {
+        RegisterObject(RocketController);
+        COUT(5)<< "RocketController constructed\n";
+
+
+        this->rocket_ = new SimpleRocket(this);
+        this->rocket_->setController(this);
+        this->setControllableEntity(dynamic_cast<ControllableEntity*> (this->rocket_));
+    }
+
+
+    /**
+    @brief
+    The controlling happens here. This method defines what the controller has to do each tick.
+    @param dt
+    The duration of the tick.
+    */
+    void RocketController::tick(float dt)
+    {
+
+        if (this->target_ && this->rocket_->hasFuel()) {
+            this->setTargetPosition();
+            this->moveToTargetPosition();
+        }
+
+
+    }
+
+
+    RocketController::~RocketController()
+    {
+        COUT(5)<< "RocketController destroyed\n";
+    }
+
+    void RocketController::setTargetPosition()
+    {
+        this->targetPosition_=this->target_->getWorldPosition(); //don't really note a difference in the rocket behaviour xD
+        //this->targetPosition_ = getPredictedPosition(this->getControllableEntity()->getWorldPosition(),this->getControllableEntity()->getVelocity().length() , this->target_->getWorldPosition(), this->target_->getVelocity());
+    }
+    void RocketController::moveToTargetPosition()
+    {
+        this->moveToPosition(this->targetPosition_);
+    }
+
+
+
+    void RocketController::setTarget(WorldEntity* target)
+    {
+        this->target_ = target;
+    }
+
+    void RocketController::moveToPosition(const Vector3& target)
+    {
+        if (!this->getControllableEntity())
+            return;
+
+        Vector2 coord = get2DViewdirection(this->rocket_->getPosition(), this->rocket_->getOrientation() * WorldEntity::FRONT, this->rocket_->getOrientation() * WorldEntity::UP, target);
+        float distance = (target - this->rocket_->getWorldPosition()).length();
+
+
+        if (distance > 1000 && this->rocket_->getVelocity().squaredLength()<160000)
+            this->rocket_->setAcceleration(this->rocket_->getOrientation()*Vector3(-20,-20,-20));
+        if (distance <1000) this->rocket_->setAcceleration(0,0,0);
+
+        this->rocket_->rotateYaw(-sgn(coord.x)*coord.x*coord.x);
+        this->rocket_->rotatePitch(sgn(coord.y)*coord.y*coord.y);
+    }
+
+
+
+
+}
Index: code/trunk/src/modules/weapons/RocketController.h
===================================================================
--- code/trunk/src/modules/weapons/RocketController.h	(revision 7163)
+++ code/trunk/src/modules/weapons/RocketController.h	(revision 7163)
@@ -0,0 +1,73 @@
+/*
+ *   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:
+ *      Gabriel Nadler, Originalfile: Oli Scheuss
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _RocketController_H__
+#define _RocketController_H__
+
+#include "weapons/WeaponsPrereqs.h"
+
+#include "controllers/Controller.h"
+#include "tools/interfaces/Tickable.h"
+#include "weapons/projectiles/SimpleRocket.h"
+#include "weapons/weaponmodes/SimpleRocketFire.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        Controller for the Rocket (targetseeking)
+    @author
+        Gabriel Nadler, Originalfile: Oli Scheuss
+    */
+    class _WeaponsExport RocketController : public Controller, public Tickable
+    {
+        public:
+            RocketController(BaseObject* creator);
+            virtual ~RocketController();
+
+            virtual void tick(float dt);
+            SimpleRocket* getRocket() const
+             {  return this->rocket_;  };
+            void setTarget(WorldEntity* target);
+        protected:
+            void moveToPosition(const Vector3& target);
+            void setTargetPosition();
+            void moveToTargetPosition();
+
+        private:
+            SimpleRocket* rocket_; //!<The Rocket it controlls
+            Vector3 targetPosition_;
+            WeakPtr<PlayerInfo> player_;
+
+            WeakPtr<WorldEntity> target_;
+
+
+    };
+}
+
+#endif /* _RocketController_H__ */
Index: code/trunk/src/modules/weapons/WeaponsPrereqs.h
===================================================================
--- code/trunk/src/modules/weapons/WeaponsPrereqs.h	(revision 6906)
+++ code/trunk/src/modules/weapons/WeaponsPrereqs.h	(revision 7163)
@@ -43,5 +43,5 @@
 //-----------------------------------------------------------------------
 
-#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD)
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(WEAPONS_STATIC_BUILD)
 #  ifdef WEAPONS_SHARED_BUILD
 #    define _WeaponsExport __declspec(dllexport)
Index: code/trunk/src/modules/weapons/projectiles/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/weapons/projectiles/CMakeLists.txt	(revision 6906)
+++ code/trunk/src/modules/weapons/projectiles/CMakeLists.txt	(revision 7163)
@@ -5,3 +5,4 @@
   LightningGunProjectile.cc
   Rocket.cc
+  SimpleRocket.cc
 )
Index: code/trunk/src/modules/weapons/projectiles/Rocket.cc
===================================================================
--- code/trunk/src/modules/weapons/projectiles/Rocket.cc	(revision 6906)
+++ code/trunk/src/modules/weapons/projectiles/Rocket.cc	(revision 7163)
@@ -41,4 +41,5 @@
 #include "controllers/Controller.h"
 #include "sound/WorldSound.h"
+#include "Scene.h"
 
 namespace orxonox
@@ -87,4 +88,5 @@
             this->defSndWpnEngine_->setLooping(true);
             this->defSndWpnEngine_->setSource("sounds/Rocket_engine.ogg");
+            this->defSndWpnEngine_->setVolume(100);
             this->attach(defSndWpnEngine_);
 
@@ -92,4 +94,5 @@
             this->defSndWpnLaunch_->setLooping(false);
             this->defSndWpnLaunch_->setSource("sounds/Rocket_launch.ogg");
+            this->defSndWpnLaunch_->setVolume(100);
             this->attach(defSndWpnLaunch_);
         }
@@ -114,6 +117,11 @@
         if(this->isInitialized())
         {
-            if (GameMode::isMaster() && this->player_)
-                this->player_->stopTemporaryControl();
+            if (GameMode::isMaster())
+            {
+                this->destructionEffect();
+
+                if (this->getPlayer() && this->getController())
+                    this->player_->stopTemporaryControl();
+            }
 
             if ( this->defSndWpnEngine_ )
@@ -138,5 +146,4 @@
     {
         this->owner_ = owner;
-        this->originalControllableEntity_ = this->owner_->getPlayer()->getControllableEntity();
         this->player_ = this->owner_->getPlayer();
         this->owner_->getPlayer()->startTemporaryControl(this);
@@ -164,7 +171,11 @@
             this->setVelocity( this->getOrientation()*WorldEntity::FRONT*this->getVelocity().length() );
             this->localAngularVelocity_ = 0;
-
+        }
+
+        if( GameMode::isMaster() )
+        {
             if( this->bDestroy_ )
                 this->destroy();
+
         }
     }
@@ -222,25 +233,35 @@
     void Rocket::fired(unsigned int firemode)
     {
-        if (this->owner_)
-        {
-            {
-                ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
-                effect->setPosition(this->getPosition());
-                effect->setOrientation(this->getOrientation());
-                effect->setDestroyAfterLife(true);
-                effect->setSource("Orxonox/explosion4");
-                effect->setLifetime(2.0f);
-            }
-
-            {
-                ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
-                effect->setPosition(this->getPosition());
-                effect->setOrientation(this->getOrientation());
-                effect->setDestroyAfterLife(true);
-                effect->setSource("Orxonox/smoke4");
-                effect->setLifetime(3.0f);
-            }
+//         if (this->owner_)
+//         {
             this->destroy();
-        }
+//         }
+    }
+    
+    void Rocket::destructionEffect()
+    {
+        ParticleSpawner *effect1, *effect2;
+        if( this->owner_ )
+        {
+            effect1 = new ParticleSpawner(this->owner_->getCreator());
+            effect2 = new ParticleSpawner(this->owner_->getCreator());
+        }
+        else
+        {
+            effect1 = new ParticleSpawner(static_cast<BaseObject*>(this->getScene().get()));
+            effect2 = new ParticleSpawner(static_cast<BaseObject*>(this->getScene().get()));
+        }
+        
+        effect1->setPosition(this->getPosition());
+        effect1->setOrientation(this->getOrientation());
+        effect1->setDestroyAfterLife(true);
+        effect1->setSource("Orxonox/explosion4");
+        effect1->setLifetime(2.0f);
+        
+        effect2->setPosition(this->getPosition());
+        effect2->setOrientation(this->getOrientation());
+        effect2->setDestroyAfterLife(true);
+        effect2->setSource("Orxonox/smoke4");
+        effect2->setLifetime(3.0f);
     }
 
Index: code/trunk/src/modules/weapons/projectiles/Rocket.h
===================================================================
--- code/trunk/src/modules/weapons/projectiles/Rocket.h	(revision 6906)
+++ code/trunk/src/modules/weapons/projectiles/Rocket.h	(revision 7163)
@@ -57,4 +57,5 @@
             virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
             void destroyObject();
+            void destructionEffect();
 
             virtual void moveFrontBack(const Vector2& value){}
@@ -119,5 +120,4 @@
             float damage_;
             bool bDestroy_;
-            ControllableEntity* originalControllableEntity_;
 
             WeakPtr<PlayerInfo> player_;
Index: code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc
===================================================================
--- code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc	(revision 7163)
+++ code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc	(revision 7163)
@@ -0,0 +1,258 @@
+/*
+ *   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:
+ *      Oliver Scheuss
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "SimpleRocket.h"
+
+#include <BulletDynamics/Dynamics/btRigidBody.h>
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "worldentities/pawns/Pawn.h"
+#include "graphics/ParticleSpawner.h"
+#include "graphics/Model.h"
+#include "objects/collisionshapes/ConeCollisionShape.h"
+#include "infos/PlayerInfo.h"
+#include "controllers/Controller.h"
+#include "weapons/RocketController.h"
+#include "sound/WorldSound.h"
+#include "util/Debug.h"
+
+namespace orxonox
+{
+
+    CreateFactory(SimpleRocket);
+
+    SimpleRocket::SimpleRocket(BaseObject* creator) : ControllableEntity(creator)
+    {
+        RegisterObject(SimpleRocket);// - register the SimpleRocket class to the core
+
+        this->localAngularVelocity_ = 0;
+        this->bDestroy_ = false;
+        this->lifetime_ = 120;
+
+        this->setMass(15);
+        COUT(4) << "simplerocket constructed\n";
+
+        if (GameMode::isMaster())
+        {
+            this->setCollisionType(WorldEntity::Kinematic);
+            this->fuel_=true;
+
+            Model* model = new Model(this);
+            model->setMeshSource("rocket.mesh");
+            model->scale(0.7f);
+            this->attach(model);
+
+            this->fire_ = new ParticleEmitter(this);
+            this->attach(this->fire_);
+
+            this->fire_->setOrientation(this->getOrientation());
+            this->fire_->setSource("Orxonox/simplerocketfire");
+            this->enableCollisionCallback();
+            this->setCollisionResponse(false);
+            this->setCollisionType(Kinematic);
+
+            // TODO: fix the orientation and size of this collision shape to match the rocket
+            ConeCollisionShape* collisionShape = new ConeCollisionShape(this);
+            collisionShape->setOrientation(this->getOrientation());
+            collisionShape->setRadius(1.5f);
+            collisionShape->setHeight(5);
+            this->attachCollisionShape(collisionShape);
+            this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&SimpleRocket::destroyObject, this)));
+        }
+
+    }
+
+
+
+    /**
+    * @brief updates state of rocket, disables fire if no fuel
+    * @param dt tick-length
+    */
+    void SimpleRocket::tick(float dt)
+    {
+
+        SUPER(SimpleRocket, tick, dt);
+        if ( GameMode::isMaster() )
+        {
+
+
+            this->setAngularVelocity(this->getOrientation() * this->localAngularVelocity_);
+            this->setVelocity( this->getOrientation()*WorldEntity::FRONT*this->getVelocity().length() );
+            this->localAngularVelocity_ = 0;
+
+
+            if (this->fuel_)
+            {
+                if (this->destroyTimer_.getRemainingTime()<  (static_cast<float>(this->FUEL_PERCENTAGE)/100) *this->lifetime_ )
+                    this->fuel_=false;
+            } else
+                this->disableFire();
+
+            if( this->bDestroy_ )
+                this->destroy();
+        }
+
+    }
+
+    /**
+    * @brief Sets the Acceleration to 0 and detaches the fire
+    * @return void
+    */
+    void SimpleRocket::disableFire()
+    {
+        this->setAcceleration(0,0,0);
+        this->fire_->detachFromParent();
+    }
+
+    /**s
+    @brief
+        Destructor. Destroys controller, if present and kills sounds, if playing.
+    */
+    SimpleRocket::~SimpleRocket()
+    {
+        if (this->isInitialized())
+        {
+            if( GameMode::isMaster() )
+            {
+                this->getController()->destroy();
+            }
+        }
+    }
+
+    /**
+    @brief
+        Method for creating a SimpleRocket through XML.
+    */
+    void SimpleRocket::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        // this calls the XMLPort function of the parent class
+        SUPER(SimpleRocket, XMLPort, xmlelement, mode);
+    }
+
+    void SimpleRocket::setOwner(Pawn* owner)
+    {
+        this->owner_ = owner;
+        this->player_ = this->owner_->getPlayer();
+    }
+
+
+
+
+    bool SimpleRocket::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
+    {
+        if (!this->bDestroy_ && GameMode::isMaster())
+        {
+            if (otherObject == this->owner_)
+                return false;
+
+            this->bDestroy_ = true;
+
+            if (this->owner_)
+            {
+                {
+                    ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
+                    effect->setPosition(this->getPosition());
+                    effect->setOrientation(this->getOrientation());
+                    effect->setDestroyAfterLife(true);
+                    effect->setSource("Orxonox/explosion4");
+                    effect->setLifetime(2.0f);
+                }
+
+                {
+                    ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
+                    effect->setPosition(this->getPosition());
+                    effect->setOrientation(this->getOrientation());
+                    effect->setDestroyAfterLife(true);
+                    effect->setSource("Orxonox/smoke4");
+                    effect->setLifetime(3.0f);
+                }
+            }
+
+            float dmg = this->damage_;
+//             if (this->owner_)
+//                 dmg = this->owner_->getPickups().processModifiers(ModifierType::Damage, dmg, false);
+
+            Pawn* victim = orxonox_cast<Pawn*>(otherObject);
+            if (victim)
+                victim->hit(this->owner_, contactPoint, dmg);
+        }
+        return false;
+    }
+
+    void SimpleRocket::destroyObject()
+    {
+        if (GameMode::isMaster())
+        {
+            this->destroy();
+        }
+    }
+
+    /**
+    @brief
+        Rotates the SimpleRocket 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 SimpleRocket::rotateYaw(const Vector2& value)
+    {
+        ControllableEntity::rotateYaw(value);
+
+        if( !this->isInMouseLook() )
+            this->localAngularVelocity_.y += value.x;
+    }
+
+    /**
+    @brief
+        Rotates the SimpleRocket 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 SimpleRocket::rotatePitch(const Vector2& value)
+    {
+        ControllableEntity::rotatePitch(value);
+
+        if( !this->isInMouseLook() )
+            this->localAngularVelocity_.x += value.x;
+    }
+
+    /**
+    @brief
+        Rotates the SimpleRocket 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 SimpleRocket::rotateRoll(const Vector2& value)
+    {
+        ControllableEntity::rotateRoll(value);
+
+        if( !this->isInMouseLook() )
+            this->localAngularVelocity_.z += value.x;
+    }
+
+}
Index: code/trunk/src/modules/weapons/projectiles/SimpleRocket.h
===================================================================
--- code/trunk/src/modules/weapons/projectiles/SimpleRocket.h	(revision 7163)
+++ code/trunk/src/modules/weapons/projectiles/SimpleRocket.h	(revision 7163)
@@ -0,0 +1,143 @@
+/*
+ *   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:
+ *      Oliver Scheuss
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _SimpleRocket_H__
+#define _SimpleRocket_H__
+
+#include "weapons/WeaponsPrereqs.h"
+
+#include "tools/Timer.h"
+#include "worldentities/ControllableEntity.h"
+#include "graphics/ParticleSpawner.h"
+
+namespace orxonox
+{
+    class ConeCollisionShape;
+
+    /**
+    @brief
+        SimpleRocket, follows direction from a Rocketcontroller, has fuel for 80% of its lifetime, afterwards it's fire disappears.
+    @author
+       Gabriel Nadler (Original file: Oli Scheuss)
+    */
+    class _WeaponsExport SimpleRocket : public ControllableEntity
+    {
+        public:
+            SimpleRocket(BaseObject* creator);
+            virtual ~SimpleRocket();
+            virtual void tick(float dt);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a SimpleRocket through XML.
+
+            virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
+            void destroyObject();
+
+            void disableFire(); //!< Method to disable the fire and stop all acceleration
+
+            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);
+            void setDestroy();
+
+            /**
+            @brief Moves the SimpleRocket in the Front/Back-direction by the specifed amount.
+            @param value  The amount by which the SimpleRocket is to be moved.
+            */
+            inline void moveFrontBack(float value)
+            { this->moveFrontBack(Vector2(value, 0)); }
+            /**
+            @brief Moves the SimpleRocket in the Right/Left-direction by the specifed amount.
+            @param value  The amount by which the SimpleRocket is to be moved.
+            */
+            inline void moveRightLeft(float value)
+            { this->moveRightLeft(Vector2(value, 0)); }
+            /**
+            @brief Moves the SimpleRocket in the Up/Down-direction by the specifed amount.
+            @param value  The amount by which the SimpleRocket is to be moved.
+            */
+            inline void moveUpDown(float value)
+            { this->moveUpDown(Vector2(value, 0)); }
+
+            /**
+            @brief Rotates the SimpleRocket around the y-axis by the specifed amount.
+            @param value  The amount by which the SimpleRocket is to be rotated.
+            */
+            inline void rotateYaw(float value)
+            { this->rotateYaw(Vector2(value, 0)); }
+            /**
+            @brief Rotates the SimpleRocket around the x-axis by the specifed amount.
+            @param value  The amount by which the SimpleRocket is to be rotated.
+            */
+            inline void rotatePitch(float value)
+            {
+                this->rotatePitch(Vector2(value, 0)); }
+            /**
+            @brief Rotates the SimpleRocket around the z-axis by the specifed amount.
+            @param value  The amount by which the SimpleRocket is to be rotated.
+            */
+            inline void rotateRoll(float value)
+            {
+                this->rotateRoll(Vector2(value, 0)); }
+
+            void setOwner(Pawn* owner);
+            inline Pawn* getOwner() const
+                { return this->owner_; }
+            inline bool hasFuel() const
+            { return this->fuel_; }
+
+            inline void setDamage(float damage)
+                { this->damage_ = damage; }
+            inline float getDamage() const
+                { return this->damage_; }
+
+
+        private:
+            WeakPtr<Pawn> owner_;
+            Vector3 localAngularVelocity_;
+            float damage_;
+            bool bDestroy_;
+            bool fuel_; //!< Bool is true while the rocket "has fuel"
+
+
+            WeakPtr<PlayerInfo> player_;
+            Timer destroyTimer_;
+            float lifetime_;
+            static const int FUEL_PERCENTAGE=80; //!<Percentage of Lifetime the rocket has fuel
+
+            ParticleEmitter* fire_; //!< Fire-Emittor
+
+
+
+    };
+
+}
+
+#endif /* _SimpleRocket_H__ */
Index: code/trunk/src/modules/weapons/weaponmodes/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/CMakeLists.txt	(revision 6906)
+++ code/trunk/src/modules/weapons/weaponmodes/CMakeLists.txt	(revision 7163)
@@ -6,3 +6,4 @@
   LightningGun.cc
   RocketFire.cc
+  SimpleRocketFire.cc
 )
Index: code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.cc	(revision 7163)
+++ code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.cc	(revision 7163)
@@ -0,0 +1,77 @@
+/*
+ *   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:
+ *      Oliver Scheuss
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "SimpleRocketFire.h"
+
+#include "util/Math.h"
+#include "core/CoreIncludes.h"
+#include "weapons/RocketController.h"
+
+#include "weaponsystem/Weapon.h"
+#include "weaponsystem/WeaponPack.h"
+#include "weaponsystem/WeaponSystem.h"
+#include "worldentities/pawns/Pawn.h"
+#include "sound/WorldSound.h"
+
+namespace orxonox
+{
+
+    CreateFactory(SimpleRocketFire);
+
+    SimpleRocketFire::SimpleRocketFire(BaseObject* creator) : WeaponMode(creator)
+    {
+        RegisterObject(SimpleRocketFire);
+
+        this->reloadTime_ = 1;
+        this->bParallelReload_ = false;
+        this->damage_ = 100;
+        this->speed_ = 500;
+
+            this->setMunitionName("TargetSeeking Rockets");
+            this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.4);
+        // The firing sound of the Rocket is played in Rocket.cc (because of OpenAl sound positioning)
+    }
+
+    SimpleRocketFire::~SimpleRocketFire()
+    {
+    }
+
+    void SimpleRocketFire::fire()
+    {
+        RocketController* con = new RocketController(this);
+        SimpleRocket* rocket = con->getRocket();
+        this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
+        rocket->setOrientation(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getWorldOrientation());
+        rocket->setPosition(this->getMuzzlePosition());
+        rocket->setVelocity(this->getMuzzleDirection()*this->speed_);
+        rocket->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
+        rocket->setDamage(this->damage_);
+        WorldEntity* pawnn=static_cast<ControllableEntity*>(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn())->getTarget();
+        if (pawnn) con->setTarget(pawnn);
+    }
+}
Index: code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.h
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.h	(revision 7163)
+++ code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.h	(revision 7163)
@@ -0,0 +1,57 @@
+/*
+ *   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:
+ *      Oliver Scheuss
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _SimpleRocketFire_H__
+#define _SimpleRocketFire_H__
+
+#include "weapons/WeaponsPrereqs.h"
+#include "weaponsystem/WeaponMode.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        FireMode for target-seeking Rocket
+    @author
+        Gabriel Nadler (Original file: Oli Scheuss)
+    */
+    class _WeaponsExport SimpleRocketFire : public WeaponMode
+    {
+        public:
+            SimpleRocketFire(BaseObject* creator);
+            virtual ~SimpleRocketFire();
+            void deactivateFire();
+            virtual void fire();
+
+        private:
+            float speed_;
+
+    };
+}
+
+#endif /* _SimpleRocketFire_H__ */
