Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8199 in orxonox.OLD


Ignore:
Timestamp:
Jun 7, 2006, 3:37:12 PM (18 years ago)
Author:
snellen
Message:

setTarget should work

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

Legend:

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

    r8197 r8199  
    2424  if (root != NULL)
    2525    this->loadParams(root);
    26 
    2726}
    2827
     
    3736void Script::loadParams(const TiXmlElement* root)
    3837{
     38  BaseObject::loadParams(root);
     39 
    3940  LOAD_PARAM_START_CYCLE(root, object);
    4041  {
  • branches/script_engine/src/lib/script_engine/script_trigger.cc

    r8178 r8199  
    1616void ScriptTrigger::loadParams(const TiXmlElement* root)
    1717{
     18  WorldEntity::loadParams(root);
     19 
    1820   /*{ LoadParam(root, "file", this, ScriptTrigger, setScript)
    1921        .describe("the fileName of the script, that should be triggered by this script trigger")
     
    4345
    4446
     47void ScriptTrigger::setTarget(const std::string& target)
     48{
     49  BaseObject* targetEntity = ClassList::getObject(target, CL_WORLD_ENTITY);
     50 
     51  if (targetEntity != NULL)
     52  {
     53    this->setTarget(dynamic_cast<WorldEntity*>(targetEntity));
     54  }
     55  else
     56  {
     57    PRINTF(2)("Target %s for %s::%s does not Exist\n", taget.c_str(), this->getClassName(), this->getName());
     58  }
     59}
    4560
    4661void ScriptTrigger::tick(float timestep)
  • branches/script_engine/src/lib/script_engine/script_trigger.h

    r8193 r8199  
    1919    virtual void executeAction();
    2020
    21     void setTarget(WorldEntity* target){ if(target!=NULL) this->target=target;if(worldEntityIsParent)this->setParent(target);}
    22     void setTargetName(std::string& name){this->targetName = name;}
     21   
     22    void setTarget(const std::string& targetName);
     23   
     24    void setTarget(WorldEntity* target) { if(target!=NULL) this->target=target;if(worldEntityIsParent)this->setParent(target); }
     25    void setTargetName(std::string& name){ this->targetName = name; }
    2326    void setCallOnce(bool call) { this->callOnce = call;}
    2427    void setRadius(float radius) { if(radius>0) this->radius = radius;}
Note: See TracChangeset for help on using the changeset viewer.