Index: /code/branches/core3/src/core/ConfigValueContainer.cc
===================================================================
--- /code/branches/core3/src/core/ConfigValueContainer.cc	(revision 1610)
+++ /code/branches/core3/src/core/ConfigValueContainer.cc	(revision 1611)
@@ -47,11 +47,7 @@
 {
     /**
-        @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
-        @param type The type of the corresponding config-file
-        @param identifier The identifier of the class the variable belongs to
-        @param varname The name of the variable
-        @param defvalue The default-value
-    */
-    ConfigValueContainer::ConfigValueContainer(ConfigFileType type, Identifier* identifier, const std::string& varname, const MultiTypeMath& defvalue)
+        @brief Initializes the ConfigValueContainer with defaultvalues.
+    */
+    void ConfigValueContainer::init(ConfigFileType type, Identifier* identifier, const std::string& varname)
     {
         this->type_ = type;
@@ -63,45 +59,32 @@
         this->bDoInitialCallback_ = false;
         this->bAddedDescription_ = false;
-
+    }
+
+    /**
+        @brief Does some special initialization for single config-values.
+    */
+    void ConfigValueContainer::initValue(const MultiTypeMath& defvalue)
+    {
         this->value_ = defvalue;
         this->bIsVector_ = false;
 
-        this->defvalueString_ = defvalue.toString();
+        this->defvalueString_ = this->value_.toString();
         this->update();
     }
 
     /**
-        @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
-        @param type The type of the corresponding config-file
-        @param identifier The identifier of the class the variable belongs to
-        @param varname The name of the variable
-        @param defvalue The default-value
-    */
-    ConfigValueContainer::ConfigValueContainer(ConfigFileType type, Identifier* identifier, const std::string& varname, const std::vector<MultiTypeMath>& defvalue)
-    {
-        this->type_ = type;
-        this->identifier_ = identifier;
-        this->sectionname_ = identifier->getName();
-        this->varname_ = varname;
-        this->callback_ = 0;
-        this->bContainerIsNew_ = true;
-        this->bDoInitialCallback_ = false;
-        this->bAddedDescription_ = false;
-
-        this->valueVector_ = defvalue;
+        @brief Does some special initialization for vector config-values.
+    */
+    void ConfigValueContainer::initVector()
+    {
         this->bIsVector_ = true;
 
-        if (defvalue.size() > 0)
-        {
-                this->value_ = defvalue[0];
-
-            for (unsigned int i = 0; i < defvalue.size(); i++)
-            {
-                ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, i, defvalue[i].toString(), this->value_.isA(MT_string));
-                this->defvalueStringVector_.push_back(defvalue[i].toString());
-            }
-
-            this->update();
-        }
+        for (unsigned int i = 0; i < this->valueVector_.size(); i++)
+        {
+            ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i].toString(), this->value_.isA(MT_string));
+            this->defvalueStringVector_.push_back(this->valueVector_[i].toString());
+        }
+
+        this->update();
     }
 
