Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10614 in orxonox.OLD


Ignore:
Timestamp:
Mar 30, 2007, 11:35:30 AM (18 years ago)
Author:
snellen
Message:

addToScript schould work now

Location:
branches/scriptimprovements/src/world_entities/script_triggers
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/scriptimprovements/src/world_entities/script_triggers/script_trigger.cc

    r10610 r10614  
    4141  executionStopped = false; // true when something goes wrong and the trigger has to be stopped
    4242  addToScript = false;
    43 
    44 
    45   if(root != NULL)
    46   {
    47 
    48     loadParams(root);
    49 
    50     if(addToScript && scriptIsOk)
    51     {
    52       script->addObject( "ScriptTrigger", this->getName());
    53     }
    54 
    55   }
    5643
    5744}
  • branches/scriptimprovements/src/world_entities/script_triggers/script_trigger.h

    r10611 r10614  
    1111#include "world_entity.h"
    1212#include "loading/load_param.h"
    13 #include "vector.h"
    1413#include "script_manager.h"
    1514#include "script.h"
    16 #include "script_class.h"
     15
    1716
    1817class ScriptTrigger : public WorldEntity
     
    2827
    2928    /// DO WORK
    30     virtual void tick(float timestep){}
     29    virtual void tick(float timestep) = 0;
    3130    virtual void executeAction(float timestep);
    3231    void testScriptingFramework();
     
    4847    std::string  functionName;
    4948    bool         doDebugDraw;
    50     bool         addToScript;
     49   
    5150   
    5251    //for internal use
     
    5958    bool         scriptIsOk;
    6059    bool         scriptFinished;
     60    bool         addToScript;
    6161
    6262};
  • branches/scriptimprovements/src/world_entities/script_triggers/space_trigger.cc

    r10611 r10614  
    3030                            ->addMethod("setName", Executor1<BaseObject, lua_State*, const std::string&>(&BaseObject::setName))
    3131                            ->addMethod("setTarget", Executor1<SpaceTrigger, lua_State*, const std::string&>(&SpaceTrigger::setTarget))
    32                             ->addMethod("setTriggerParent", Executor1<SpaceTrigger, lua_State*, const std::string&>(&SpaceTrigger::setTriggerParent))
     32                            ->addMethod("setTriggerParent", Executor1<ScriptTrigger, lua_State*, const std::string&>(&ScriptTrigger::setTriggerParent))
    3333                            ->addMethod("setTriggerRemains", Executor1<SpaceTrigger, lua_State*, bool>(&SpaceTrigger::setTriggerRemains))
    3434                            ->addMethod("setInvert", Executor1<SpaceTrigger, lua_State*, bool>(&SpaceTrigger::setInvert))
    3535                            ->addMethod("setRadius", Executor1<SpaceTrigger, lua_State*, float>(&SpaceTrigger::setRadius))
    36                             ->addMethod("setScript", Executor1<SpaceTrigger, lua_State*, const std::string&>(&SpaceTrigger::setScript))
    37                             ->addMethod("setFunction", Executor1<SpaceTrigger, lua_State*, const std::string&>(&SpaceTrigger::setFunction))
    38                             ->addMethod("setDebugDraw", Executor1<SpaceTrigger, lua_State*, bool>(&SpaceTrigger::setDebugDraw))
    39                             ->addMethod("setAddToScript", Executor1<SpaceTrigger, lua_State*, bool>(&SpaceTrigger::setAddToScript))
     36                            ->addMethod("setScript", Executor1<ScriptTrigger, lua_State*, const std::string&>(&ScriptTrigger::setScript))
     37                            ->addMethod("setFunction", Executor1<ScriptTrigger, lua_State*, const std::string&>(&ScriptTrigger::setFunction))
     38                            ->addMethod("setDebugDraw", Executor1<ScriptTrigger, lua_State*, bool>(&ScriptTrigger::setDebugDraw))
     39                            ->addMethod("setAddToScript", Executor1<ScriptTrigger, lua_State*, bool>(&ScriptTrigger::setAddToScript))
    4040                       );
    4141
     
    5555  triggerRemains = true;
    5656 
     57   if(root != NULL)
     58  {
     59    loadParams(root);
    5760
     61    if(addToScript && scriptIsOk)
     62    {
     63      script->addObject( "SpaceTrigger", this->getName());
     64    }
     65
     66  }
    5867
    5968}
  • branches/scriptimprovements/src/world_entities/script_triggers/tick_trigger.cc

    r10611 r10614  
    4545  this->toList(OM_COMMON);
    4646
     47  if(root != NULL)
     48   {
     49    loadParams(root);
     50
     51    if(addToScript && scriptIsOk)
     52    {
     53      script->addObject( "TickTrigger", this->getName());
     54    }
     55
     56   }
     57
    4758}
    4859
Note: See TracChangeset for help on using the changeset viewer.