Changeset 9241 in orxonox.OLD for branches/scripting
- Timestamp:
- Jul 6, 2006, 12:44:18 PM (18 years ago)
- Location:
- branches/scripting/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/scripting/src/lib/script_engine/script.cc
r9235 r9241 17 17 #include "script_class.h" 18 18 #include "luaincl.h" 19 19 #include "debug.h" 20 20 #include "util/loading/resource_manager.h" 21 21 … … 87 87 if(currentFile.length() != 0) 88 88 { 89 printf("Could not load %s because an other file is already loaded: %s\n",filename.c_str(), currentFile.c_str());89 PRINT(1)("Could not load %s because an other file is already loaded: %s\n",filename.c_str(), currentFile.c_str()); 90 90 return false; 91 91 } … … 104 104 else 105 105 { 106 printf("ERROR while loading file %s: \n",filename.c_str());106 PRINT(1)("ERROR while loading file %s: \n",filename.c_str()); 107 107 reportError(error); 108 108 } … … 111 111 else 112 112 { 113 printf("ERROR while loading file %s: \n",filename.c_str());113 PRINT(1)("ERROR while loading file %s: \n",filename.c_str()); 114 114 reportError(error); 115 115 } … … 150 150 bool Script::executeFile() 151 151 { 152 printf("WARNING: script.executeFile is not implemented yet");152 PRINT(2)("WARNING: script.executeFile is not implemented yet"); 153 153 /*if(currentFile.length() != 0) 154 154 { … … 183 183 } 184 184 else 185 printf("There is an other function active ( %s ) or there are unremoved return values on the stack. Please remove them first.\n",currentFunction.c_str());185 PRINT(1)("There is an other function active ( %s ) or there are unremoved return values on the stack. Please remove them first.\n",currentFunction.c_str()); 186 186 return false; 187 187 } … … 195 195 if(error != 0) 196 196 { 197 printf("ERROR while executing function %s: \n",currentFunction.c_str());197 PRINT(1)("ERROR while executing function %s: \n",currentFunction.c_str()); 198 198 reportError(error); 199 199 //clean up … … 210 210 } 211 211 else 212 printf("Error: no function selected.\n");212 PRINT(1)("Error: no function selected.\n"); 213 213 214 214 return false; … … 227 227 else 228 228 { 229 printf("Couldn't add parameter because the wrong function is selected: %s instead of %s\n", currentFunction.c_str(), toFunction.c_str());229 PRINT(1)("Couldn't add parameter because the wrong function is selected: %s instead of %s\n", currentFunction.c_str(), toFunction.c_str()); 230 230 return false; 231 231 } … … 244 244 else 245 245 { 246 printf("Couldn't add parameter because the wrong function is selected: %s instead of %s\n", currentFunction.c_str(), toFunction.c_str());246 PRINT(1)("Couldn't add parameter because the wrong function is selected: %s instead of %s\n", currentFunction.c_str(), toFunction.c_str()); 247 247 return false; 248 248 } … … 260 260 else 261 261 { 262 printf("Couldn't add parameter because the wrong function is selected: %s instead of %s\n", currentFunction.c_str(), toFunction.c_str());262 PRINT(1)("Couldn't add parameter because the wrong function is selected: %s instead of %s\n", currentFunction.c_str(), toFunction.c_str()); 263 263 return false; 264 264 } … … 295 295 } 296 296 else 297 printf("ERROR: Form %s : trying to retreive non bolean value",this->currentFile.c_str());297 PRINT(1)("ERROR: Form %s : trying to retreive non bolean value",this->currentFile.c_str()); 298 298 } 299 299 return returnValue; -
branches/scripting/src/world_entities/npcs/gate.cc
r9235 r9241 41 41 addMethod("hide", ExecutorLua0<WorldEntity>(&WorldEntity::hide)) 42 42 ->addMethod("unhide", ExecutorLua0<WorldEntity>(&WorldEntity::unhide)) 43 // ->addMethod("destroy", ExecutorLua0<Gate>(&Gate::destroy()))43 ->addMethod("destroy", ExecutorLua0<Gate>(&Gate::destroy)) 44 44 ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor)) 45 45 ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX)) -
branches/scripting/src/world_entities/script_trigger.cc
r9235 r9241 202 202 //testScriptingFramework(); 203 203 if(!(script->selectFunction(this->functionName,returnCount)) ) 204 printf("Error ScriptTrigger: Selection of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str());204 PRINT(1)("Error ScriptTrigger: Selection of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str()); 205 205 206 206 script->pushParam( timestep, this->functionName); 207 207 208 208 if( !(script->executeFunction()) ) 209 printf("Error ScriptTrigger: Execution of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str());209 PRINT(1)("Error ScriptTrigger: Execution of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str()); 210 210 211 211 scriptFinished = script->getReturnedBool();
Note: See TracChangeset
for help on using the changeset viewer.