Index: /branches/script_engine/src/lib/script_engine/script_manager.cc
===================================================================
--- /branches/script_engine/src/lib/script_engine/script_manager.cc	(revision 8170)
+++ /branches/script_engine/src/lib/script_engine/script_manager.cc	(revision 8171)
@@ -18,12 +18,4 @@
 }
 
-ScriptManager* ScriptManager::getInstance()
-{
-
-  if (!ScriptManager::singletonRef)
-    ScriptManager::singletonRef = new ScriptManager();
-  return ScriptManager::singletonRef;
-
-}
 
 void ScriptManager::loadParams(const TiXmlElement* root)
@@ -84,6 +76,6 @@
     LOAD_PARAM_START_CYCLE(script, object);
     {
-      LoadParam_CYCLE(object, "object", this, ScriptManager, addObjectToScript)
-          .describe("The name of an object that is needed by a script");
+     // LoadParam_CYCLE(object, "object", this, ScriptManager, addObjectToScript)
+       //   .describe("The name of an object that is needed by a script");
     }
     LOAD_PARAM_END_CYCLE(object);
@@ -96,4 +88,19 @@
   }
 
+
+}
+
+
+Script* ScriptManager::getScriptByFile(std::string& file)
+{
+
+  for(std::list<LuaScript>::iterator it = scriptList.begin(); it != scriptList.end(); it++ )
+  {
+    if( (*it).name.compare(file) == 0)
+    {
+      return &((*it).script);
+    }
+  }
+  return NULL;
 
 }
Index: /branches/script_engine/src/lib/script_engine/script_manager.h
===================================================================
--- /branches/script_engine/src/lib/script_engine/script_manager.h	(revision 8170)
+++ /branches/script_engine/src/lib/script_engine/script_manager.h	(revision 8171)
@@ -25,5 +25,5 @@
    ~ScriptManager();
 
-  inline static ScriptManager* getInstance();
+  inline static ScriptManager* getInstance(){if (!ScriptManager::singletonRef)ScriptManager::singletonRef = new ScriptManager();return ScriptManager::singletonRef;}
 
   virtual void loadParams(const TiXmlElement* root);
@@ -33,4 +33,5 @@
 
   void initScripts(); // initializes all scripts
+  Script* getScriptByFile(std::string& file);
 
  private:
Index: /branches/script_engine/src/lib/script_engine/script_trigger.cc
===================================================================
--- /branches/script_engine/src/lib/script_engine/script_trigger.cc	(revision 8170)
+++ /branches/script_engine/src/lib/script_engine/script_trigger.cc	(revision 8171)
@@ -0,0 +1,61 @@
+#include "script_trigger.h"
+
+
+ScriptTrigger::ScriptTrigger()
+{
+ scriptCalled = false;
+}
+
+ScriptTrigger::~ScriptTrigger()
+{
+
+}
+
+void ScriptTrigger::loadParams(const TiXmlElement* root)
+{
+   /* LoadParam(root, "file", this, ScriptTrigger, setScript)
+        .describe("the fileName of the script, that should be triggered by this script trigger")
+        .defaultValues("");
+    LoadParam(root, "function", this, ScriptTrigger, setFunction)
+        .describe("the function of the script, that should be triggered by this script trigger")
+        .defaultValues("");
+    LoadParam(root, "abs-coor", this, ScriptTrigger, setAbsCoord)
+        .describe("the fileName of the script, that should be triggered by this script trigger")
+        .defaultValues("");
+    LoadParam(root, "radius", this, ScriptTrigger, setRadius)
+        .describe("the fileName of the script, that should be triggered by this script trigger")
+        .defaultValues("");
+    */
+}
+
+
+
+void ScriptTrigger::tick(float timestep)
+{
+
+ if((this->getAbsDirV()-target->getAbsDirV()).len() < radius)
+ {
+  if(!callOnce)
+   {
+    executeAction();
+   }
+  else if(callOnce && !scriptCalled)
+  {
+   executeAction();
+   scriptCalled = true;
+  }
+ }
+
+}
+
+
+
+void ScriptTrigger::executeAction()
+{
+     ScriptManager* scriptManager = ScriptManager::getInstance();
+     Script* script = scriptManager->getScriptByFile(this->scriptFile);
+     if(!(script->selectFunction(this->functionName,0)) )
+       printf("Error: Selection of %s in %s failed.\n",functionName.c_str(), scriptFile.c_str());
+     if( !(script->executeFunction()) )
+       printf("Execution of %s in %s failed\n",functionName.c_str(),scriptFile.c_str());
+}
Index: /branches/script_engine/src/lib/script_engine/script_trigger.h
===================================================================
--- /branches/script_engine/src/lib/script_engine/script_trigger.h	(revision 8170)
+++ /branches/script_engine/src/lib/script_engine/script_trigger.h	(revision 8171)
@@ -2,6 +2,10 @@
 #define _SCRIPT_TRIGGER_H
 
+#include <string>
+
 #include "world_entity.h"
 #include "loading/load_param.h"
+#include "vector.h"
+#include "script_manager.h"
 
 class ScriptTrigger : public WorldEntity
@@ -12,5 +16,12 @@
 
     virtual void loadParams(const TiXmlElement* root);
-    virtual voit tick(float timestep);
+    virtual void tick(float timestep);
+    virtual void executeAction();
+
+    void setTarget(WorldEntity* target){ if(target!=NULL) this->target=target;}
+    void setCallOnce(bool call){this->callOnce = call;}
+    void setRadius(float radius){if(radius>0) this->radius = radius;}
+    void setScript(std::string& script){this->scriptFile = script;}
+    void setFunction(std::string& function){this->functionName = function;}
 
   private:
