Changeset 9406 in orxonox.OLD for trunk/src/world_entities/script_trigger.cc
- Timestamp:
- Jul 24, 2006, 11:09:47 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/script_trigger.cc
r9298 r9406 63 63 addToScript = false; 64 64 this->activeOnCreation = false; 65 65 66 66 if(root != NULL) 67 67 { 68 68 69 69 loadParams(root); 70 70 71 71 if(addToScript && scriptIsOk) 72 72 { 73 73 script->addObject( "ScriptTrigger", this->getName()); 74 74 } 75 76 } 77 75 76 } 77 78 78 } 79 79 80 80 /** 81 81 * Deletes the ScriptTrigger. 82 * 82 * 83 83 */ 84 84 ScriptTrigger::~ScriptTrigger() … … 147 147 else 148 148 { 149 PRINTF(2)("Target %s for %s::%s does not Exist\n", target.c_str(), this->getClass Name(), this->getName());149 PRINTF(2)("Target %s for %s::%s does not Exist\n", target.c_str(), this->getClassCName(), this->getCName()); 150 150 } 151 151 } … … 153 153 /** 154 154 * Sets the parent of the trigger. 155 * @param parent The parrent. 155 * @param parent The parrent. 156 156 */ 157 157 void ScriptTrigger::setTriggerParent(const std::string& parent) … … 166 166 else 167 167 { 168 PRINTF(2)("Parent %s for %s::%s does not Exist\n", parent.c_str(), this->getClass Name(), this->getName());168 PRINTF(2)("Parent %s for %s::%s does not Exist\n", parent.c_str(), this->getClassCName(), this->getCName()); 169 169 } 170 170 } … … 179 179 return; 180 180 } 181 181 182 182 if(triggerRemains && scriptCalled) 183 183 { … … 185 185 return; 186 186 } 187 187 188 188 if( !invert && this->distance(target) < radius) 189 189 { … … 191 191 scriptCalled = true; 192 192 return; 193 193 194 194 } 195 195 else if( invert && this->distance(target) > radius) 196 196 { 197 executeAction(timestep); 197 executeAction(timestep); 198 198 scriptCalled = true; 199 199 return; … … 207 207 void ScriptTrigger::executeAction(float timestep) 208 208 { 209 209 210 210 if(scriptIsOk) 211 211 { … … 213 213 if(!(script->selectFunction(this->functionName,returnCount)) ) 214 214 PRINT(1)("Error ScriptTrigger: Selection of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str()); 215 215 216 216 script->pushParam( timestep, this->functionName); 217 217 218 218 if( !(script->executeFunction()) ) 219 219 PRINT(1)("Error ScriptTrigger: Execution of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str()); 220 220 221 221 scriptFinished = script->getReturnedBool(); 222 222 } 223 224 223 224 225 225 } 226 226 … … 268 268 float retf = script->getReturnedFloat(); 269 269 printf("main returned %f\n",retf); 270 270 271 271 272 272 printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState()));
Note: See TracChangeset
for help on using the changeset viewer.