Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 6, 2006, 5:32:31 PM (18 years ago)
Author:
snellen
Message:

added setActivateOnCreation to scripttrigger

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/scripting/src/world_entities/script_trigger.cc

    r9242 r9245  
    3232             ->addMethod("setTarget", ExecutorLua1<ScriptTrigger, const std::string&>(&ScriptTrigger::setTarget))
    3333             ->addMethod("setTriggerParent", ExecutorLua1<ScriptTrigger, const std::string&>(&ScriptTrigger::setTriggerParent))
    34              ->addMethod("setTriggerLasts", ExecutorLua1<ScriptTrigger, bool>(&ScriptTrigger::setTriggerLasts))
     34             ->addMethod("setTriggerRemains", ExecutorLua1<ScriptTrigger, bool>(&ScriptTrigger::setTriggerRemains))
     35             ->addMethod("setActiveOnCreation", ExecutorLua1<ScriptTrigger, bool>(&ScriptTrigger::setActiveOnCreation))
    3536             ->addMethod("setInvert", ExecutorLua1<ScriptTrigger, bool>(&ScriptTrigger::setInvert))
    3637             ->addMethod("setRadius", ExecutorLua1<ScriptTrigger, float>(&ScriptTrigger::setRadius))
     
    5960  scriptCalled = false;
    6061  scriptIsOk = false;
    61   triggerLasts = true;
     62  triggerRemains = true;
    6263  addToScript = false;
     64  this->activeOnCreation = false;
    6365 
    6466  if(root != NULL)
     
    119121      .describe("")
    120122      .defaultValues(false);
    121   LoadParam(root, "triggerlasts", this, ScriptTrigger, setTriggerLasts)
     123  LoadParam(root, "triggerRemains", this, ScriptTrigger, setTriggerRemains)
    122124      .describe("")
    123125      .defaultValues(true);
     
    172174  if(scriptFinished) return;
    173175
    174   if(triggerLasts && scriptCalled)
     176  if(activeOnCreation)
     177   {
     178     executeAction(timestep);
     179     return;
     180   }
     181   
     182  if(triggerRemains && scriptCalled)
    175183  {
    176184    executeAction(timestep);
     
    182190    executeAction(timestep);
    183191    scriptCalled = true;
     192    return;
    184193 
    185194  }
     
    188197    executeAction(timestep);
    189198    scriptCalled = true;
     199    return;
    190200  }
    191201 //else
Note: See TracChangeset for help on using the changeset viewer.