Index: /code/branches/Dialogue_FS17/data/levels/emptyLevel.oxw
===================================================================
--- /code/branches/Dialogue_FS17/data/levels/emptyLevel.oxw	(revision 11392)
+++ /code/branches/Dialogue_FS17/data/levels/emptyLevel.oxw	(revision 11393)
@@ -29,6 +29,31 @@
     skybox       = "Orxonox/Starbox"
   >
-  <DialogueManager question="Wazzup">
-  </DialogueManager>
+ <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,0"/>
+    <DialogueManager question="Hello World3">
+      <events>
+        <execute>
+           <EventListener event="test" />
+        </execute>
+      </events>
+    </DialogueManager>
+
+    <!--<DialogueManager firstquestion="hello world">
+      <options>
+        <NextQuestion answer="ja" question="question?">
+          <options>
+            <NextQuestion answer="" question="">
+            </NextQuestion>
+          </options>
+        </NextQuestion>
+       <events>
+        <execute>
+           <EventListener event="test" />
+        </execute>
+      </events>
+    </DialogueManager>
+  -->
+
+
     <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 />
Index: /code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc
===================================================================
--- /code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc	(revision 11392)
+++ /code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc	(revision 11393)
@@ -10,23 +10,27 @@
 #include <vector>
 #include <string>
+#include "core/XMLPort.h"
+
 
 namespace orxonox {
-	ManageScopedSingleton(DialogueManager, ScopeID::ROOT, false);
-	RegisterClassNoArgs(DialogueManager);
+	//ManageScopedSingleton(DialogueManager, ScopeID::ROOT, false);
+	RegisterAbstractClass(DialogueManager).inheritsFrom<Configurable>();
 
-	DialogueManager::DialogueManager(){
+
+
+	DialogueManager* DialogueManager::singletonPtr_s =nullptr;
+
+	DialogueManager::DialogueManager(Context* context): BaseObject(context){
 		RegisterObject(DialogueManager);
 		this->setConfigValues();
+		
 
 	}
 	
+
 	/**
      * @brief set the config values in the orxonox.ini file
      */
-    void DialogueManager::setConfigValues()
-    {
-        //SetConfigValue(question,std::string).description("Question");
-        
-    }
+    
 
     void DialogueManager::setquestion(std::string question){
@@ -43,4 +47,21 @@
         XMLPortParam(DialogueManager, "question", setquestion, getquestion, xmlelement, mode);
     }
+
+	bool DialogueManager::execute(bool bTriggered, BaseObject* trigger)
+    {  
+        if(!bTriggered) return false;
+
+        orxout() << "bTriggered is " << bTriggered;
+        //orxout() << " 1 " << mystring << endl;
+        return false;
+    }
+
+    void DialogueManager::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(DialogueManager, XMLEventPort, xmlelement, mode);
+
+        XMLPortEventSink(DialogueManager, BaseObject, "execute", execute, xmlelement, mode); 
+    }
+
 	/*std::string DialogueManager::setnpc(std::string npc){
 		return npc;
Index: /code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h
===================================================================
--- /code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h	(revision 11392)
+++ /code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h	(revision 11393)
@@ -13,4 +13,5 @@
 #include "core/config/Configurable.h"
 #include "core/XMLPort.h"
+#include "core/EventIncludes.h"
 
 //tolua_begin
@@ -18,5 +19,5 @@
 //tolua_end
 {//toluaexport
-	class _OrxonoxExport DialogueManager : public Singleton<DialogueManager>, public Configurable
+	class _OrxonoxExport DialogueManager : public Singleton<DialogueManager>, public BaseObject
 	{
 		friend class Singleton<DialogueManager>;
@@ -24,11 +25,19 @@
 		public:
 
-		DialogueManager(); // tolua_export
+		DialogueManager(Context* context); // tolua_export
+		
+
 		static DialogueManager& getInstance() { return Singleton<DialogueManager>::getInstance(); } 
-		void setConfigValues();
+		
 		virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
-			void setquestion(std::string question);
-			std::string getquestion(void);
+		void setquestion(std::string question);
+		std::string getquestion(void);
+
+
+		virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
+		bool execute(bool bTriggered, BaseObject* trigger);
+
+	
 
 			/*std::string setnpc(std::string npc);
Index: /code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.cc
===================================================================
--- /code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.cc	(revision 11393)
+++ /code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.cc	(revision 11393)
@@ -0,0 +1,27 @@
+#include <vector>
+#include <string>
+
+#include "NextQuestion.h"
+#include "core/XMLPort.h"
+
+namespace orxonox{
+
+	RegisterClass(NextQuestion);
+
+	vector<NextQuestion> nextquestion;
+
+	void NextQuestion::setanswers(std::string option1, std::string option2, std::string option3){
+		options.at(0)=option1;
+		options.at(1)=option2;
+		options.at(2)=option3;
+	}
+
+	vector<std::string> NextQuestion::getanswers(void){
+		return options;
+	}
+
+	int NextQuestion::getnumOptions(){
+		return options.size();
+	}
+
+}
Index: /code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.h
===================================================================
--- /code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.h	(revision 11393)
+++ /code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.h	(revision 11393)
@@ -0,0 +1,12 @@
+#include <vector>
+#include <string>
+
+#include "core/XMLPort.h"
+
+namespace orxonox{
+	void setanswers(std::string option1, std::string option2, std::string option3);
+	std::vector <std::string> getanswers(void);
+
+	int getnumOptions();
+	std::vector<std::string> options;
+}
