Index: code/branches/camera/bin/levels/sample.oxw
===================================================================
--- code/branches/camera/bin/levels/sample.oxw	(revision 1540)
+++ code/branches/camera/bin/levels/sample.oxw	(revision 1541)
@@ -10,5 +10,5 @@
 
 <Ambient colourvalue="1,1,1" />
-<Skybox src="Orxonox/StarSkyBox" />
+<Skybox src="Orxonox/StarfieldSkyBox" />
 <SpaceShip camera="true" position="0,0,0" scale="10" yawpitchroll="-90,-90,0" mesh="assf3.mesh" maxSpeed="500" maxSideAndBackSpeed="50" maxRotation="1.0" transAcc="200" rotAcc="3.0" transDamp="75" rotDamp="1.0" />
 
Index: code/branches/input/bin/plugins.cfg-init
===================================================================
--- code/branches/input/bin/plugins.cfg-init	(revision 1540)
+++ code/branches/input/bin/plugins.cfg-init	(revision 1541)
@@ -2,5 +2,5 @@
 
 # Define plugin folder
-PluginFolder=/usr/lib/OGRE
+PluginFolder=/usr/local/lib/OGRE
 
 # Define plugins
Index: code/branches/network/bin/plugins.cfg-init
===================================================================
--- code/branches/network/bin/plugins.cfg-init	(revision 1540)
+++ code/branches/network/bin/plugins.cfg-init	(revision 1541)
@@ -2,5 +2,5 @@
 
 # Define plugin folder
-PluginFolder=/usr/lib/OGRE
+PluginFolder=/usr/local/lib/OGRE
 
 # Define plugins
Index: code/branches/script_trigger/bin/levels/sample.oxw
===================================================================
--- code/branches/script_trigger/bin/levels/sample.oxw	(revision 1540)
+++ code/branches/script_trigger/bin/levels/sample.oxw	(revision 1541)
@@ -1,3 +1,3 @@
- <!--audio>
+<AudioManager>
 	<ambient>
 		<ogg src="allgorythm-lift_up" />
@@ -7,5 +7,5 @@
 		<ogg src="tha_silent_partner_-_void" />
 	</ambient>
-  </audio--> 
+</AudioManager> 
 
 <!--Ambient colourvalue="1,1,1" /-->