Index: /code/branches/core3/src/core/ConfigValueContainer.h
===================================================================
--- /code/branches/core3/src/core/ConfigValueContainer.h	(revision 1610)
+++ /code/branches/core3/src/core/ConfigValueContainer.h	(revision 1611)
@@ -95,13 +95,49 @@
     {
         public:
-            ConfigValueContainer(ConfigFileType type, Identifier* identifier, const std::string& varname, const MultiTypeMath& defvalue);
-            ConfigValueContainer(ConfigFileType type, Identifier* identifier, const std::string& varname, const std::vector<MultiTypeMath>& defvalue);
+            /**
+                @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
+                @param type The type of the corresponding config-file
+                @param identifier The identifier of the class the variable belongs to
+                @param varname The name of the variable
+                @param defvalue The default-value
+                @param value Only needed do determine the right type.
+            */
+            template <class D, class V>
+            ConfigValueContainer(ConfigFileType type, Identifier* identifier, const std::string& varname, const D& defvalue, const V& value)
+            {
+                this->init(type, identifier, varname);
+                this->initValue((V)defvalue);
+            }
+
+            /**
+                @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
+                @param type The type of the corresponding config-file
+                @param identifier The identifier of the class the variable belongs to
+                @param varname The name of the variable
+                @param defvalue The default-value
+            */
+            template <class V>
+            ConfigValueContainer(ConfigFileType type, Identifier* identifier, const std::string& varname, const std::vector<V>& defvalue)
+            {
+                this->init(type, identifier, varname);
+
+                this->value_ = V();
+                for (unsigned int i = 0; i < defvalue.size(); i++)
+                    this->valueVector_.push_back(MultiTypeMath(defvalue[i]));
+
+                this->initVector();
+            }
+
             ~ConfigValueContainer();
 
-            /** @brief Returns the configured value. @param value A pointer to the variable to store the value. @return The ConfigValueContainer */
+            /**
+                @brief Returns the configured value.
+                @param value A pointer to the variable to store the value.
+                @param object The object calling this function
+                @return The ConfigValueContainer
+            */
             template <typename T, class C>
             ConfigValueContainer& getValue(T* value, C* object)
             {
-std::cout << "start: " << this->getName() << std::endl;
                 if ((this->callback_ && object) || this->bContainerIsNew_)
                 {
@@ -123,9 +159,13 @@
                     this->value_.getValue(value);
                 }
-std::cout << "end" << std::endl;
                 return *this;
             }
 
-            /** @brief Returns the configured vector. @param value A pointer to the vector to store the values. @return The ConfigValueContainer */
+            /**
+                @brief Returns the configured vector.
+                @param value A pointer to the vector to store the values.
+                @param object The object calling this function
+                @return The ConfigValueContainer
+            */
             template <typename T, class C>
             ConfigValueContainer& getValue(std::vector<T>* value, C* object)
@@ -172,15 +212,11 @@
             }
 
-            template <typename T>
-            inline void setVectorType(const std::vector<T>& value)
-            {
-                this->value_ = T();
-                this->update();
-            }
-
+            /** @brief Returns the name of this container. */
             inline const std::string& getName() const
                 { return this->varname_; }
+            /** @brief Returns true if this config-value is a vector */
             inline bool isVector() const
                 { return this->bIsVector_; }
+            /** @brief Returns the vectors size (or zero if it's not a vector). */
             inline unsigned int getVectorSize() const
                 { return this->valueVector_.size(); }
@@ -189,4 +225,9 @@
             const std::string& getDescription() const;
 
+            /**
+                @brief Adds a callback function, that gets called after getValue() if the newly assigned value differs from the old value of the variable.
+                @param object The object to call the function
+                @param function The callback function
+            */
             template <class T>
             inline ConfigValueContainer& callback(T* object, void (T::*function) (void))
@@ -225,4 +266,7 @@
 
         private:
+            void init(ConfigFileType type, Identifier* identifier, const std::string& varname);
+            void initValue(const MultiTypeMath& defvalue);
+            void initVector();
             bool callFunctionWithIndex(bool (ConfigValueContainer::* function) (unsigned int, const MultiTypeMath&), const std::string& input);
 
Index: /code/branches/core3/src/core/ConfigValueIncludes.h
===================================================================
--- /code/branches/core3/src/core/ConfigValueIncludes.h	(revision 1610)
+++ /code/branches/core3/src/core/ConfigValueIncludes.h	(revision 1611)
@@ -47,29 +47,17 @@
     @param defvalue The default-value of the variable
 */
