Index: /code/trunk/data/gui/layouts/Dialogue.layout
===================================================================
--- /code/trunk/data/gui/layouts/Dialogue.layout	(revision 11447)
+++ /code/trunk/data/gui/layouts/Dialogue.layout	(revision 11447)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<GUILayout >
+    <Window Type="DefaultWindow" Name="orxonox/Dialogue/Background" > 
+    	<Property Name="InheritsAlpha" Value="False" />
+        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+        <Window Type="MenuWidgets/StaticText" Name="orxonox/Dialogue/Inventory" >
+            <Property Name="Alpha" Value="0.8" />
+            <Property Name="InheritsAlpha" Value="False" />
+            <Property Name="HorzFormatting" Value="HorzCentred" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="VertFormatting" Value="TopAligned" />
+            <Property Name="UnifiedAreaRect" Value="{{0.15,0},{0.15,0},{0.85,0},{0.8,0}}" />
+            <Window Type="MenuWidgets/StaticText" Name="orxonox/Dialogue/Wrapper" >
+                <Property Name="TextColours" Value="FF4444FF" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="HorzFormatting" Value="HorzCentred" />
+                <Property Name="VertFormatting" Value="TopAligned" />
+                <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.92,0}}" />
+            </Window>
+        </Window>
+         
+    </Window>
+</GUILayout>
Index: /code/trunk/data/gui/scripts/Dialogue.lua
===================================================================
--- /code/trunk/data/gui/scripts/Dialogue.lua	(revision 11447)
+++ /code/trunk/data/gui/scripts/Dialogue.lua	(revision 11447)
@@ -0,0 +1,144 @@
+
+-- Dialogue.lua
+
+local P = createMenuSheet("Dialogue")
+
+P.wrapper = nil
+P.detailsWindows = {}
+P.detailPickups = {}
+P.pickupsList = {}
+
+P.showing = false
+
+-- Design parameters
+P.imageHeight = 50
+P.detailImageSize = 100
+P.textHeight = 30
+P.buttonWidth = 85
+
+function P.onLoad()
+    P.wrapper = nil
+    P.detailsWindows = {}
+    P.detailPickups = {}
+    P.pickupsList = {}
+end
+
+function P.onShow()
+    orxonox.CommandExecutor:execute("setTimeFactor 0")
+    P.createInventory()
+    P.showing = true
+
+end
+
+function P.onHide()
+    orxonox.CommandExecutor:execute("setTimeFactor 1")
+    P.showing = false
+    P.cleanup(true)
+end
+
+function P.update()
+    P.updateInventory()
+    if P.showing == false then
+        return
+    end
+
+    -- Update opened detail windows.
+    
+
+    -- Update main inventory.
+    P.cleanup(false)
+    P.createInventory()
+    -- TODO: Recover scrolling position
+    
+end
+
+function P.createInventory()
+
+    local pickupManager = orxonox.DialogueManager:getInstance()
+    
+    root = winMgr:getWindow("orxonox/Dialogue/Inventory")
+    local question = orxonox.DialogueManager:getInstance():getquestion()
+    root:setText(question)
+    P.wrapper = winMgr:createWindow("MenuWidgets/ScrollablePane", "orxonox/Dialogue/Inventory/Wrapper")
+    P.wrapper:setSize(CEGUI.UVector2(CEGUI.UDim(1,0),CEGUI.UDim(1,0)))
+    root:addChildWindow(P.wrapper)
+    
+    
+    detailsButton = winMgr:createWindow("MenuWidgets/Button", "/DetailsButton")
+    local a1 = orxonox.DialogueManager:getInstance():getanswers1()
+    detailsButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0),CEGUI.UDim(0.25, (P.imageHeight-P.textHeight)/2)))
+    detailsButton:setSize(CEGUI.UVector2(CEGUI.UDim(0.8, 0), CEGUI.UDim(0, P.textHeight)))
+    detailsButton:setText(a1)
+    orxonox.GUIManager:subscribeEventHelper(detailsButton, "Clicked", P.name ..".a1Button_clicked")
+    P.wrapper:addChildWindow(detailsButton)
+
+    a2Button = winMgr:createWindow("MenuWidgets/Button", "/a2Button")
+    local a2 = orxonox.DialogueManager:getInstance():getanswers2()
+    a2Button:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0),CEGUI.UDim(0.4, (P.imageHeight-P.textHeight)/2)))
+    a2Button:setSize(CEGUI.UVector2(CEGUI.UDim(0.8, 0), CEGUI.UDim(0, P.textHeight)))
+    a2Button:setText(a2)
+    orxonox.GUIManager:subscribeEventHelper(a2Button, "Clicked", P.name ..".a2Button_clicked")
+    P.wrapper:addChildWindow(a2Button)
+
+
+end
+
+function P.updateInventory()
+    local questionn = orxonox.DialogueManager:getInstance():getquestion()
+    root:setText(questionn)
+    local a1n = orxonox.DialogueManager:getInstance():getanswers1()
+    detailsButton:setText(a1n)
+    local a2n = orxonox.DialogueManager:getInstance():getanswers2()
+    a2Button:setText(a2n)
+
+end
+
+
+function P.cleanup(destroyDetails)
+    
+    if P.wrapper ~= nil then
+        winMgr:destroyWindow(P.wrapper)
+    end
+    
+    --Destroy details windows.
+    if destroyDetails == false then
+        return
+    end
+    for k,v in pairs(P.detailsWindows) do
+        if v ~= nil then
+            P.destroyDetailWindow(k)
+        end
+    end
+    
+end
+
+
+
+function P.a1Button_clicked(e)
+    local ending = orxonox.DialogueManager:getInstance():theEnd()
+    
+    if ending then
+        orxonox.CommandExecutor:execute("OrxonoxOverlay toggleVisibility Dialogue")
+    
+    
+    else 
+        orxonox.DialogueManager:getInstance():a1clicked()
+        P.update()
+    end
+end
+
+function P.a2Button_clicked(e)
+    local ending = orxonox.DialogueManager:getInstance():theEnd()
+    
+    if ending then
+        orxonox.CommandExecutor:execute("OrxonoxOverlay toggleVisibility Dialogue")
+    
+    
+    else 
+        orxonox.DialogueManager:getInstance():a2clicked()
+        P.update()
+    end
+    
+end
+
+return P
Index: /code/trunk/data/gui/scripts/TestDialogButttons.lua
===================================================================
--- /code/trunk/data/gui/scripts/TestDialogButttons.lua	(revision 11447)
+++ /code/trunk/data/gui/scripts/TestDialogButttons.lua	(revision 11447)
@@ -0,0 +1,30 @@
+local P = createMenuSheet("dialogue")
+
+function P.onLoad()
+    --buttons are arranged in a 2x1 Matrix (list)
+    P:setButton(1, 1, {
+            ["button"] = winMgr:getWindow("orxonox/QuickGameTestButton"),
+            ["callback"]  = P.QuickGameTestButton_clicked
+    })
+
+    P:setButton(2, 1, {
+            ["button"] = winMgr:getWindow("orxonox/SingleplayerButton"),
+            ["callback"]  = P.SingleplayerButton_clicked
+    })
+
+end
+
+-- events for options
+function P.QuickGameTestButton_clicked(e)
+    hideAllMenuSheets()
+    orxonox.execute("startGame")
+end
+
+function P.SingleplayerButton_clicked(e)
+    showMenuSheet("SingleplayerMenu", true)
+end
+
+
+
+return P
+
Index: /code/trunk/data/levels/DialogueShowcase.oxw
===================================================================
--- /code/trunk/data/levels/DialogueShowcase.oxw	(revision 11447)
+++ /code/trunk/data/levels/DialogueShowcase.oxw	(revision 11447)
@@ -0,0 +1,79 @@
+<LevelInfo
+ name = "DialogueShowcase"
+ description = "A level to show and test the functionality of the Dialogue module."
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+  include("templates/HeavyCruiser.oxt")
+?>
+
+<?lua
+  include("templates/spaceshipEscort.oxt")
+  include("templates/endurancetest_template.oxt")
+?>
+
+<Level>
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+  
+
+  <Scene
+    ambientlight = "0.8, 0.8, 0.8"
+    skybox       = "Orxonox/Starbox"
+  >
+ <DistanceTrigger name="test" position="100,0,100" target="Pawn" distance=25 stayActive="true" />
+    <Backlight position="100,0,100" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,0,1"/>
+    
+    <NextQuestion  question="Unknown Spaceship Transmission: Who goes there?" a1="(say your name)" a2="None of your business I'm afraid." >
+     <possibleQuestions> 
+        <NextQuestion  question="You're not cleared for this area, turn back." a1="Doesn't look too exciting here anyways." a2="You gotta make me try...(attack)" />
+        <NextQuestion  question="I'll make it my business. Only military allowed in this area." a1="Whoops, didn't know that, I'll be on my way then." a2="Got an important message for Sgt Smith though." >
+        <possibleQuestions>
+          <NextQuestion  question="Make sure I don't have to see your ugly face again." a1="...thanks, bye." a2="I'll think about it." />
+          <NextQuestion  question="Oh why didn't you say that in the first place? Off you go." a1="Thanks mate." a2="Just don't be so rude next time." />
+        </possibleQuestions>
+      </NextQuestion>
+      </possibleQuestions>    
+      <events>
+        <execute>
+           <EventListener event="test" />
+        </execute>
+      </events>
+    </NextQuestion>
+
+    <DistanceTrigger name="test1" position="100,0,-100" target="Pawn" distance=25 stayActive="true" />
+    <Backlight position="100,0,-100" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,1,1"/>
+    
+    <NextQuestion  question="Hey,  sorry to bother you,  could you help me with something?" a1="Yeah sure." a2="Nope get lost." >
+     <possibleQuestions> 
+        <NextQuestion  question="Do you like fish" a1="...yes?" a2="This is wasting my time." >
+        <possibleQuestions>
+          <NextQuestion  question="Splendid! Would you like your ship to look like one?" a1="..." a2="I'm going now,  okay?" />
+          <NextQuestion  question="Turtles then?" a1="..." a2="Im going now,  okay?" />
+        </possibleQuestions>
+        </NextQuestion>
+        <NextQuestion  question="I can pay you know." a1="Got enough money." a2="...are you deaf? Bye."/>
+      </possibleQuestions>    
+      <events>
+        <execute>
+           <EventListener event="test1" />
+        </execute>
+      </events>
+    </NextQuestion>
+
+    
+
+    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />
+
+    
+    
+  </Scene>
+</Level>
Index: /code/trunk/data/levels/events.oxw
===================================================================
--- /code/trunk/data/levels/events.oxw	(revision 11446)
+++ /code/trunk/data/levels/events.oxw	(revision 11447)
@@ -57,4 +57,44 @@
     -->
 
