Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8289 in orxonox.OLD for branches/script_engine/src/lib


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

added some debug output, script gets called

Location:
branches/script_engine/src/lib/script_engine
Files:
3 edited

Legend:

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

    r8271 r8289  
    2323  luaopen_math(luaState);
    2424  luaopen_debug(luaState);
    25 
    2625  if (root != NULL)
    2726    this->loadParams(root);
     
    7776     else
    7877     {
    79       reportError(error);
    80      }
    81 
    82    }
    83    else
    84    {
     78       printf("ERROR while loading file %s: ",filename.c_str());
     79       reportError(error);
     80     }
     81
     82   }
     83   else
     84   {
     85     printf("ERROR while loading file %s: ",filename.c_str());
    8586     reportError(error);
    8687   }
     
    9293 void Script::addObject(const std::string& className, const std::string& objectName)
    9394 {
     95   printf("Script: I am about to add %s of class %s\n",objectName.c_str(),className.c_str());
     96   
    9497   BaseObject* scriptClass = ClassList::getObject(className, CL_SCRIPT_CLASS);
    9598   WorldObject tmpObj;
     
    162165    if(error != 0)
    163166    {
     167     printf("ERROR while executing function %s: \n",currentFunction.c_str());
    164168     reportError(error);
     169     //clean up
     170     currentFunction.assign("");
     171     argumentCount = returnCount = 0;
    165172     return false;
    166173    }
     
    174181   else
    175182     printf("Error: no function selected.\n");
     183   
     184   return false;
    176185 }
    177186
     
    296305  fprintf(stderr, "ERROR: %s\n", msg);
    297306  lua_pop(luaState, 1);
     307 }
    298308  return error;
    299309 }
    300  }
    301310
    302311
  • branches/script_engine/src/lib/script_engine/script_class.h

    r8271 r8289  
    6161    virtual int insertObject(Script* L, BaseObject* obj, bool gc=false)
    6262    {
    63       Lunar<T>::insertObject(L, dynamic_cast<T*>(obj), obj->getName(), gc);
     63      return Lunar<T>::insertObject(L, dynamic_cast<T*>(obj), obj->getName(), gc);
    6464    }
    6565
  • branches/script_engine/src/lib/script_engine/script_manager.cc

    r8285 r8289  
    11#include <string>
    22#include <list>
     3
     4#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD
    35
    46
     
    1921{
    2022  this->setName("ScriptManager");
    21   printf("ScriptManager created\n");
    2223  this->scripts = NULL;
    2324  this->triggers = NULL;
     
    7475  LOAD_PARAM_START_CYCLE(triggers, object);
    7576  {
    76     new ScriptTrigger(object);PRINTF(0)("test output from createtriggers\n");
     77    new ScriptTrigger(object);
    7778  }
    7879  LOAD_PARAM_END_CYCLE(object);
Note: See TracChangeset for help on using the changeset viewer.