Index: /code/branches/script_trigger/bin/levels/sample.oxw
===================================================================
--- /code/branches/script_trigger/bin/levels/sample.oxw	(revision 1670)
+++ /code/branches/script_trigger/bin/levels/sample.oxw	(revision 1671)
@@ -38,4 +38,6 @@
 <Model position="-200,1000,500" scale="10" mesh="hoover_turbine.mesh" yawpitchroll="-90,-90,0" /-->
 
+<Trigger position="0,0,0" scale="2"/>
+
 
 <?lua
Index: /code/branches/script_trigger/src/orxonox/objects/Trigger.cc
===================================================================
--- /code/branches/script_trigger/src/orxonox/objects/Trigger.cc	(revision 1670)
+++ /code/branches/script_trigger/src/orxonox/objects/Trigger.cc	(revision 1671)
@@ -30,9 +30,14 @@
 
 #include "core/Debug.h"
+#include <OgreBillboard.h>
 
 #include "core/CoreIncludes.h"
+#include "core/ConsoleCommand.h"
 
 namespace orxonox
 {
+
+  ConsoleCommand(Trigger, setVisibility, AccessLevel::Debug, false).setDefaultValues(0);
+
   CreateFactory(Trigger);
 
@@ -43,9 +48,11 @@
     targetMask_.exclude(Class(BaseObject));
 
-    if (getSoftDebugLevel() >= ORX_DEBUG)
-    {
-      debugBillboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 0.0, 0.0), 1);
-      this->getNode()->attachObject(debugBillboard_.getBillboardSet());
-    }
+    //testing
+    mode_ = TM_EventTriggerAND;
+    bActive_ = true;
+    triggingTime_ = 100;
+
+    debugBillboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 0.0, 0.0), 1);
+    this->getNode()->attachObject(debugBillboard_.getBillboardSet());
   }
 
@@ -59,36 +66,49 @@
   }
 
+  void Trigger::setVisibility(int bVisible)
+  {
+    if(bVisible)
+      this->setScale(2,2,2);
+    else
+      this->setScale(0,0,0);
+  }
+
+  void Trigger::tick(float dt)
+  {
+    //COUT(0) << "Scale: " << this->getScale() << std::endl;
+    if(bActive_)
+    {
+      //this->actualTime_ += dt;
+      if(this->isTriggered())
+      {
+        this->debugBillboard_.getBillboardSet()->getBillboard(0)->setColour(ColourValue(0.0, 1.0, 0.0));
+      }
+    }
+  }
+
   bool Trigger::isTriggered(TriggerMode mode)
   {
-    switch(mode)
-    {
-      case TM_EventTriggerAnd:
-        return checkAnd();
-        break;
-      case TM_EventTriggerOr:
-        return checkOr();
-        break;
-      case TM_DelayTrigger:
-        return checkDelay();
-        break;
-      case TM_DistanceTrigger:
-        return checkDistance();
-        break;
-      case TM_DistanceEventTriggerAnd:
-        if (checkDistance() && checkAnd())
-          return true;
-        else
+    if( children_.size() != 0 )
+    {
+      switch(mode)
+      {
+        case TM_EventTriggerAND:
+          return checkAnd();
+          break;
+        case TM_EventTriggerOR:
+          return checkOr();
+          break;
+        case TM_EventTriggerXOR:
+          return checkXor();
+          break;
+        case TM_EventTriggerNOT:
+          return checkNot();
+          break;
+        default:
           return false;
-        break;
-      case TM_DistanceEventTriggerOr:
-        if (checkDistance() && checkOr())
-          return true;
-        else
-          return false;
-        break;
-      default:
-        return false;
-        break;
-    }
+          break;
+      }
+    }
+    return true;
   }
 
@@ -101,5 +121,5 @@
   {
     if (this != trig)
-      this->subTriggers_.insert(trig);
+      this->children_.insert(trig);
   }
 
@@ -121,5 +141,5 @@
   {
     std::set<Trigger*>::iterator it;
-    for(it = this->subTriggers_.begin(); it != this->subTriggers_.end(); it++)
+    for(it = this->children_.begin(); it != this->children_.end(); it++)
     {
       if(!((*it)->isTriggered()))
@@ -132,5 +152,5 @@
   {
     std::set<Trigger*>::iterator it;
-    for(it = this->subTriggers_.begin(); it != this->subTriggers_.end(); it++)
+    for(it = this->children_.begin(); it != this->children_.end(); it++)
     {
       if((*it)->isTriggered())
@@ -140,5 +160,30 @@
   }
 
-  bool Trigger::checkDelay()
+  bool Trigger::checkNot()
+  {
+    std::set<Trigger*>::iterator it;
+    for(it = this->children_.begin(); it != this->children_.end(); it++)
+    {
+      if((*it)->isTriggered())
+        return false;
+    }
+    return true;
+  }
+
+  bool Trigger::checkXor()
+  {
+    std::set<Trigger*>::iterator it;
+    bool test = false;
+    for(it = this->children_.begin(); it != this->children_.end(); it++)
+    {
+      if(test && (*it)->isTriggered())
+        return false;
+      if((*it)->isTriggered())
+        test = true;
+    }
+    return test;
+  }
+
+  /*bool Trigger::checkDelay()
   {
     if (triggingTime_ < actualTime_)
@@ -159,5 +204,5 @@
     return false;
 
-  }
+  }*/
 
 }
Index: /code/branches/script_trigger/src/orxonox/objects/Trigger.h
===================================================================
--- /code/branches/script_trigger/src/orxonox/objects/Trigger.h	(revision 1670)
+++ /code/branches/script_trigger/src/orxonox/objects/Trigger.h	(revision 1671)
@@ -43,10 +43,8 @@
   enum TriggerMode
   {
-    TM_EventTriggerAnd,
-    TM_EventTriggerOr,
-    TM_DelayTrigger,
-    TM_DistanceTrigger,
-    TM_DistanceEventTriggerAnd,
-    TM_DistanceEventTriggerOr,
+    TM_EventTriggerAND,
+    TM_EventTriggerOR,
+    TM_EventTriggerXOR,
+    TM_EventTriggerNOT
   };
 
@@ -55,5 +53,4 @@
     public:
       Trigger();
-      Trigger(bool active) { bActive_ = active; }
       ~Trigger();
 
@@ -63,8 +60,9 @@
       void addTargets(std::string targets);
       void removeTargets(std::string targets);
+      void setVisibility(int bVisible);
       virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
       inline TriggerMode getMode() { return mode_; }
       inline void setMode(TriggerMode mode) { this->mode_ = mode; }
-      inline void tick(float dt) { if(bActive_) this->actualTime_ += dt; }
+      void tick(float dt);
       inline void reset(float time) { this->actualTime_ = 0; this->triggingTime_ = time; }
       inline void reset() { reset(triggingTime_); }
@@ -73,9 +71,9 @@
       bool checkAnd();
       bool checkOr();
-      bool checkDelay();
-      bool checkDistance();
+      bool checkXor();
+      bool checkNot();
 
     private:
-      std::set<Trigger*> subTriggers_;
+      std::set<Trigger*> children_;
       TriggerMode mode_;
       float triggingTime_;
