Changeset 8289 in orxonox.OLD for branches/script_engine/src/world_entities
- Timestamp:
- Jun 8, 2006, 7:43:10 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/script_engine/src/world_entities/script_trigger.cc
r8286 r8289 18 18 loadParams(root); 19 19 20 printf("scripttrigger generated\n");21 20 } 22 21 … … 95 94 if( this->distance(target) < radius) 96 95 { 97 printf("SCRIPTTRIGGER: condition met\n");98 96 if(!callOnce) 99 97 { … … 102 100 else if(callOnce && !scriptCalled) 103 101 { 104 printf("action should be executed\n");105 102 executeAction(); 106 103 scriptCalled = true; 107 104 } 108 105 } 109 else110 printf("SCRIPTTRIGGER: target out of range\n");106 //else 107 //printf("SCRIPTTRIGGER: target out of range\n"); 111 108 112 109 } … … 118 115 { 119 116 testScriptingFramework(); 120 if(!(script->selectFunction(this->functionName,0)) )117 /*if(!(script->selectFunction(this->functionName,0)) ) 121 118 printf("Error ScriptTrigger: Selection of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str()); 122 119 if( !(script->executeFunction()) ) 123 printf("Error ScriptTrigger: Execution of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str()); 120 printf("Error ScriptTrigger: Execution of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str());*/ 124 121 } 125 122 } … … 128 125 void ScriptTrigger::setScript(const std::string& file) 129 126 { 127 130 128 ScriptManager* scriptManager = State::getScriptManager(); 131 129 if (scriptManager != NULL) 132 130 { 131 133 132 script = scriptManager->getScriptByFile(file); 134 133 if(script != NULL) 134 { 135 135 scriptIsOk = true; 136 } 136 137 } 137 138 } … … 173 174 174 175 script->pushParam(3.14159,main); 176 printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState())); 175 177 script->executeFunction(); 176 178 … … 187 189 printf("main returned %i\n",ret); 188 190 189 //printf("-------------------------- top of the stack:%i\n",lua_gettop(script.getLuaState()));191 printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState())); 190 192 //execute a 2nd function 191 193 printf("----------- test -----------\n");
Note: See TracChangeset
for help on using the changeset viewer.