Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 6, 2006, 8:47:40 PM (19 years ago)
Author:
snellen
Message:

added possibility to set the target as parent

File:
1 edited

Legend:

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

    r8173 r8178  
    2323        .defaultValues("");
    2424    LoadParam(root, "abs-coor", this, ScriptTrigger, setAbsCoord)
    25         .describe("the fileName of the script, that should be triggered by this script trigger")
     25        .describe("where this script trigger should be located")
    2626        .defaultValues("");
    2727    LoadParam(root, "radius", this, ScriptTrigger, setRadius)
     
    3131        .describe("the delay after which the funtion sould be triggered")
    3232        .defaultValues(0);
     33    LoadParam(root, "worldentity", this, ScriptTrigger, setTargetName)
     34        .describe("The name of the target as it is in the *.oxw file")
     35        .defaultValues("");
     36    LoadParam(root, "worldentityisparent", this, ScriptTrigger, setIsParent)
     37        .describe("The name of the target as it is in the *.oxw file")
     38        .defaultValues("");
     39
    3340    }*/
    3441 timer = delay;
     
    3946void ScriptTrigger::tick(float timestep)
    4047{
    41  //if(triggered)
    42  //{
    43   //timer -= timestep;
    44   //if(timer < 0)
    45    callScript = true;
    46  //}
    47  
    4848
    4949 if((this->getAbsDirV()-target->getAbsDirV()).len() < radius)
    5050 {
    51   //triggered = true;
    52   if(!callOnce && callScript)
     51  if(!callOnce)
    5352   {
    5453    executeAction();
    5554   }
    56   else if(callOnce && !scriptCalled && callScript)
     55  else if(callOnce && !scriptCalled)
    5756  {
    5857   executeAction();
     
    7069     Script* script = scriptManager->getScriptByFile(this->scriptFile);
    7170     if(!(script->selectFunction(this->functionName,0)) )
    72        printf("Error: Selection of %s in %s failed.\n",functionName.c_str(), scriptFile.c_str());
     71       printf("Error ScriptTrigger: Selection of %s in %s failed.\n",functionName.c_str(), scriptFile.c_str());
    7372     if( !(script->executeFunction()) )
    74        printf("Execution of %s in %s failed\n",functionName.c_str(),scriptFile.c_str());
     73       printf("Error ScriptTrigger: Execution of %s in %s failed.\n",functionName.c_str(),scriptFile.c_str());
    7574}
Note: See TracChangeset for help on using the changeset viewer.