Index: /branches/inputdevice/src/world_entities/WorldEntities.am
===================================================================
--- /branches/inputdevice/src/world_entities/WorldEntities.am	(revision 10630)
+++ /branches/inputdevice/src/world_entities/WorldEntities.am	(revision 10631)
@@ -111,4 +111,5 @@
 		world_entities/script_triggers/tick_trigger.cc \
 		world_entities/script_triggers/time_trigger.cc \
+                world_entities/script_triggers/action_trigger.cc \
                 \
                 \
@@ -234,4 +235,5 @@
 		script_triggers/tick_trigger.h \
 		script_triggers/time_trigger.h \
+                script_triggers/action_trigger.h \
                 \
                 \
Index: /branches/inputdevice/src/world_entities/script_triggers/action_trigger.cc
===================================================================
--- /branches/inputdevice/src/world_entities/script_triggers/action_trigger.cc	(revision 10630)
+++ /branches/inputdevice/src/world_entities/script_triggers/action_trigger.cc	(revision 10631)
@@ -51,4 +51,5 @@
   radius = 10;
   invert = false;
+  actionScheduled = false;
  
   if(root != NULL)
@@ -117,7 +118,7 @@
 
 
-void ActionTrigger::tick(float timestep)
+void ActionTrigger::tick( float timestep )
 {
-  if( scriptFinished ) return;
+  if( scriptFinished || !actionScheduled ) return;
 
   if( this->target != NULL)
@@ -125,13 +126,11 @@
     if( !invert && this->distance(target) < radius && actionScheduled)
     {
-    //printf("Distance is %f \n", this->distance(target));
-      executeAction(timestep);
+      executeScriptFunction(timestep);
       scriptCalled = true;
       return;
-
     }
     else if( invert && this->distance(target) > radius  && actionScheduled)
     {
-      executeAction(timestep);
+      executeScriptFunction(timestep);
       scriptCalled = true;
       return;
Index: /branches/inputdevice/src/world_entities/script_triggers/action_trigger.h
===================================================================
--- /branches/inputdevice/src/world_entities/script_triggers/action_trigger.h	(revision 10630)
+++ /branches/inputdevice/src/world_entities/script_triggers/action_trigger.h	(revision 10631)
@@ -4,6 +4,6 @@
  */
 
-#ifndef _SPACE_TRIGGER_H
-#define _SPACE_TRIGGER_H
+#ifndef _ACTION_TRIGGER_H
+#define _ACTION_TRIGGER_H
 
 #include <string>
@@ -26,6 +26,6 @@
 
     /// DO WORK
+    virtual void executeAction(){actionScheduled = true;}
     virtual void tick(float timestep);
-
 
     /// SET MEMBER
Index: /branches/inputdevice/src/world_entities/script_triggers/script_trigger.cc
===================================================================
--- /branches/inputdevice/src/world_entities/script_triggers/script_trigger.cc	(revision 10630)
+++ /branches/inputdevice/src/world_entities/script_triggers/script_trigger.cc	(revision 10631)
@@ -104,5 +104,5 @@
 
 
-void ScriptTrigger::executeAction(float timestep)
+void ScriptTrigger::executeScriptFunction(float timestep)
 {
   if(executionStopped && scriptIsOk) // If the script has been loaded correctly but something is wrong with the settings of the trigger
@@ -114,5 +114,4 @@
   if(scriptIsOk)
   {
-       //testScriptingFramework();
     if(!(script->selectFunction(this->functionName,returnCount)) )
      {
@@ -166,47 +165,2 @@
   }
 }
-
-/*
- void ScriptTrigger::testScriptingFramework()
-{
-   std::string file("lunartest2.lua");
-   //get script
-   Script* script = State::getScriptManager()->getScriptByFile(file);
-   printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState()));
-
-      //execute a function
-   printf("----------- main -----------\n");
-   std::string main("main");
-   if( script->selectFunction(main,3))
-     printf("function %s selected\n",main.c_str());
-
-   script->pushParam(3.14159,main);
-   printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState()));
-   script->executeFunction();
-
-   int ret = script->getReturnedInt();
-   printf("main returned %i\n",ret);
-
-   if(script->getReturnedBool())
-     printf("main returned true\n");
-   else
-     printf("main returned false\n");
-
-   float retf = script->getReturnedFloat();
-   printf("main returned %f\n",retf);
-
-
-   printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState()));
-      //execute a 2nd function
-   printf("----------- test -----------\n");
-   std::string test("test");
-   if( script->selectFunction(test,0))
-     printf("function %s selected\n",test.c_str());
-
-   script->executeFunction();
-
-
-      //if(argc>1) lua_dofile(script.getLuaState(), argv[1]);
-   printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState()));
-
-}*/
Index: /branches/inputdevice/src/world_entities/script_triggers/script_trigger.h
===================================================================
--- /branches/inputdevice/src/world_entities/script_triggers/script_trigger.h	(revision 10630)
+++ /branches/inputdevice/src/world_entities/script_triggers/script_trigger.h	(revision 10631)
@@ -27,6 +27,6 @@
 
     /// DO WORK
-    virtual void tick(float timestep) = 0;
-    virtual void executeAction(float timestep);
+    virtual void tick(float timestep){}
+    virtual void executeScriptFunction(float timestep);
     void testScriptingFramework();
 
Index: /branches/inputdevice/src/world_entities/script_triggers/space_trigger.cc
===================================================================
--- /branches/inputdevice/src/world_entities/script_triggers/space_trigger.cc	(revision 10630)
+++ /branches/inputdevice/src/world_entities/script_triggers/space_trigger.cc	(revision 10631)
@@ -128,5 +128,5 @@
   if(triggerRemains && scriptCalled )
   {
-    executeAction(timestep);
+    executeScriptFunction(timestep);
     return;
   }
@@ -136,6 +136,5 @@
     if( !invert && this->distance(target) < radius)
     {
-    //printf("Distance is %f \n", this->distance(target));
-      executeAction(timestep);
+      executeScriptFunction(timestep);
       scriptCalled = true;
       return;
@@ -144,5 +143,5 @@
     else if( invert && this->distance(target) > radius)
     {
-      executeAction(timestep);
+      executeScriptFunction(timestep);
       scriptCalled = true;
       return;
Index: /branches/inputdevice/src/world_entities/script_triggers/tick_trigger.cc
===================================================================
--- /branches/inputdevice/src/world_entities/script_triggers/tick_trigger.cc	(revision 10630)
+++ /branches/inputdevice/src/world_entities/script_triggers/tick_trigger.cc	(revision 10631)
@@ -72,5 +72,5 @@
   if( scriptFinished ) return;
 
-  this->executeAction(timestep);
+  this->executeScriptFunction(timestep);
       
 }
Index: /branches/inputdevice/src/world_entities/script_triggers/time_trigger.cc
===================================================================
--- /branches/inputdevice/src/world_entities/script_triggers/time_trigger.cc	(revision 10630)
+++ /branches/inputdevice/src/world_entities/script_triggers/time_trigger.cc	(revision 10631)
@@ -102,5 +102,5 @@
     if(currentTime < 0)
     {
-      this->executeAction(timestep);
+      this->executeScriptFunction(timestep);
       this->stop();
     }
