Index: code/branches/core3/src/core/BaseObject.h
===================================================================
--- code/branches/core3/src/core/BaseObject.h	(revision 1683)
+++ code/branches/core3/src/core/BaseObject.h	(revision 1684)
@@ -39,6 +39,7 @@
 #include "CorePrereqs.h"
 
+#include "Super.h"
+#include "OrxonoxClass.h"
 #include "util/XMLIncludes.h"
-#include "OrxonoxClass.h"
 
 namespace orxonox
@@ -65,5 +66,5 @@
 
             /** @brief Sets the state of the objects activity. @param bActive True = active */
-            inline void setActivity(bool bActive) { this->bActive_ = bActive; this->changedActivity(); }
+            inline void setActive(bool bActive) { this->bActive_ = bActive; this->changedActivity(); }
             /** @brief Returns the state of the objects activity. @return The state of the activity */
             inline bool isActive() const { return this->bActive_; }
@@ -72,5 +73,5 @@
 
             /** @brief Sets the state of the objects visibility. @param bVisible True = visible */
-            inline void setVisibility(bool bVisible) { this->bVisible_ = bVisible; this->changedVisibility(); }
+            inline void setVisible(bool bVisible) { this->bVisible_ = bVisible; this->changedVisibility(); }
             /** @brief Returns the state of the objects visibility. @return The state of the visibility */
             inline bool isVisible() const { return this->bVisible_; }
@@ -101,4 +102,8 @@
             Namespace* namespace_;
     };
+
+    SUPER_FUNCTION(1, BaseObject, XMLPort, false);
+    SUPER_FUNCTION(3, BaseObject, changedActivity, false);
+    SUPER_FUNCTION(4, BaseObject, changedVisibility, false);
 }
 
Index: code/branches/core3/src/core/Identifier.h
===================================================================
--- code/branches/core3/src/core/Identifier.h	(revision 1683)
+++ code/branches/core3/src/core/Identifier.h	(revision 1684)
@@ -304,5 +304,5 @@
     class ClassIdentifier : public Identifier
     {
-        #define SUPER_INTRUSIVE_DECLARATION
+        #define SUPER_INTRUSIVE_DECLARATION_INCLUDE
         #include "Super.h"
 
@@ -320,10 +320,10 @@
             ClassIdentifier()
             {
-                #define SUPER_INTRUSIVE_CONSTRUCTOR
+                #define SUPER_INTRUSIVE_CONSTRUCTOR_INCLUDE
                 #include "Super.h"
             }
             ~ClassIdentifier()
             {
-                #define SUPER_INTRUSIVE_DESTRUCTOR
+                #define SUPER_INTRUSIVE_DESTRUCTOR_INCLUDE
                 #include "Super.h"
             }
Index: code/branches/core3/src/core/Namespace.cc
===================================================================
--- code/branches/core3/src/core/Namespace.cc	(revision 1683)
+++ code/branches/core3/src/core/Namespace.cc	(revision 1684)
@@ -60,5 +60,6 @@
     void Namespace::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
-        BaseObject::XMLPort(xmlelement, mode);
+//        BaseObject::XMLPort(xmlelement, mode);
+        SUPER(Namespace, XMLPort, xmlelement, mode);
 
         std::string name = this->getName();
Index: code/branches/core3/src/core/Super.h
===================================================================
--- code/branches/core3/src/core/Super.h	(revision 1683)
+++ code/branches/core3/src/core/Super.h	(revision 1684)
@@ -27,4 +27,49 @@
  */
 
+/**
+    @file Super.h
+    @brief Definition of all super-function related macros.
+
+    This file defines all macros needed to add a new "super-function".
+    If you add a super-function, you can call SUPER(myclass, functionname) inside your
+    code and the function of the parentclass gets called. This is comparable with
+    super.functionname() in Java or other languages.
+
+    This works only with virtual functions that return nothing (void) and belong to
+    classes that have an Identifier. Arguments however are supported.
+
+    To add a new super-function, you have process 6 steps:
+
+    1) Add a new SUPER macro
+       This allows you to call the super-function in your code.
+       Location: This file (Super.h), marked with --> HERE <-- comments (1/5)
+
+    2) Call the SUPER_FUNCTION_GLOBAL_DECLARATION_PART1/2 macros.
+       This defines some global classes and templates, needed to create and call the super-functions.
+       Location: This file (Super.h), marked with --> HERE <-- comments (2/5)
+
+    3) Call the SUPER_INTRUSIVE_DECLARATION macro.
+       This will be included into the declaration of ClassIdentifier<T>.
+       Location: This file (Super.h), marked with --> HERE <-- comments (3/5)
+
+    4) Call the SUPER_INTRUSIVE_CONSTRUCTOR macro.
+       This will be included into the constructor of ClassIdentifier<T>.
+       Location: This file (Super.h), marked with --> HERE <-- comments (4/5)
+
+    5) Call the SUPER_INTRUSIVE_DESTRUCTOR macro.
+       This will be included into the destructor of ClassIdentifier<T>.
+       Location: This file (Super.h), marked with --> HERE <-- comments (5/5)
+
+    6) Call the SUPER_FUNCTION macro.
+       This defines a partially specialized template that will decide if a class is "super" to another class.
+       If the check returns true, a SuperFunctionCaller gets created, which will be used by the SUPER macro.
+       You have to add this into the header-file of the baseclass of the super-function (the class that first
+       implements the function), below the class declaration. You can't call it directly in this file, because
+       otherwise you had to include the headerfile right here, which would cause some ugly backdependencies,
+       include loops and slower compilation.
+       Dont forget to include Super.h in the header-file.
+       Location: The header-file of the baseclass (Baseclass.h), below the class declaration
+*/
+
 #ifndef _Super_H__
 #define _Super_H__
@@ -32,109 +77,417 @@
 #include <iostream>
 
-//////////////////
-// Common macro //
-//////////////////
-#define SUPER(classname, functionname, ...) \
-    SUPER_##functionname(classname, functionname, __VA_ARGS__)
-
-/////////////////////////////
-// Function-specific macro //
-/////////////////////////////
-#define SUPER_testfunction(classname, functionname, ...) \
-    (*ClassIdentifier<classname>::getIdentifier()->superFunctionCaller_##functionname##_)(this)
+#include "CorePrereqs.h"
+
+#include "util/Debug.h"
+#include "util/XMLIncludes.h"
+
+///////////////////////
+// Macro definitions //
+///////////////////////
+
+//// Common macros ////
+
+    /**
+        @brief Declares a new super-function by creating a specialized template. Add this below the class declaration of the baseclass.
+        @param functionnumber Each super-function needs a unique number, starting with zero, increasing by one
+        @param baseclass The baseclass of the super-function (~the root)
+        @param functionname The name of the super-function
+        @param purevirtualbase "true" if the function is pure virtual in the baseclass, "false" if the function is implemented (without "")
+    */
+    #define SUPER_FUNCTION(functionnumber, baseclass, functionname, purevirtualbase) \
+        template <class T, int templatehack2> \
+        struct SuperFunctionCondition<functionnumber, T, 0, templatehack2> \
+        { \
+            static void check() \
+            { \
+                SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply((T*)0); \
+                SuperFunctionCondition<functionnumber + 1, T, 0, templatehack2>::check(); \
+            } \
+            \
+            static void apply(void* temp) {} \
+            static void apply(baseclass* temp) \
+            { \
+                ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier(); \
+                for (std::set<const Identifier*>::iterator it = identifier->getDirectChildrenIntern().begin(); it != identifier->getDirectChildrenIntern().end(); ++it) \
+                { \
+                    if (!((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_) \
+                    { \
+                        COUT(0) << "Added SuperFunctionCaller for " << #functionname << ": " << ClassIdentifier<T>::getIdentifier()->getName() << " <- " << ((ClassIdentifier<T>*)(*it))->getName() << std::endl; \
+                        ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>; \
+                    } \
+                } \
+            } \
+        }; \
+        \
+        SUPER_FUNCTION_PUREVIRTUAL_WORKAROUND##purevirtualbase(functionnumber, baseclass)
+
+    #define SUPER_FUNCTION_PUREVIRTUAL_WORKAROUND0(functionnumber, baseclass) SUPER_FUNCTION_PUREVIRTUAL_WORKAROUNDfalse(functionnumber, baseclass)
+    #define SUPER_FUNCTION_PUREVIRTUAL_WORKAROUND1(functionnumber, baseclass) SUPER_FUNCTION_PUREVIRTUAL_WORKAROUNDtrue(functionnumber, baseclass)
+    #define SUPER_FUNCTION_PUREVIRTUAL_WORKAROUNDfalse(functionnumber, baseclass)
+    #define SUPER_FUNCTION_PUREVIRTUAL_WORKAROUNDtrue(functionnumber, baseclass) \
+        template <int templatehack2> \
+        struct SuperFunctionCondition<functionnumber, baseclass, 0, templatehack2> \
+        { \
+            static void check() \
+            { \
+                SuperFunctionCondition<functionnumber + 1, baseclass, 0, templatehack2>::check(); \
+            } \
+        };
+
+
+    /*
+    //// Comments about the macro ////
+
+        // Partially specialized template (templatehack is now specialized too).
+        //
+        // This ensures the compiler takes THIS template if the header-file of the super-function
+        // is included. In any other case, the compiler just uses the fallback template which is
+        // defined in this file.
+        template <class T, templatehack2>
+        struct SuperFunctionCondition<functionnumber, T, 0, templatehack2>
+        {
+            static void check()
+            {
+                // This call to the apply-function is the whole check. By calling the function with
+                // a T* pointer, the right function get's called.
+                SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply((T*)0);
+
+                // Go go the check for of next super-function (functionnumber + 1)
+                SuperFunctionCondition<functionnumber + 1, T, 0, templatehack2>::check();
+            }
+
+            // This function gets called if T is not a child of the baseclass.
+            // The function does nothing.
+            static void apply(void* temp) {}
+
+            // This function gets called if T is a child of the baseclass and can therefore be converted.
+            // The function adds a SuperFunctionCaller to the Identifier of all subclasses of T.
+            static void apply(baseclass* temp)
+            {
+                ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier();
+
+                // Iterate through all children
+                for (std::set<const Identifier*>::iterator it = identifier->getDirectChildrenIntern().begin(); it != identifier->getDirectChildrenIntern().end(); ++it)
+                {
+                    // Check if there's not already a caller
+                    if (!((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_)
+                    {
+                        // Add the SuperFunctionCaller
+                        COUT(5) << "adding functionpointer to " << ((ClassIdentifier<T>*)(*it))->getName() << std::endl;
+                        ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>;
+                    }
+                }
+            }
+        };
+        SUPER_FUNCTION_PUREVIRTUAL_WORKAROUND##purevirtualbase
+
+
+        // The following piece of code is only added if purevirtualbase = true
+
+        // Explicit specialization of the Condition template for the baseclass to avoid
+        // errors if the function is pure virtual in the baseclass.
+        template <int templatehack2> \
+        struct SuperFunctionCondition<functionnumber, baseclass, 0, templatehack2> \
+        { \
+            // The check function just behaves like the fallback - it advances to the check for the next super-function (functionnumber + 1)
+            static void check() \
+            { \
+                SuperFunctionCondition<functionnumber + 1, baseclass, 0, templatehack2>::check(); \
+            } \
+        };
+    */
+
+    // SUPER-macro: Calls Parent::functionname() where Parent is the direct parent of classname
+    #define SUPER(classname, functionname, ...) \
+        SUPER_##functionname(classname, functionname, __VA_ARGS__)
+
+    // helper macro: for functions without arguments
+    #define SUPER_NOARGS(classname, functionname) \
+        (*ClassIdentifier<classname>::getIdentifier()->superFunctionCaller_##functionname##_)(this)
+
+    // helper macro: for functions with arguments
+    #define SUPER_ARGS(classname, functionname, ...) \
+        (*ClassIdentifier<classname>::getIdentifier()->superFunctionCaller_##functionname##_)(this, __VA_ARGS__)
+
+
+//// Function-specific macros ////
+
+    /*
+        Add a macro for each super-function
+
+        Example (no arguments):
+        #define SUPER_myfunction(classname, functionname, ...) \
+            SUPER_NOARGS(classname, functionname)
+
+        Example (with arguments):
+        #define SUPER_myfunction(classname, functionname, ...) \
+            SUPER_ARGS(classname, functionname, __VA_ARGS__)
+    */
+
+    // (1/5) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
+    #define SUPER_testfunction(classname, functionname, ...) \
+        SUPER_NOARGS(classname, functionname)
+
+    #define SUPER_XMLPort(classname, functionname, ...) \
+        SUPER_ARGS(classname, functionname, __VA_ARGS__)
+
+    #define SUPER_tick(classname, functionname, ...) \
+        SUPER_ARGS(classname, functionname, __VA_ARGS__)
+
+    #define SUPER_changedActivity(classname, functionname, ...) \
+        SUPER_NOARGS(classname, functionname)
+
+    #define SUPER_changedVisibility(classname, functionname, ...) \
+        SUPER_NOARGS(classname, functionname)
+    // (1/5) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
+
 
 namespace orxonox
 {
-    /////////////////
-    // Common code //
-    /////////////////
-    class SuperDummy {};
-
-    // Base template
-    template <int functionnumber, int templatehack, class T>
-    struct SuperFunctionCondition
-    {
-        static void check() {}
-    };
-
-    ////////////////////////////
-    // Function-specific code //
-    ////////////////////////////
-    // Partially specialized template (templatehack not yet specialized, this will be done by the real condition in the header file of the super-function)
-    template <int templatehack, class T>
-    struct SuperFunctionCondition<0, templatehack, T>
-    {
-        // Calls the condition of the next super-function
-        static void check()
-        {
-            std::cout << "ignore superfunction \"testfunction\" in " << ClassIdentifier<T>::getIdentifier()->getName() << std::endl;
-            SuperFunctionCondition<0 + 1, templatehack, T>::check();
+    /////////////////////////////////////////////////////////////////////////////////////////////////////
+    // This code gets included by Identifier.h and every other header file that needs a super-function //
+    /////////////////////////////////////////////////////////////////////////////////////////////////////
+
+    //// Common code ////
+
+        // Dummy - only needed to cast Identifier* to ClassIdentifier<SuperDummy>* (the real class doesn't matter)
+        class SuperDummy {};
+
+        // Base template
+        template <int functionnumber, class T, int templatehack1, int templatehack2>
+        struct SuperFunctionCondition
+        {
+            static void check() {}
+        };
+
+
+    //// Function-specific code ////
+
+        /**
+            @brief Creates the needed objects and templates to call a super-function.
+            @param functionnumber Each super-function needs a unique number, starting with zero, increasing by one
+            @param functionname The name of the super-function
+            @param hasarguments "false" if the function doesn't take any arguments, "true" if it does (without "")
+            @param ... Variadic: If the function takes arguments, add them here with type and name. Example: int myvalue, float myothervalue
+        */
+        #define SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(functionnumber, functionname, hasarguments, ...) \
+            template <class T, int templatehack1, int templatehack2> \
+            struct SuperFunctionCondition<functionnumber, T, templatehack1, templatehack2> \
+            { \
+                static void check() \
+                { \
+                    SuperFunctionCondition<functionnumber + 1, T, templatehack1, templatehack2>::check(); \
+                } \
+            }; \
+            \
+            class _CoreExport SuperFunctionCaller_##functionname \
+            { \
+                public: \
+                    virtual void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) ) = 0; \
+                    virtual ~SuperFunctionCaller_##functionname () {} \
+            }; \
+            \
+            template <class T> \
+            class SuperFunctionClassCaller_##functionname : public SuperFunctionCaller_##functionname \
+            { \
+                public: \
+                    inline void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) ) \
+                    { \
+                        (dynamic_cast<T*>(object))->T:: functionname
+
+        /*
+            JUST ADD THE FUNCTION ARGUMENTS BETWEEN BOTH MACROS, ENCLOSED BY BRACKETS
+            EXAMPLE:
+
+              SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(0, myfunction, true, int myvalue, float myothervalue) <-- !!! DONT ADD A SEMICOLON HERE !!!
+                (myvalue, myothervalue)
+              SUPER_FUNCTION_GLOBAL_DECLARATION_PART2
+        */
+
+        #define SUPER_FUNCTION_GLOBAL_DECLARATION_PART2 \
+                                                        ; \
+                    } \
+            };
+
+        #define SUPER_CALL_ARGUMENTSfalse(...) OrxonoxClass* object
+        #define SUPER_CALL_ARGUMENTS0(...)     OrxonoxClass* object
+        #define SUPER_CALL_ARGUMENTStrue(...) OrxonoxClass* object, __VA_ARGS__
+        #define SUPER_CALL_ARGUMENTS1(...)    OrxonoxClass* object, __VA_ARGS__
+
+
+    /*
+    //// COMMENTS ABOUT THE MACRO ////
+
+        // Partially specialized template (templatehack not yet specialized, this
+        // will be done by the real condition in the header-file of the super-function)
+        // Only used as fallback
+        template <class T, int templatehack1, int templatehack2>
+        struct SuperFunctionCondition<functionnumber, T, templatehack1, templatehack2>
+        {
+            // If this function gets called, the header-file of the super function is not
+            // included, so this fallback template (templatehack not specialized) is used
+            static void check()
+            {
+                // Calls the condition-check of the next super-function (functionnumber + 1)
+                SuperFunctionCondition<functionnumber + 1, T, templatehack1, templatehack2>::check();
+            }
+        };
+
+        // Baseclass of the super-function caller. The real call will be done by a
+        // templatized subclass through the virtual () operator.
+        class _CoreExport SuperFunctionCaller_##functionname
+        {
+            public:
+                virtual void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) ) = 0;
+                virtual ~SuperFunctionCaller_##functionname () {}
+        };
+
+        // The real super-function caller: Calls T::functionname()
+        // T should be the parent, but this will be done by the spezialized condition template
+        template <class T>
+        class SuperFunctionClassCaller_##functionname : public SuperFunctionCaller_##functionname
+        {
+            public:
+                // @brief Calls the function.
+                // @param object The object to call the function on
+                // @param ... The arguments of the function
+                inline void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) )
+                {
+                    (dynamic_cast<T*>(object))->T:: functionname ( Call the function with it's arguments );
+                }
         }
-    };
-
-    class SuperFunctionCaller_testfunction
-    {
-        public:
-            virtual void operator()(void* object) = 0;
-            virtual ~SuperFunctionCaller_testfunction() {}
-    };
-
-    template <class T>
-    class SuperFunctionClassCaller_testfunction : public SuperFunctionCaller_testfunction
-    {
-        public:
-            inline void operator()(void* object)
-            {
-                ((T*)object)->T::testfunction();
-            }
-    };
+    */
+
+    //// Execute the code for each super-function ////
+        // (2/5) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(0, testfunction, false)
+            ()
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
+
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(1, XMLPort, true, Element& xmlelement, XMLPort::Mode mode)
+            (xmlelement, mode)
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
+
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(2, tick, true, float dt)
+            (dt)
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
+
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(3, changedActivity, false)
+            ()
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
+
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(4, changedVisibility, false)
+            ()
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
+        // (2/5) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
+
 }
 
 #else /* _Super_H__ */
-  #ifdef SUPER_INTRUSIVE_DECLARATION
-
-/////////////////
-// Common code //
-/////////////////
-private:
-    template <int functionnumber, int templatehack, class TT>
-    friend struct SuperFunctionCondition;
-
-    // Creates the function pointers by calling the first SuperFunctionCondition check
-    virtual void createSuperFunctionCaller() const
-    {
-        SuperFunctionCondition<0, 0, T>::check();
-    }
-
-////////////////////////////
+  #ifdef SUPER_INTRUSIVE_DECLARATION_INCLUDE
+
+//////////////////////////////////////////////////////////////////////////
+// This code gets included within the declaration of ClassIdentifier<T> //
+//////////////////////////////////////////////////////////////////////////
+
+//// Common code ////
+
+    private:
+        template <int functionnumber, class TT, int templatehack1, int templatehack2>
+        friend struct SuperFunctionCondition;
+
+        // Creates the super-function-callers by calling the first SuperFunctionCondition check
+        // This get's called within the initialization of an Identifier
+        virtual void createSuperFunctionCaller() const
+        {
+            SuperFunctionCondition<0, T, 0, 0>::check();
+        }
+
+
+//// Function-specific code ////
+
+    public:
+        /**
+            @brief Adds a pointer to the SuperFunctionCaller as a member of ClassIdentifier.
+            @param functionname The name of the super-function
+        */
+        #ifndef SUPER_INTRUSIVE_DECLARATION
+          #define SUPER_INTRUSIVE_DECLARATION(functionname) \
+            SuperFunctionCaller_##functionname * superFunctionCaller_##functionname##_
+        #endif
+
+
+//// Execute the code for each super-function ////
+    // (3/5) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
+    SUPER_INTRUSIVE_DECLARATION(testfunction);
+    SUPER_INTRUSIVE_DECLARATION(XMLPort);
+    SUPER_INTRUSIVE_DECLARATION(tick);
+    SUPER_INTRUSIVE_DECLARATION(changedActivity);
+    SUPER_INTRUSIVE_DECLARATION(changedVisibility);
+    // (3/5) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
+
+
+    #undef SUPER_INTRUSIVE_DECLARATION_INCLUDE
+  #endif /* SUPER_INTRUSIVE_DECLARATION_INCLUDE */
+
+  #ifdef SUPER_INTRUSIVE_CONSTRUCTOR_INCLUDE
+
+//////////////////////////////////////////////////////////////////////////
+// This code gets included inside the constructor of ClassIdentifier<T> //
+//////////////////////////////////////////////////////////////////////////
+
 // Function-specific code //
-////////////////////////////
-public:
-    // The function caller
-    SuperFunctionCaller_testfunction* superFunctionCaller_testfunction_;
-
-    #undef SUPER_INTRUSIVE_DECLARATION
-  #endif /* SUPER_INTRUSIVE_DECLARATION */
-
-  #ifdef SUPER_INTRUSIVE_CONSTRUCTOR
-
-////////////////////////////
+
+    /**
+        @brief Initializes the SuperFunctionCaller pointer with zero.
+        @param functionname The name of the super-function
+    */
+    #ifndef SUPER_INTRUSIVE_CONSTRUCTOR
+      #define SUPER_INTRUSIVE_CONSTRUCTOR(functionname) \
+        this->superFunctionCaller_##functionname##_ = 0
+    #endif
+
+
+//// Execute the code for each super-function ////
+    // (4/5) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
+    SUPER_INTRUSIVE_CONSTRUCTOR(testfunction);
+    SUPER_INTRUSIVE_CONSTRUCTOR(XMLPort);
+    SUPER_INTRUSIVE_CONSTRUCTOR(tick);
+    SUPER_INTRUSIVE_CONSTRUCTOR(changedActivity);
+    SUPER_INTRUSIVE_CONSTRUCTOR(changedVisibility);
+    // (4/5) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
+
+    #undef SUPER_INTRUSIVE_CONSTRUCTOR_INCLUDE
+  #endif /* SUPER_INTRUSIVE_CONSTRUCTOR_INCLUDE */
+
+  #ifdef SUPER_INTRUSIVE_DESTRUCTOR_INCLUDE
+
+/////////////////////////////////////////////////////////////////////////
+// This code gets included inside the destructor of ClassIdentifier<T> //
+/////////////////////////////////////////////////////////////////////////
+
 // Function-specific code //
-////////////////////////////
-this->superFunctionCaller_testfunction_ = 0;
-
-    #undef SUPER_INTRUSIVE_CONSTRUCTOR
-  #endif /* SUPER_INTRUSIVE_CONSTRUCTOR */
-
-  #ifdef SUPER_INTRUSIVE_DESTRUCTOR
-
-////////////////////////////
-// Function-specific code //
-////////////////////////////
-
-if (this->superFunctionCaller_testfunction_)
-    delete this->superFunctionCaller_testfunction_;
-
-    #undef SUPER_INTRUSIVE_DESTRUCTOR
-  #endif /* SUPER_INTRUSIVE_DESTRUCTOR */
+
+    /**
+        @brief Deletes the SuperFunctionCaller.
+        @param functionname The name of the super-function
+    */
+    #ifndef SUPER_INTRUSIVE_DESTRUCTOR
+      #define SUPER_INTRUSIVE_DESTRUCTOR(functionname) \
+        if (this->superFunctionCaller_##functionname##_) \
+          delete this->superFunctionCaller_##functionname##_
+    #endif
+
+
+//// Execute the code for each super-function ////
+    // (5/5) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
+    SUPER_INTRUSIVE_DESTRUCTOR(testfunction);
+    SUPER_INTRUSIVE_DESTRUCTOR(XMLPort);
+    SUPER_INTRUSIVE_DESTRUCTOR(tick);
+    SUPER_INTRUSIVE_DESTRUCTOR(changedActivity);
+    SUPER_INTRUSIVE_DESTRUCTOR(changedVisibility);
+    // (5/5) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
+
+    #undef SUPER_INTRUSIVE_DESTRUCTOR_INCLUDE
+  #endif /* SUPER_INTRUSIVE_DESTRUCTOR_INCLUDE */
 #endif /* _Super_H__ */
Index: code/branches/core3/src/orxonox/objects/Ambient.cc
===================================================================
--- code/branches/core3/src/orxonox/objects/Ambient.cc	(revision 1683)
+++ code/branches/core3/src/orxonox/objects/Ambient.cc	(revision 1684)
@@ -89,5 +89,6 @@
     void Ambient::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
-        BaseObject::XMLPort(xmlelement, mode);
+//        BaseObject::XMLPort(xmlelement, mode);
+        SUPER(Ambient, XMLPort, xmlelement, mode);
 
         XMLPortParam(Ambient, "colourvalue", setAmbientLight, getAmbienetLight, xmlelement, mode);
Index: code/branches/core3/src/orxonox/objects/BillboardProjectile.cc
===================================================================
--- code/branches/core3/src/orxonox/objects/BillboardProjectile.cc	(revision 1683)
+++ code/branches/core3/src/orxonox/objects/BillboardProjectile.cc	(revision 1684)
@@ -67,5 +67,6 @@
     void BillboardProjectile::changedVisibility()
     {
-        Projectile::changedVisibility();
+//        Projectile::changedVisibility();
+        SUPER(BillboardProjectile, changedVisibility);
         this->billboard_.setVisible(this->isVisible());
     }
Index: code/branches/core3/src/orxonox/objects/BillboardProjectile.h
===================================================================
--- code/branches/core3/src/orxonox/objects/BillboardProjectile.h	(revision 1683)
+++ code/branches/core3/src/orxonox/objects/BillboardProjectile.h	(revision 1684)
@@ -38,5 +38,47 @@
 namespace orxonox
 {
-    class _OrxonoxExport BillboardProjectile : public Projectile
+    class TESTTESTTEST1
+    {
+        public:
+            TESTTESTTEST1() { this->setMyValue(10); }
+
+        private:
+            void setMyValue(int value) { this->value1_ = value; }
+
+            int value1_;
+            int value2_;
+            Identifier* identifier_;
+    };
+
+    class TESTTESTTEST2
+    {
+        public:
+            TESTTESTTEST2() { this->setMyValue(10); }
+
+        private:
+            void setMyValue(int value) { this->value1_ = value; }
+
+            int value1_;
+            int value2_;
+            double value3_;
+            char value4_;
+            bool value5_;
+            Identifier* identifier1_;
+            Identifier* identifier2_;
+    };
+
+    class TESTTESTTEST3 : virtual public TESTTESTTEST1
+    {
+        public:
+            TESTTESTTEST3() { this->setMyOtherValue(10); }
+
+        private:
+            void setMyOtherValue(int value) { this->value3_ = value; }
+
+            int value3_;
+            TESTTESTTEST2* test_;
+    };
+
+    class _OrxonoxExport BillboardProjectile : public Projectile, public TESTTESTTEST3, public TESTTESTTEST2, virtual public TESTTESTTEST1
     {
         public:
Index: code/branches/core3/src/orxonox/objects/Model.cc
===================================================================
--- code/branches/core3/src/orxonox/objects/Model.cc	(revision 1683)
+++ code/branches/core3/src/orxonox/objects/Model.cc	(revision 1684)
@@ -66,5 +66,6 @@
     void Model::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
-        WorldEntity::XMLPort(xmlelement, mode);
+//        WorldEntity::XMLPort(xmlelement, mode);
+        SUPER(Model, XMLPort, xmlelement, mode);
 
         XMLPortParam(Model, "mesh", setMesh, getMesh, xmlelement, mode);
@@ -72,5 +73,17 @@
         Model::create();
     }
+/*
+    void Model::tick(float dt)
+    {
+        float i = dt * rnd(-100, 100);
+        float j = dt * rnd(-100, 100);
+        float k = dt * rnd(-100, 100);
 
+//        WorldEntity::tick(dt);
+        SUPER(Model, tick, dt);
+
+        this->setPosition(this->getPosition().x + i, this->getPosition().y + j, this->getPosition().z + k);
+    }
+*/
     bool Model::create(){
       if(!WorldEntity::create())
@@ -94,5 +107,6 @@
     void Model::changedVisibility()
     {
-        WorldEntity::changedVisibility();
+//        WorldEntity::changedVisibility();
+        SUPER(Model, changedVisibility);
         this->mesh_.setVisible(this->isVisible());
     }
Index: code/branches/core3/src/orxonox/objects/Model.h
===================================================================
--- code/branches/core3/src/orxonox/objects/Model.h	(revision 1683)
+++ code/branches/core3/src/orxonox/objects/Model.h	(revision 1684)
@@ -44,4 +44,5 @@
             virtual ~Model();
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+//            virtual void tick(float dt);
             virtual void changedVisibility();
             inline void setMesh(const std::string& meshname)
Index: code/branches/core3/src/orxonox/objects/ParticleProjectile.cc
===================================================================
--- code/branches/core3/src/orxonox/objects/ParticleProjectile.cc	(revision 1683)
+++ code/branches/core3/src/orxonox/objects/ParticleProjectile.cc	(revision 1684)
@@ -33,39 +33,8 @@
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
-//#include "util/FastDelegate.h"
-//using namespace fastdelegate;
 
 namespace orxonox
 {
     CreateFactory(ParticleProjectile);
-
-    struct FunctionPointerViewer
-    {
-        void* ptr1_;
-        void* ptr2_;
-
-        void view()
-        {
-            std::cout << ptr1_ << "." << ptr2_ << std::endl;
-        }
-    };
-
-    union FunctionPointerViewer1
-    {
-        FunctionPointerViewer viewer_;
-        void (Projectile::*function_) ();
-    };
-
-    union FunctionPointerViewer2
-    {
-        FunctionPointerViewer viewer_;
-        void (BillboardProjectile::*function_) ();
-    };
-
-    union FunctionPointerViewer3
-    {
-        FunctionPointerViewer viewer_;
-        void (ParticleProjectile::*function_) ();
-    };
 
     ParticleProjectile::ParticleProjectile(SpaceShip* owner) : BillboardProjectile(owner)
@@ -86,52 +55,5 @@
 
         this->setConfigValues();
-/*
-        FunctionPointerViewer1 fpw1;
-        fpw1.function_ = &Projectile::testfunction;
-        FunctionPointerViewer2 fpw2;
-        fpw2.function_ = &BillboardProjectile::testfunction;
-        FunctionPointerViewer3 fpw3;
-        fpw3.function_ = &ParticleProjectile::testfunction;
 
-        std::cout << sizeof(void (Projectile::*) ()) << std::endl;
-        fpw1.viewer_.view();
-        fpw2.viewer_.view();
-        fpw3.viewer_.view();
-
-        {
-            std::cout << "1:" << std::endl;
-            FastDelegate0<> delegate1(this, &ParticleProjectile::testfunction);
-            delegate1();
-            FastDelegate0<> delegate2((BillboardProjectile*)this, &BillboardProjectile::testfunction);
-            delegate2();
-            FastDelegate0<> delegate3(this, &Projectile::testfunction);
-            delegate3();
-        }
-        {
-            std::cout << "2:" << std::endl;
-            BillboardProjectile temp;
-//            FastDelegate0<> delegate1(&temp, &ParticleProjectile::testfunction);
-//            delegate1();
-            FastDelegate0<> delegate2(&temp, &BillboardProjectile::testfunction);
-            delegate2();
-            FastDelegate0<> delegate3(&temp, &Projectile::testfunction);
-            delegate3();
-        }
-        std::cout << "done" << std::endl;
-
-        std::cout << "0:" << std::endl;
-        this->Projectile::testfunction();
-        this->BillboardProjectile::testfunction();
-        this->ParticleProjectile::testfunction();
-        this->testfunction();
-
-        std::cout << "1:" << std::endl;
-        (this->*fpw1.function_)();
-        std::cout << "2:" << std::endl;
-        (this->*fpw2.function_)();
-        std::cout << "3:" << std::endl;
-        (this->*fpw3.function_)();
-        std::cout << "done" << std::endl;
-*/
         std::cout << "c:\n";
         SUPER(ParticleProjectile, testfunction);
@@ -141,6 +63,4 @@
         this->testfunction();
         std::cout << "f:\n";
-
-//        (*((ClassIdentifier<SuperDummy>*)this->getIdentifier())->superFunctionCaller_testfunction_)(this);
     }
 
@@ -158,5 +78,6 @@
     void ParticleProjectile::changedVisibility()
     {
-        BillboardProjectile::changedVisibility();
+//        BillboardProjectile::changedVisibility();
+        SUPER(ParticleProjectile, changedVisibility);
         this->particles_->setEnabled(this->isVisible());
     }
Index: code/branches/core3/src/orxonox/objects/ParticleProjectile.h
===================================================================
--- code/branches/core3/src/orxonox/objects/ParticleProjectile.h	(revision 1683)
+++ code/branches/core3/src/orxonox/objects/ParticleProjectile.h	(revision 1684)
@@ -38,5 +38,47 @@
 namespace orxonox
 {
-    class _OrxonoxExport ParticleProjectile : public BillboardProjectile
+    class TESTTESTTEST13
+    {
+        public:
+            TESTTESTTEST13() { this->setMyValue(10); }
+
+        private:
+            void setMyValue(int value) { this->value1_ = value; }
+
+            int value1_;
+            int value2_;
+            Identifier* identifier_;
+    };
+
+    class TESTTESTTEST23
+    {
+        public:
+            TESTTESTTEST23() { this->setMyValue(10); }
+
+        private:
+            void setMyValue(int value) { this->value1_ = value; }
+
+            int value1_;
+            int value2_;
+            double value3_;
+            char value4_;
+            bool value5_;
+            Identifier* identifier1_;
+            Identifier* identifier2_;
+    };
+
+    class TESTTESTTEST33 : virtual public TESTTESTTEST13
+    {
+        public:
+            TESTTESTTEST33() { this->setMyOtherValue(10); }
+
+        private:
+            void setMyOtherValue(int value) { this->value3_ = value; }
+
+            int value3_;
+            TESTTESTTEST23* test_;
+    };
+
+    class _OrxonoxExport ParticleProjectile : public TESTTESTTEST33, public BillboardProjectile, virtual public TESTTESTTEST13
     {
         public:
Index: code/branches/core3/src/orxonox/objects/Projectile.cc
===================================================================
--- code/branches/core3/src/orxonox/objects/Projectile.cc	(revision 1683)
+++ code/branches/core3/src/orxonox/objects/Projectile.cc	(revision 1684)
@@ -86,5 +86,6 @@
     void Projectile::tick(float dt)
     {
-        WorldEntity::tick(dt);
+//        WorldEntity::tick(dt);
+        SUPER(Projectile, tick, dt);
 
         if (!this->isActive())
Index: code/branches/core3/src/orxonox/objects/Projectile.h
===================================================================
--- code/branches/core3/src/orxonox/objects/Projectile.h	(revision 1683)
+++ code/branches/core3/src/orxonox/objects/Projectile.h	(revision 1684)
@@ -32,12 +32,53 @@
 #include "OrxonoxPrereqs.h"
 
+#include "core/Super.h"
 #include "WorldEntity.h"
 #include "tools/Timer.h"
-#undef SUPER_INTRUSIVE
-#include "core/Super.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport Projectile : public WorldEntity
+    class TESTTESTTEST12
+    {
+        public:
+            TESTTESTTEST12() { this->setMyValue(10); }
+
+        private:
+            void setMyValue(int value) { this->value1_ = value; }
+
+            int value1_;
+            int value2_;
+            Identifier* identifier_;
+    };
+
+    class TESTTESTTEST22
+    {
+        public:
+            TESTTESTTEST22() { this->setMyValue(10); }
+
+        private:
+            void setMyValue(int value) { this->value1_ = value; }
+
+            int value1_;
+            int value2_;
+            double value3_;
+            char value4_;
+            bool value5_;
+            Identifier* identifier1_;
+            Identifier* identifier2_;
+    };
+
+    class TESTTESTTEST32 : virtual public TESTTESTTEST12
+    {
+        public:
+            TESTTESTTEST32() { this->setMyOtherValue(10); }
+
+        private:
+            void setMyOtherValue(int value) { this->value3_ = value; }
+
+            int value3_;
+            TESTTESTTEST22* test_;
+    };
+
+    class _OrxonoxExport Projectile : public TESTTESTTEST22, public TESTTESTTEST32, virtual public TESTTESTTEST12, public WorldEntity
     {
         public:
@@ -68,44 +109,5 @@
     };
 
-    // Partially specialized template (templatehack is now specialized too)
-    template <class T>
-    struct SuperFunctionCondition<0, 0, T>
-    {
-        // Checks if class U isA baseclass and sets the functionpointer if the check returned true
-        static void check()
-        {
-            std::cout << "check superfunction \"testfunction\" in " << ClassIdentifier<T>::getIdentifier()->getName() << std::endl;
-
-            T* temp = 0;
-            SuperFunctionCondition<0, 0, T>::apply(temp);
-
-            std::cout << "done" << std::endl;
-
-            // Calls the condition of the next super-function
-            SuperFunctionCondition<0 + 1, 0, T>::check();
-        }
-
-        static void apply(void* temp)
-        {
-            std::cout << ClassIdentifier<T>::getIdentifier()->getName() << " is not a Projectile" << std::endl;
-            // nop
-        }
-
-        static void apply(Projectile* temp)
-        {
-            std::cout << ClassIdentifier<T>::getIdentifier()->getName() << " is a Projectile" << std::endl;
-            ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier();
-
-            // Iterate through all children and assign the caller
-            for (std::set<const Identifier*>::iterator it = identifier->getDirectChildrenIntern().begin(); it != identifier->getDirectChildrenIntern().end(); ++it)
-            {
-                if (!((ClassIdentifier<T>*)(*it))->superFunctionCaller_testfunction_)
-                {
-                    std::cout << "adding functionpointer to " << ((ClassIdentifier<T>*)(*it))->getName() << std::endl;
-                    ((ClassIdentifier<T>*)(*it))->superFunctionCaller_testfunction_ = new SuperFunctionClassCaller_testfunction<T>;
-                }
-            }
-        }
-    };
+    SUPER_FUNCTION(0, Projectile, testfunction, false);
 }
 
Index: code/branches/core3/src/orxonox/objects/RotatingProjectile.cc
===================================================================
--- code/branches/core3/src/orxonox/objects/RotatingProjectile.cc	(revision 1683)
+++ code/branches/core3/src/orxonox/objects/RotatingProjectile.cc	(revision 1684)
@@ -88,9 +88,11 @@
 
         Projectile::tick(dt);
+//        SUPER(RotatingProjectile, tick, dt);
     }
 
     void RotatingProjectile::changedVisibility()
     {
-        BillboardProjectile::changedVisibility();
+//        BillboardProjectile::changedVisibility();
+        SUPER(RotatingProjectile, changedVisibility);
         this->rotatingBillboard1_.setVisible(this->isVisible());
         this->rotatingBillboard2_.setVisible(this->isVisible());
Index: code/branches/core3/src/orxonox/objects/Skybox.cc
===================================================================
--- code/branches/core3/src/orxonox/objects/Skybox.cc	(revision 1683)
+++ code/branches/core3/src/orxonox/objects/Skybox.cc	(revision 1684)
@@ -67,5 +67,6 @@
     void Skybox::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
-        BaseObject::XMLPort(xmlelement, mode);
+//        BaseObject::XMLPort(xmlelement, mode);
+        SUPER(Skybox, XMLPort, xmlelement, mode);
 
         XMLPortParam(Skybox, "src", setSkyboxSrc, getSkyboxSrc, xmlelement, mode);
@@ -86,5 +87,6 @@
     void Skybox::changedVisibility()
     {
-        BaseObject::changedVisibility();
+//        BaseObject::changedVisibility();
+        SUPER(Skybox, changedVisibility);
         GraphicsEngine::getSingleton().getSceneManager()->setSkyBox(this->isVisible(), this->skyboxSrc_);
     }
Index: code/branches/core3/src/orxonox/objects/SpaceShip.cc
===================================================================
--- code/branches/core3/src/orxonox/objects/SpaceShip.cc	(revision 1683)
+++ code/branches/core3/src/orxonox/objects/SpaceShip.cc	(revision 1684)
@@ -259,5 +259,6 @@
     void SpaceShip::changedVisibility()
     {
-        Model::changedVisibility();
+//        Model::changedVisibility();
+        SUPER(SpaceShip, changedVisibility);
 
         this->tt1_->setEnabled(this->isVisible());
@@ -271,5 +272,6 @@
     void SpaceShip::changedActivity()
     {
-        Model::changedActivity();
+//        Model::changedActivity();
+        SUPER(SpaceShip, changedActivity);
 
         this->tt1_->setEnabled(this->isVisible());
@@ -345,5 +347,6 @@
     void SpaceShip::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
-        Model::XMLPort(xmlelement, mode);
+//        Model::XMLPort(xmlelement, mode);
+        SUPER(SpaceShip, XMLPort, xmlelement, mode);
 
         XMLPortParam(SpaceShip, "camera", setCamera, getCamera, xmlelement, mode);
@@ -482,5 +485,6 @@
 
 
-        WorldEntity::tick(dt);
+//        WorldEntity::tick(dt);
+        SUPER(SpaceShip, tick, dt);
 
         this->roll(this->mouseXRotation_ * dt);
Index: code/branches/core3/src/orxonox/objects/SpaceShipAI.cc
===================================================================
--- code/branches/core3/src/orxonox/objects/SpaceShipAI.cc	(revision 1683)
+++ code/branches/core3/src/orxonox/objects/SpaceShipAI.cc	(revision 1684)
@@ -78,5 +78,6 @@
     void SpaceShipAI::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
-        SpaceShip::XMLPort(xmlelement, mode);
+//        SpaceShip::XMLPort(xmlelement, mode);
+        SUPER(SpaceShipAI, XMLPort, xmlelement, mode);
 
         this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&SpaceShipAI::action)));
@@ -229,5 +230,6 @@
             this->doFire();
 
-        SpaceShip::tick(dt);
+//        SpaceShip::tick(dt);
+        SUPER(SpaceShipAI, tick, dt);
     }
 
Index: code/branches/core3/src/orxonox/objects/SpaceShipAI.h
===================================================================
--- code/branches/core3/src/orxonox/objects/SpaceShipAI.h	(revision 1683)
+++ code/branches/core3/src/orxonox/objects/SpaceShipAI.h	(revision 1684)
@@ -47,4 +47,5 @@
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void tick(float dt);
             static void createEnemy(int num);
             static void killEnemies(int num);
@@ -54,5 +55,4 @@
 
         private:
-            virtual void tick(float dt);
             virtual ColourValue getProjectileColour() const;
 
Index: code/branches/core3/src/orxonox/objects/Tickable.h
===================================================================
--- code/branches/core3/src/orxonox/objects/Tickable.h	(revision 1683)
+++ code/branches/core3/src/orxonox/objects/Tickable.h	(revision 1684)
@@ -45,4 +45,5 @@
 
 #include "core/OrxonoxClass.h"
+#include "core/Super.h"
 
 namespace orxonox
@@ -61,4 +62,6 @@
             Tickable();
     };
+
+    SUPER_FUNCTION(2, Tickable, tick, true);
 
     //! The Tickable interface provides a tick(dt) function, that gets called every frame.
Index: code/branches/core3/src/orxonox/objects/WorldEntity.cc
===================================================================
--- code/branches/core3/src/orxonox/objects/WorldEntity.cc	(revision 1683)
+++ code/branches/core3/src/orxonox/objects/WorldEntity.cc	(revision 1684)
@@ -110,5 +110,6 @@
     void WorldEntity::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
-        BaseObject::XMLPort(xmlelement, mode);
+//        BaseObject::XMLPort(xmlelement, mode);
+        SUPER(WorldEntity, XMLPort, xmlelement, mode);
 
         XMLPortParamExternTemplate(WorldEntity, Ogre::Node, this->node_, "position", setPosition, getPosition, xmlelement, mode, Ogre::Node, const Vector3&);
