Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 19, 2007, 4:06:51 PM (18 years ago)
Author:
snellen
Message:

Merged inputdevice-branch back to trunk: New ScriptTrigger (ActionTrigger) available

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/script_triggers/script_trigger.cc

    r10622 r10638  
    104104
    105105
    106 void ScriptTrigger::executeAction(float timestep)
     106void ScriptTrigger::executeScriptFunction(float timestep)
    107107{
    108108  if(executionStopped && scriptIsOk) // If the script has been loaded correctly but something is wrong with the settings of the trigger
     
    114114  if(scriptIsOk)
    115115  {
    116        //testScriptingFramework();
    117116    if(!(script->selectFunction(this->functionName,returnCount)) )
    118117     {
     
    166165  }
    167166}
    168 
    169 /*
    170  void ScriptTrigger::testScriptingFramework()
    171 {
    172    std::string file("lunartest2.lua");
    173    //get script
    174    Script* script = State::getScriptManager()->getScriptByFile(file);
    175    printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState()));
    176 
    177       //execute a function
    178    printf("----------- main -----------\n");
    179    std::string main("main");
    180    if( script->selectFunction(main,3))
    181      printf("function %s selected\n",main.c_str());
    182 
    183    script->pushParam(3.14159,main);
    184    printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState()));
    185    script->executeFunction();
    186 
    187    int ret = script->getReturnedInt();
    188    printf("main returned %i\n",ret);
    189 
    190    if(script->getReturnedBool())
    191      printf("main returned true\n");
    192    else
    193      printf("main returned false\n");
    194 
    195    float retf = script->getReturnedFloat();
    196    printf("main returned %f\n",retf);
    197 
    198 
    199    printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState()));
    200       //execute a 2nd function
    201    printf("----------- test -----------\n");
    202    std::string test("test");
    203    if( script->selectFunction(test,0))
    204      printf("function %s selected\n",test.c_str());
    205 
    206    script->executeFunction();
    207 
    208 
    209       //if(argc>1) lua_dofile(script.getLuaState(), argv[1]);
    210    printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState()));
    211 
    212 }*/
Note: See TracChangeset for help on using the changeset viewer.