Changeset 8178 in orxonox.OLD for branches/script_engine/src/lib/script_engine/script_trigger.cc
- Timestamp:
- Jun 6, 2006, 8:47:40 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/script_engine/src/lib/script_engine/script_trigger.cc
r8173 r8178 23 23 .defaultValues(""); 24 24 LoadParam(root, "abs-coor", this, ScriptTrigger, setAbsCoord) 25 .describe(" the fileName of the script, that should be triggered by this script trigger")25 .describe("where this script trigger should be located") 26 26 .defaultValues(""); 27 27 LoadParam(root, "radius", this, ScriptTrigger, setRadius) … … 31 31 .describe("the delay after which the funtion sould be triggered") 32 32 .defaultValues(0); 33 LoadParam(root, "worldentity", this, ScriptTrigger, setTargetName) 34 .describe("The name of the target as it is in the *.oxw file") 35 .defaultValues(""); 36 LoadParam(root, "worldentityisparent", this, ScriptTrigger, setIsParent) 37 .describe("The name of the target as it is in the *.oxw file") 38 .defaultValues(""); 39 33 40 }*/ 34 41 timer = delay; … … 39 46 void ScriptTrigger::tick(float timestep) 40 47 { 41 //if(triggered)42 //{43 //timer -= timestep;44 //if(timer < 0)45 callScript = true;46 //}47 48 48 49 49 if((this->getAbsDirV()-target->getAbsDirV()).len() < radius) 50 50 { 51 //triggered = true; 52 if(!callOnce && callScript) 51 if(!callOnce) 53 52 { 54 53 executeAction(); 55 54 } 56 else if(callOnce && !scriptCalled && callScript)55 else if(callOnce && !scriptCalled) 57 56 { 58 57 executeAction(); … … 70 69 Script* script = scriptManager->getScriptByFile(this->scriptFile); 71 70 if(!(script->selectFunction(this->functionName,0)) ) 72 printf("Error : Selection of %s in %s failed.\n",functionName.c_str(), scriptFile.c_str());71 printf("Error ScriptTrigger: Selection of %s in %s failed.\n",functionName.c_str(), scriptFile.c_str()); 73 72 if( !(script->executeFunction()) ) 74 printf("E xecution of %s in %s failed\n",functionName.c_str(),scriptFile.c_str());73 printf("Error ScriptTrigger: Execution of %s in %s failed.\n",functionName.c_str(),scriptFile.c_str()); 75 74 }
Note: See TracChangeset
for help on using the changeset viewer.