Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 3, 2006, 1:35:40 PM (18 years ago)
Author:
snellen
Message:

added some methods to generic npcs scriptable

File:
1 edited

Legend:

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

    r9020 r9031  
    2626CREATE_SCRIPTABLE_CLASS(Script, CL_SCRIPT,
    2727                    addMethod("addObject", ExecutorLua2<Script,const std::string&, const std::string& >(&Script::addObject))
    28                     //->addMethod("selectFunction", ExecutorLua2ret<Script, bool, const std::string&, int >(&Script::selectFunction))
     28                   // ->addMethod("selectFunction", ExecutorLua2ret<Script, bool, const std::string&, int >(&Script::selectFunction))
    2929                    ->addMethod("executeFunction", ExecutorLua0ret<Script,bool >(&Script::executeFunction))
    3030                     );
     
    8282   filedest += "scripts/" + filename;
    8383   
     84   this->addThisScript();
     85   this->registerStandartClasses();
     86   
    8487   if(currentFile.length() != 0)
    8588   {
     
    98101     {
    99102      currentFile = filename;
    100       this->addThisScript();
    101       this->registerStandartClasses();
    102103      return true;
    103104     }
     
    121122 void Script::addObject(const std::string& className, const std::string& objectName)
    122123 {
    123   // printf("Script %p: I am about to add %s of class %s\n",this,objectName.c_str(),className.c_str());
     124   //printf("Script %s: I am about to add %s of class %s\n",this->getName(),objectName.c_str(),className.c_str());
    124125
    125126   BaseObject* scriptClass = ClassList::getObject(className, CL_SCRIPT_CLASS);
     
    359360   //success = this->registerClass(std::string("Vector"));
    360361    success = this->registerClass("ScriptTrigger");
    361     success = this->registerClass("Script");
    362    
     362
    363363   return success;
    364364 }
Note: See TracChangeset for help on using the changeset viewer.