Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9241 in orxonox.OLD


Ignore:
Timestamp:
Jul 6, 2006, 12:44:18 PM (18 years ago)
Author:
snellen
Message:

error messages von script, scrripttrigger und scriptmanager ans framework angepasst

Location:
branches/scripting/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/scripting/src/lib/script_engine/script.cc

    r9235 r9241  
    1717#include "script_class.h"
    1818#include "luaincl.h"
    19 
     19#include "debug.h"
    2020#include "util/loading/resource_manager.h"
    2121
     
    8787   if(currentFile.length() != 0)
    8888   {
    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());
    9090     return false;
    9191    }
     
    104104     else
    105105     {
    106        printf("ERROR while loading file %s: \n",filename.c_str());
     106       PRINT(1)("ERROR while loading file %s: \n",filename.c_str());
    107107       reportError(error);
    108108     }
     
    111111   else
    112112   {
    113      printf("ERROR while loading file %s: \n",filename.c_str());
     113     PRINT(1)("ERROR while loading file %s: \n",filename.c_str());
    114114     reportError(error);
    115115   }
     
    150150 bool Script::executeFile()
    151151 {
    152    printf("WARNING: script.executeFile is not implemented yet");
     152   PRINT(2)("WARNING: script.executeFile is not implemented yet");
    153153   /*if(currentFile.length() != 0)
    154154   {
     
    183183   }
    184184   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());
    186186   return false;
    187187 }
     
    195195    if(error != 0)
    196196    {
    197      printf("ERROR while executing function %s: \n",currentFunction.c_str());
     197      PRINT(1)("ERROR while executing function %s: \n",currentFunction.c_str());
    198198     reportError(error);
    199199     //clean up
     
    210210   }
    211211   else
    212      printf("Error: no function selected.\n");
     212     PRINT(1)("Error: no function selected.\n");
    213213
    214214   return false;
     
    227227   else
    228228   {
    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());
    230230    return false;
    231231   }
     
    244244   else
    245245   {
    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());
    247247     return false;
    248248   }
     
    260260   else
    261261   {
    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());
    263263     return false;
    264264   }
     
    295295     }
    296296     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());
    298298   }
    299299   return returnValue;
  • branches/scripting/src/world_entities/npcs/gate.cc

    r9235 r9241  
    4141                            addMethod("hide", ExecutorLua0<WorldEntity>(&WorldEntity::hide))
    4242                            ->addMethod("unhide", ExecutorLua0<WorldEntity>(&WorldEntity::unhide))
    43                            // ->addMethod("destroy", ExecutorLua0<Gate>(&Gate::destroy()))   
     43                            ->addMethod("destroy", ExecutorLua0<Gate>(&Gate::destroy))   
    4444                            ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))
    4545                            ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))
  • branches/scripting/src/world_entities/script_trigger.cc

    r9235 r9241  
    202202       //testScriptingFramework();
    203203    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());
    205205     
    206206    script->pushParam( timestep, this->functionName);
    207207     
    208208    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());
    210210     
    211211    scriptFinished = script->getReturnedBool();
Note: See TracChangeset for help on using the changeset viewer.