+    <DistanceTrigger name="test" position="0,0,0" target="Pawn" distance=25 stayActive="true" />
+    <Backlight position="0,0,0" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,0,1"/>
+    
+    <NextQuestion  question="Continue?" a1="yes" a2="no" >
+     <possibleQuestions> 
+        <NextQuestion  question="Are you sure?" a1="yep let me continue" a2="no actually not" />
+        <NextQuestion  question="Why?" a1="Got a dentist's appointment" a2="this sucks" >
+        <possibleQuestions>
+          <NextQuestion  question="Are your teeth that bad mate?" a1="yep" a2="leave me alone godammit" />
+          <NextQuestion  question="You suck" a1="..." a2="Im going now okay" />
+        </possibleQuestions>
+      </NextQuestion>
+      </possibleQuestions>    
+      <events>
+        <execute>
+           <EventListener event="test" />
+        </execute>
+      </events>
+    </NextQuestion>
+
+    <DistanceTrigger name="test1" position="100,300,0" target="Pawn" distance=25 stayActive="true" />
+    <Backlight position="100,300,0" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,1,1"/>
+    
+    <NextQuestion  question="Wazzp bud?" a1="yes" a2="no" >
+     <possibleQuestions> 
+        <NextQuestion  question="Do you like fish" a1="yep let me continue" a2="no actually not" />
+        <NextQuestion  question="Whats your favourite pastime?" a1="Got a dentist's appointment" a2="this sucks" >
+        <possibleQuestions>
+          <NextQuestion  question="Whatever?" a1="yep" a2="leave me alone godammit" />
+          <NextQuestion  question="Turtles then?" a1="..." a2="Im going now okay" />
+        </possibleQuestions>
+      </NextQuestion>
+      </possibleQuestions>    
+      <events>
+        <execute>
+           <EventListener event="test1" />
+        </execute>
+      </events>
+    </NextQuestion>
+
 
     <!-- red -->