-#define SetConfigValue(varname, defvalue) \
+#define SetConfigValueGeneric(type, varname, defvalue) \
     static orxonox::Identifier* identifier##varname = this->getIdentifier(); \
     orxonox::ConfigValueContainer* container##varname = identifier##varname->getConfigValueContainer(#varname); \
     if (!container##varname) \
     { \
-        container##varname = new orxonox::ConfigValueContainer(CFT_Settings, identifier##varname, #varname, varname = defvalue); \
+        container##varname = new orxonox::ConfigValueContainer(CFT_Settings, identifier##varname, #varname, defvalue, varname); \
         identifier##varname->addConfigValueContainer(#varname, container##varname); \
     } \
     container##varname->getValue(&varname, this)
 
-/**
-    @brief Assigns the value, defined in the config-file, to the variable (or the default-value, if there is no entry in the file).
-    @param classname name in which the config value should be stored
-    @param varname The name of the variable
-    @param defvalue The default-value of the variable
-*/
-#define SetConfigValueGeneric(classname, varname, defvalue) \
-    static orxonox::Identifier* identifier##varname = ClassIdentifier<classname>::getIdentifier(); \
-    orxonox::ConfigValueContainer* container##varname = identifier##varname->getConfigValueContainer(#varname); \
-    if (!container##varname) \
-    { \
-        container##varname = new orxonox::ConfigValueContainer(CFT_Settings, identifier##varname, #varname, varname = defvalue); \
-        identifier##varname->addConfigValueContainer(#varname, container##varname); \
-    } \
-    container##varname->getValue(&varname, this)
+#define SetConfigValue(varname, defvalue) SetConfigValueGeneric(CFT_Settings, varname, defvalue)
+#define SetKeybindingValue(varname, defvalue) SetConfigValueGeneric(CFT_Keybindings, varname, defvalue)
+
 
 /**
@@ -78,17 +66,17 @@
     @param defvalue The default-value
 */
-#define SetConfigValueVector(varname, defvalue) \
+#define SetConfigValueVectorGeneric(type, varname, defvalue) \
     static orxonox::Identifier* identifier##varname = this->getIdentifier(); \
     orxonox::ConfigValueContainer* container##varname = identifier##varname->getConfigValueContainer(#varname); \
     if (!container##varname) \
     { \
-        std::vector<MultiTypeMath> temp; \
-        for (unsigned int i = 0; i < defvalue.size(); i++) \
-            temp.push_back(MultiTypeMath(defvalue[i])); \
-        container##varname = new orxonox::ConfigValueContainer(CFT_Settings, identifier##varname, #varname, temp); \
-        container##varname->setVectorType(varname); \
+        container##varname = new orxonox::ConfigValueContainer(CFT_Settings, identifier##varname, #varname, defvalue); \
         identifier##varname->addConfigValueContainer(#varname, container##varname); \
     } \
     container##varname->getValue(&varname, this)
+
+#define SetConfigValueVector(varname, defvalue) SetConfigValueVectorGeneric(CFT_Settings, varname, defvalue)
+#define SetKeybindingValueVector(varname, defvalue) SetConfigValueVectorGeneric(CFT_Keybindings, varname, defvalue)
+
 
 /**
@@ -107,4 +95,5 @@
         COUT(2) << "Warning: Couldn't reset config-value '" << #varname << "', corresponding container doesn't exist." << std::endl; \
     }
+
 
 /**
Index: /code/branches/core3/src/core/input/KeyBinder.cc
===================================================================
--- /code/branches/core3/src/core/input/KeyBinder.cc	(revision 1610)
+++ /code/branches/core3/src/core/input/KeyBinder.cc	(revision 1611)
@@ -268,5 +268,5 @@
     if (!cont)
     {
-      cont = new ConfigValueContainer(CFT_Keybindings, ClassIdentifier<KeyBinder>::getIdentifier(), button.name_, "");
+      cont = new ConfigValueContainer(CFT_Keybindings, ClassIdentifier<KeyBinder>::getIdentifier(), button.name_, "", button.name_);
       ClassIdentifier<KeyBinder>::getIdentifier()->addConfigValueContainer(button.name_, cont);
     }
Index: /code/branches/core3/src/orxonox/objects/WorldEntity.cc
===================================================================
--- /code/branches/core3/src/orxonox/objects/WorldEntity.cc	(revision 1610)
+++ /code/branches/core3/src/orxonox/objects/WorldEntity.cc	(revision 1611)
@@ -112,7 +112,5 @@
         BaseObject::XMLPort(xmlelement, mode);
 
-std::cout << "111111111111111\n";
         XMLPortParamExternTemplate(WorldEntity, Ogre::Node, this->node_, "position", setPosition, getPosition, xmlelement, mode, Ogre::Node, const Vector3&);
-std::cout << "222222222222222\n";
         XMLPortParamLoadOnly(WorldEntity, "direction", setDirectionSimple, xmlelement, mode);
         XMLPortParamLoadOnly(WorldEntity, "yawpitchroll", setYawPitchRoll, xmlelement, mode);