Index: code/branches/script_trigger/src/audio/AudioManager.cc
===================================================================
--- code/branches/script_trigger/src/audio/AudioManager.cc	(revision 1540)
+++ code/branches/script_trigger/src/audio/AudioManager.cc	(revision 1541)
@@ -39,109 +39,104 @@
 namespace audio
 {
-	AudioManager::AudioManager()
-	{
+  AudioManager::AudioManager()
+  {
     ambientPath = "audio/ambient";
 
     alutInit(NULL, 0);
+  }
 
+  AudioManager::~AudioManager()
+  {
+    for (unsigned int i=0;i<bgSounds.size();i++)
+    {
+      bgSounds[i]->release();
+    }
+    alutExit();
+  }
 
-	}
+  void AudioManager::ambientStart()
+  {
+    // currentBgSound = 0;
+    if (bgSounds.size() > 0)
+    {
+      currentBgSound = rand() % bgSounds.size();
+      if(!bgSounds[currentBgSound]->playback())
+      {
+        orxonox::Error("Ogg refused to play.");
+      }
+      else
+      {
+        COUT(3) << "Info: Started playing background sound" << std::endl;
+      }
+    }
+  }
 
-	AudioManager::~AudioManager()
-	{
-		for (unsigned int i=0;i<bgSounds.size();i++)
-		{
-			bgSounds[i]->release();
-		}
-		alutExit();
-	}
+  void AudioManager::ambientStop()
+  {
+    COUT(3) << "Info: Stopped playing background sound" << std::endl;
+  }
 
-	void AudioManager::ambientStart()
-	{
-// 		currentBgSound = 0;
-		if (bgSounds.size() > 0)
-		{
-      currentBgSound = rand() % bgSounds.size();
-			if(!bgSounds[currentBgSound]->playback())
-			{
-    		orxonox::Error("Ogg refused to play.");
-			}
-			else
-			{
-				COUT(3) << "Info: Started playing background sound" << std::endl;
-			}
-		}
-	}
+  void AudioManager::ambientAdd(std::string file)
+  {
+    std::string path = ambientPath + "/" + file + ".ogg";
+    AudioStream* tmp = new AudioStream(path);
+    tmp->open();
+    if (tmp->isLoaded())
+    {
+      bgSounds.push_back(tmp);
+      COUT(3) << "Info: Added background sound " << file << std::endl;
+    }
+  }
 
-	void AudioManager::ambientStop()
-	{
-		COUT(3) << "Info: Stopped playing background sound" << std::endl;
-	}
-
-	void AudioManager::ambientAdd(std::string file)
-	{
-    std::string path = ambientPath + "/" + file + ".ogg";
-		AudioStream* tmp = new AudioStream(path);
-		tmp->open();
-		if (tmp->isLoaded())
-		{
-			bgSounds.push_back(tmp);
-			COUT(3) << "Info: Added background sound " << file << std::endl;
-		}
-	}
-
-	void AudioManager::tick(float dt)
-	{
-		if (bgSounds.size() > 0)
-		{
-			if (bgSounds[currentBgSound]->isLoaded())
-			{
-				bool playing = bgSounds[currentBgSound]->update();
-		    if(!bgSounds[currentBgSound]->playing() && playing)
-		    {
-		        if(!bgSounds[currentBgSound]->playback())
-		            orxonox::Error("Ogg abruptly stopped.");
-		        else
-		            orxonox::Error("Ogg stream was interrupted.");
-
-		    }
-				if (!playing)
-				{
-// 					if (currentBgSound < bgSounds.size()-1)
-// 					{
-// 						currentBgSound++;
-// 					}
-// 					else
-// 					{
-// 						currentBgSound=0;
-// 					}
+  void AudioManager::tick(float dt)
+  {
+    if (bgSounds.size() > 0)
+    {
+      if (bgSounds[currentBgSound]->isLoaded())
+      {
+        bool playing = bgSounds[currentBgSound]->update();
+        if(!bgSounds[currentBgSound]->playing() && playing)
+        {
+          if(!bgSounds[currentBgSound]->playback())
+            orxonox::Error("Ogg abruptly stopped.");
+          else
+            orxonox::Error("Ogg stream was interrupted.");
+        }
+        if (!playing)
+        {
+          // if (currentBgSound < bgSounds.size()-1)
+          // {
+          //   currentBgSound++;
+          // }
+          // else
+          // {
+          //   currentBgSound=0;
+          // }
           // switch to next sound in list/array
           currentBgSound = ++currentBgSound % bgSounds.size();
 
-					if (!bgSounds[currentBgSound]->isLoaded())
-					{
-						bgSounds[currentBgSound]->release();
-						bgSounds[currentBgSound]->open();
-					}
-					bgSounds[currentBgSound]->playback();
-					COUT(3) << "Info: Playing next background sound" << std::endl;
-				}
-			}
-		}
-	}
+          if (!bgSounds[currentBgSound]->isLoaded())
+          {
+            bgSounds[currentBgSound]->release();
+            bgSounds[currentBgSound]->open();
+          }
+          bgSounds[currentBgSound]->playback();
+          COUT(3) << "Info: Playing next background sound" << std::endl;
+        }
+      }
+    }
+  }
 
-	void AudioManager::setPos(std::vector<float> newPosition)
-	{
+  void AudioManager::setPos(std::vector<float> newPosition)
+  {
+  }
 
-	}
+  void AudioManager::setSpeed(std::vector<float> newSpeed)
+  {
+  }
 
-	void AudioManager::setSpeed(std::vector<float> newSpeed)
-	{
+  void AudioManager::setOri(std::vector<float> at, std::vector<float> up)
+  {
+  }
 
-	}
-
-	void AudioManager::setOri(std::vector<float> at, std::vector<float> up)
-	{
-
-	}
 }
Index: code/branches/script_trigger/src/core/ClassTreeMask.h
===================================================================
--- code/branches/script_trigger/src/core/ClassTreeMask.h	(revision 1540)
+++ code/branches/script_trigger/src/core/ClassTreeMask.h	(revision 1541)
@@ -60,5 +60,5 @@
     step back, and so on.
 
