Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jun 6, 2006, 9:34:13 AM (19 years ago)
Author:
snellen
Message:

scripttrigger: added delay

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

Legend:

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

    r8172 r8173  
    55{
    66 scriptCalled = false;
     7 callScript = false;
     8 triggered = false;
    79}
    810
     
    1416void ScriptTrigger::loadParams(const TiXmlElement* root)
    1517{
    16    /* LoadParam(root, "file", this, ScriptTrigger, setScript)
     18   /*{ LoadParam(root, "file", this, ScriptTrigger, setScript)
    1719        .describe("the fileName of the script, that should be triggered by this script trigger")
    1820        .defaultValues("");
     
    2931        .describe("the delay after which the funtion sould be triggered")
    3032        .defaultValues(0);
    31     */
     33    }*/
     34 timer = delay;
    3235}
    3336
     
    3639void ScriptTrigger::tick(float timestep)
    3740{
     41 //if(triggered)
     42 //{
     43  //timer -= timestep;
     44  //if(timer < 0)
     45   callScript = true;
     46 //}
     47 
    3848
    3949 if((this->getAbsDirV()-target->getAbsDirV()).len() < radius)
    4050 {
    41   if(!callOnce)
     51  //triggered = true;
     52  if(!callOnce && callScript)
    4253   {
    4354    executeAction();
    4455   }
    45   else if(callOnce && !scriptCalled)
     56  else if(callOnce && !scriptCalled && callScript)
    4657  {
    4758   executeAction();
  • branches/script_engine/src/lib/script_engine/script_trigger.h

    r8172 r8173  
    3636    std::string functionName;
    3737
     38    bool callScript;
     39    bool triggered;
     40    float timer;
     41
    3842};
    3943
Note: See TracChangeset for help on using the changeset viewer.