Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 8, 2006, 7:43:10 PM (18 years ago)
Author:
snellen
Message:

added some debug output, script gets called

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/script_engine/src/world_entities/script_trigger.cc

    r8286 r8289  
    1818  loadParams(root);
    1919
    20   printf("scripttrigger generated\n");
    2120}
    2221
     
    9594  if( this->distance(target) < radius)
    9695 {
    97    printf("SCRIPTTRIGGER: condition met\n");
    9896  if(!callOnce)
    9997   {
     
    102100  else if(callOnce && !scriptCalled)
    103101  {
    104     printf("action should be executed\n");
    105102   executeAction();
    106103   scriptCalled = true;
    107104  }
    108105 }
    109  else
    110    printf("SCRIPTTRIGGER: target out of range\n");
     106 //else
     107   //printf("SCRIPTTRIGGER: target out of range\n");
    111108
    112109}
     
    118115     {
    119116       testScriptingFramework();
    120      if(!(script->selectFunction(this->functionName,0)) )
     117     /*if(!(script->selectFunction(this->functionName,0)) )
    121118       printf("Error ScriptTrigger: Selection of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str());
    122119     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());*/
    124121     }
    125122}
     
    128125void ScriptTrigger::setScript(const std::string& file)
    129126{
     127 
    130128  ScriptManager* scriptManager = State::getScriptManager();
    131129  if (scriptManager != NULL)
    132130  {
     131   
    133132    script = scriptManager->getScriptByFile(file);
    134133    if(script != NULL)
     134    {
    135135      scriptIsOk = true;
     136    }
    136137  }
    137138}
     
    173174
    174175   script->pushParam(3.14159,main);
     176   printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState()));
    175177   script->executeFunction();
    176178
     
    187189   printf("main returned %i\n",ret);
    188190
    189       //printf("-------------------------- top of the stack:%i\n",lua_gettop(script.getLuaState()));
     191   printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState()));
    190192      //execute a 2nd function
    191193   printf("----------- test -----------\n");
Note: See TracChangeset for help on using the changeset viewer.