Index: /code/trunk/data/overlays/HUDTemplates3.oxo
===================================================================
--- /code/trunk/data/overlays/HUDTemplates3.oxo	(revision 11446)
+++ /code/trunk/data/overlays/HUDTemplates3.oxo	(revision 11447)
@@ -214,4 +214,10 @@
     />
 
-  </OverlayGroup>
-</Template>
+    <GUIOverlay
+      name = "Dialogue"
+      guiname = "Dialogue"
+      visible = "false"
+    />
+
+  </OverlayGroup>
+</Template>
Index: /code/trunk/src/modules/CMakeLists.txt
===================================================================
--- /code/trunk/src/modules/CMakeLists.txt	(revision 11446)
+++ /code/trunk/src/modules/CMakeLists.txt	(revision 11447)
@@ -26,4 +26,5 @@
 ################ Sub Directories ################
 
+ADD_SUBDIRECTORY(dialogue)
 ADD_SUBDIRECTORY(designtools)
 ADD_SUBDIRECTORY(gametypes)
Index: /code/trunk/src/modules/dialogue/CMakeLists.txt
===================================================================
--- /code/trunk/src/modules/dialogue/CMakeLists.txt	(revision 11447)
+++ /code/trunk/src/modules/dialogue/CMakeLists.txt	(revision 11447)
@@ -0,0 +1,15 @@
+SET_SOURCE_FILES(DIALOGUE_SRC_FILES
+  DialogueManager.cc
+  NextQuestion.cc
+ 
+)
+
+ORXONOX_ADD_LIBRARY(dialogue
+  MODULE
+  FIND_HEADER_FILES
+   TOLUA_FILES
+    DialogueManager.h
+  LINK_LIBRARIES
+    orxonox
+  SOURCE_FILES ${DIALOGUE_SRC_FILES}
+)
Index: /code/trunk/src/modules/dialogue/DialogueManager.cc
===================================================================
--- /code/trunk/src/modules/dialogue/DialogueManager.cc	(revision 11447)
+++ /code/trunk/src/modules/dialogue/DialogueManager.cc	(revision 11447)
@@ -0,0 +1,92 @@
+#include "core/CoreIncludes.h"
+#include "core/LuaState.h"
+#include "core/GUIManager.h"
+#include "core/class/Identifier.h"
+#include "core/singleton/ScopedSingletonIncludes.h"
+#include "network/Host.h"
+#include "network/NetworkFunctionIncludes.h"
+#include "DialogueManager.h"
+#include <vector>
+#include <string>
+#include "core/XMLPort.h"
+#include "NextQuestion.h"
+
+
+
+namespace orxonox {
+	ManageScopedSingleton(DialogueManager, ScopeID::ROOT, false);
+	
+
+	
+	DialogueManager::DialogueManager(){}
+	
+
+	
+    
+
+	void DialogueManager::registerquestion(NextQuestion* nq){
+		if(allQuestions.size()==0) {
+			orxout(internal_info) << "At least one NextQuestion has to be set." << endl;
+		} 
+		allQuestions.push_back(nq);
+			orxout(internal_info) << "qsize " << allQuestions.size();
+
+	}	
+
+    void DialogueManager::setquestion(std::string q){
+		question=q;
+		
+	}
+	void DialogueManager::setCurrentQuestion(NextQuestion* nq){
+		currentQuestion=nq;
+		
+	}
+
+	std::string DialogueManager::getquestion(void){
+		return question;
+	}
+
+	void DialogueManager::setanswers1(std::string a1){
+		this->a1=a1;
+				}
+
+	void DialogueManager::setanswers2(std::string a2){
+		this->a2=a2;
+				}
+
+	
+
+	std::string DialogueManager::getanswers1(void){
+		return a1;
+	}
+
+	std::string DialogueManager::getanswers2(void){
+		return a2;
+	}
+
+	void DialogueManager::a1clicked(void){
+		
+		currentQuestion = currentQuestion->possibleQuestions[0];
+		update(currentQuestion);
+
+		
+	}
+	void DialogueManager::a2clicked(void){
+		
+		currentQuestion = currentQuestion->possibleQuestions[1];
+		update(currentQuestion);
+	}
+
+	 void DialogueManager::update(NextQuestion* nq){
+	 	this->setquestion(nq->getquestion());
+	 	this->setanswers1(nq->getanswers1());
+	 	this->setanswers2(nq->getanswers2());
+	 }
+
+	bool DialogueManager::theEnd(){
+	if((currentQuestion->possibleQuestions).empty()) {
+		return true;}
+	else return false;
+	}
+
+}
Index: /code/trunk/src/modules/dialogue/DialogueManager.h
===================================================================
--- /code/trunk/src/modules/dialogue/DialogueManager.h	(revision 11447)
+++ /code/trunk/src/modules/dialogue/DialogueManager.h	(revision 11447)
@@ -0,0 +1,74 @@
+#ifndef _DialogueManager_H__
+#define _DialogueManager_H__
+
+#include "core/CoreIncludes.h"
+#include "core/LuaState.h"
+#include "core/GUIManager.h"
+#include "core/class/Identifier.h"
+#include "core/singleton/ScopedSingletonIncludes.h"
+#include "network/Host.h"
+#include "network/NetworkFunctionIncludes.h"
+#include "util/Singleton.h"
+#include <string>
+#include <vector>
+#include "core/config/Configurable.h"
+#include "core/XMLPort.h"
+#include "core/EventIncludes.h"
+#include "DialoguePrereqs.h"
+#include "NextQuestion.h"
+
+
+
+
+namespace orxonox //tolua_export
+
+{//tolua_export
+	class _OrxonoxExport DialogueManager //tolua_export
+	: public Singleton<DialogueManager>
+	{//tolua_export
+		friend class Singleton<DialogueManager>;
+	
+		public:
+		
+		DialogueManager(); 
+		
+
+		static DialogueManager& getInstance() { return Singleton<DialogueManager>::getInstance(); } //tolua_export
+		
+
+		void setquestion(std::string question); //tolua_export
+		std::string getquestion(void); //tolua_export
+		
+		
+		void setanswers1(std::string a1); //tolua_export
+		std::string getanswers1(void); //tolua_export
+		
+		void setanswers2(std::string a2); //tolua_export
+		std::string getanswers2(void); //tolua_export
+		
+		void setCurrentQuestion(NextQuestion* q);
+
+		//Sets the current Question to the question corresponding to the first/second answer  
+		void a1clicked(void); //tolua_export
+		void a2clicked(void); //tolua_export
+		
+		//Checks whether there are any more Questions to come
+		bool theEnd(); //tolua_export 
+
+		//Sets question and a1, a2 for new currentQuestion
+		void update(NextQuestion* nq);
+
+		//Is executed whenever a NextQuestion is created and pushes all NextQuestion into the allQuestion vector.
+		void registerquestion(NextQuestion* nq);
+
+private:
+	NextQuestion* currentQuestion; //The Question which is currently displayed
+	std::vector<NextQuestion*> allQuestions;
+	std::string a1; //answer on first button
+	std::string a2; //answer on second button
+	std::string question;
+	static DialogueManager* singletonPtr_s;
+
+	};//tolua_export
+}//tolua_export
+#endif
Index: /code/trunk/src/modules/dialogue/DialoguePrereqs.h
===================================================================
--- /code/trunk/src/modules/dialogue/DialoguePrereqs.h	(revision 11447)
+++ /code/trunk/src/modules/dialogue/DialoguePrereqs.h	(revision 11447)
@@ -0,0 +1,76 @@
+/*
+ *   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
+    Shared library macros, enums, constants and forward declarations for the questsystem module
+*/
+
+#ifndef _DialoguePrereqs_H__
+#define _DialoguePrereqs_H__
+
+#include "OrxonoxConfig.h"
+#include "OrxonoxPrereqs.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(Dialogue_STATIC_BUILD)
+#  ifdef Dialogue_SHARED_BUILD
+#    define _DialogueExport __declspec(dllexport)
+#  else
+#    if defined( __MINGW32__ )
+#      define _DialogueExport
+#    else
+#      define _DialogueExport __declspec(dllimport)
+#    endif
+#  endif
+#  define _DialoguePrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
+#  define _DialogueExport  __attribute__ ((visibility("default")))
+#  define _DialoguePrivate __attribute__ ((visibility("hidden")))
+#else
+#  define _DialogueExport
+#  define _DialoguePrivate
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+
+    class DialogueManager;
+    class NextQuestion;
+   
+}
+
+#endif /* _DialoguePrereqs_H__ */
Index: /code/trunk/src/modules/dialogue/NextQuestion.cc
===================================================================
--- /code/trunk/src/modules/dialogue/NextQuestion.cc	(revision 11447)
+++ /code/trunk/src/modules/dialogue/NextQuestion.cc	(revision 11447)
@@ -0,0 +1,111 @@
+//#include <vector>
+#include <string>
+#include "core/CoreIncludes.h"
+#include "core/GUIManager.h"
+#include "overlays/OrxonoxOverlay.h"
+
+
+#include "NextQuestion.h"
+#include "core/XMLPort.h"
+#include "DialogueManager.h"
+
+namespace orxonox{
+
+	RegisterClass(NextQuestion);
+
+	NextQuestion::NextQuestion(Context* context) : BaseObject(context)
+    {
+        RegisterObject(NextQuestion);
+
+        DialogueManager& m = DialogueManager::getInstance();
+        m.registerquestion(this);
+       
+        
+    }
+
+	void NextQuestion::setquestion(std::string question){
+		this->question=question;
+	}
+
+	std::string NextQuestion::getquestion(void){
+		return question;
+	}
+
+	
+	bool NextQuestion::addposQuestion(NextQuestion* nq){
+		
+		possibleQuestions.push_back(nq);
+		return true;
+	}
+
+	const NextQuestion* NextQuestion::getposQuestion(unsigned int i) const
+    {
+        for (NextQuestion* effect : this->possibleQuestions)
+        {
+            if(i == 0)
+               return effect;
+            i--;
+        }
+        return nullptr;
+         }
+	
+	
+	void NextQuestion::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(NextQuestion, XMLPort, xmlelement, mode);
+
+        XMLPortParam(NextQuestion, "question", setquestion, getquestion, xmlelement, mode);
+        XMLPortParam(NextQuestion, "a1", setanswers1, getanswers1, xmlelement, mode);
+        XMLPortParam(NextQuestion, "a2", setanswers2, getanswers2, xmlelement, mode);
+        XMLPortObject(NextQuestion, NextQuestion, "possibleQuestions", addposQuestion, getposQuestion, xmlelement, mode);
+       
+    }
+	bool NextQuestion::execute(bool bTriggered, BaseObject* trigger)
+    {  
+        
+    	DialogueManager& m = DialogueManager::getInstance();
+        	
+        m.setquestion(question);
+        m.setCurrentQuestion(this);
+        m.setanswers1(a1);
+        m.setanswers2(a2);
+       
+
+       
+        OrxonoxOverlay::showOverlay("Dialogue");
+
+        return false;
+    }
+
+    void NextQuestion::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(NextQuestion, XMLEventPort, xmlelement, mode);
+
+        XMLPortEventSink(NextQuestion, BaseObject, "execute", execute, xmlelement, mode); 
+    }
+
+
+	void NextQuestion::setanswers1(std::string a1){
+		this->a1=a1;
+				}
+
+	void NextQuestion::setanswers2(std::string a2){
+		this->a2=a2;
+				}
+
+	
+
+	std::string NextQuestion::getanswers1(void){
+		return a1;
+	}
+
+	std::string NextQuestion::getanswers2(void){
+		return a2;
+	}
+
+	
+
+
+
+
+}
Index: /code/trunk/src/modules/dialogue/NextQuestion.h
===================================================================
--- /code/trunk/src/modules/dialogue/NextQuestion.h	(revision 11447)
+++ /code/trunk/src/modules/dialogue/NextQuestion.h	(revision 11447)
@@ -0,0 +1,61 @@
+#ifndef _NextQuestion_H__
+#define _NextQuestion_H__
+
+
+
+#include <string>
+#include "core/class/Identifier.h"
+#include "OrxonoxPrereqs.h"
+#include "core/XMLPort.h"
+#include "core/EventIncludes.h"
+#include "DialoguePrereqs.h"
+
+
+namespace orxonox{
+	class _OrxonoxExport NextQuestion : public BaseObject
+	{
+		
+		//tolua_begin
+		public:
+
+		NextQuestion (Context* context); // tolua_export
+		
+
+		void setquestion(std::string question);
+		std::string getquestion(void);
+
+		void setanswers1(std::string a1);
+		void setanswers2(std::string a2);
+		std::string getanswers1(void);
+		std::string getanswers2(void);
+
+		
+		
+
+		//XMLEventPort for Event that first triggers the Dialogue
+		virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
+
+		//XMLPort for setting questions and answers and the vector possibleQuestions
+		virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+		bool addposQuestion(NextQuestion* nq);
+		const NextQuestion* getposQuestion(unsigned int index) const;
+
+		//Sets very first currentQuestion in the DialogueManager when the event is triggered
+		bool execute(bool bTriggered, BaseObject* trigger);
+
+		std::vector<NextQuestion*> possibleQuestions;
+	
+	private:
+		std::string a1;
+		std::string a2;
+	
+
+
+		std::string question;
+		DialogueManager* m;
+
+	};
+	
+}
+#endif