-    Example: A and B are childs of BaseObject, A1 and A2 are childs of A, B1 and B2 are childs of B.
+    @example: A and B are childs of BaseObject, A1 and A2 are childs of A, B1 and B2 are childs of B.
     The ClassTreeMaskIterator would move trough the tree in the following order:
     BaseObject, A, A1, A2, B, B1, B2.
Index: code/branches/script_trigger/src/orxonox/objects/Trigger.cc
===================================================================
--- code/branches/script_trigger/src/orxonox/objects/Trigger.cc	(revision 1540)
+++ code/branches/script_trigger/src/orxonox/objects/Trigger.cc	(revision 1541)
@@ -39,4 +39,5 @@
     RegisterObject(Trigger);
 
+    targetMask_.exclude(Class(BaseObject));
   }
 
@@ -47,5 +48,39 @@
   bool Trigger::isTriggered()
   {
-    return true;
+    return this->isTriggered(this->mode_);
+  }
+
+  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
+          return false;
+        break;
+      case TM_DistanceEventTriggerOr:
+        if (checkDistance() && checkOr())
+          return true;
+        else
+          return false;
+        break;
+      default:
+        return false;
+        break;
+    }
   }
 
@@ -56,3 +91,54 @@
   }
 
+  void Trigger::addTargets(std::string targets)
+  {
+    Identifier* targetId = ID(targets);
+    targetMask_.include(targetId);
+    // trigger shouldn't react on itself or other triggers
+    targetMask_.exclude(Class(Trigger), true);
+  }
+
+  bool Trigger::checkAnd()
+  {
+    std::set<Trigger*>::iterator it;
+    for(it = this->triggers_.begin(); it != this->triggers_.end(); it++)
+    {
+      if(!((*it)->isTriggered()))
+        return false;
+    }
+    return true;
+  }
+
+  bool Trigger::checkOr()
+  {
+    std::set<Trigger*>::iterator it;
+    for(it = this->triggers_.begin(); it != this->triggers_.end(); it++)
+    {
+      if((*it)->isTriggered())
+        return true;
+    }
+    return false;
+  }
+
+  bool Trigger::checkDelay()
+  {
+    if (triggingTime_ < actualTime_)
+      return true;
+    else
+      return false;
+  }
+
+  bool Trigger::checkDistance()
+  {
+    // Iterate through all WorldEntities
+    for(Iterator<WorldEntity> it = ObjectList<WorldEntity>::begin(); it; it++)
+    {
+      Vector3 distanceVec = it->getNode()->getWorldPosition() - this->getNode()->getWorldPosition();
+      if (distanceVec.length() < radius_)
+        return true;
+    }
+    return false;
+
+  }
+
 }
Index: code/branches/script_trigger/src/orxonox/objects/Trigger.h
===================================================================
--- code/branches/script_trigger/src/orxonox/objects/Trigger.h	(revision 1540)
+++ code/branches/script_trigger/src/orxonox/objects/Trigger.h	(revision 1541)
@@ -30,5 +30,5 @@
 #define _Trigger_H__
 
-#include <list>
+#include <set>
 
 #include "OrxonoxPrereqs.h"
@@ -36,4 +36,5 @@
 #include "WorldEntity.h"
 #include "core/BaseObject.h"
+#include "core/ClassTreeMask.h"
 
 namespace orxonox {
@@ -56,12 +57,24 @@
 
       bool isTriggered();
+      bool isTriggered(TriggerMode mode);
       void addTrigger(Trigger* trig);
+      void addTargets(std::string targets);
       inline TriggerMode getMode() { return mode_; }
       inline void setMode(TriggerMode mode) { this->mode_ = mode; }
+      inline void tick(float dt) { this->actualTime_ += dt; }
+
+    private:
+      bool checkAnd();
+      bool checkOr();
+      bool checkDelay();
+      bool checkDistance();
 
     private:
       std::set<Trigger*> triggers_;
       TriggerMode mode_;
-
+      float triggingTime_;
+      float actualTime_;
+      float radius_;
+      ClassTreeMask targetMask_;
   };
 
