Changeset 8205 in orxonox.OLD for branches/script_engine/src/lib
- Timestamp:
- Jun 7, 2006, 5:06:47 PM (19 years ago)
- 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
r8202 r8205 23 23 WorldEntity ::loadParams(root); 24 24 25 /*{ LoadParam(root, "file", this, ScriptTrigger, setScript)25 { LoadParam(root, "file", this, ScriptTrigger, setScript) 26 26 .describe("the fileName of the script, that should be triggered by this script trigger") 27 27 .defaultValues(""); … … 29 29 .describe("the function of the script, that should be triggered by this script trigger") 30 30 .defaultValues(""); 31 LoadParam(root, "abs-coor", this, ScriptTrigger, setAbsCoor d)31 LoadParam(root, "abs-coor", this, ScriptTrigger, setAbsCoor) 32 32 .describe("where this script trigger should be located") 33 33 .defaultValues(""); … … 38 38 .describe("the delay after which the funtion sould be triggered") 39 39 .defaultValues(0); 40 LoadParam(root, "worldentity", this, ScriptTrigger, setTarget Name)40 LoadParam(root, "worldentity", this, ScriptTrigger, setTarget) 41 41 .describe("The name of the target as it is in the *.oxw file") 42 42 .defaultValues(""); 43 LoadParam(root, " worldentityisparent", this, ScriptTrigger, setIsParent)43 LoadParam(root, "triggerparent", this, ScriptTrigger, setTriggerParent) 44 44 .describe("The name of the target as it is in the *.oxw file") 45 45 .defaultValues(""); 46 46 47 } */47 } 48 48 timer = delay; 49 49 } … … 61 61 { 62 62 PRINTF(2)("Target %s for %s::%s does not Exist\n", target.c_str(), this->getClassName(), this->getName()); 63 } 64 } 65 66 void ScriptTrigger::setTriggerParent(const std::string& parent) 67 { 68 BaseObject* parentEntity = ClassList::getObject(parent, CL_WORLD_ENTITY); 69 70 if (parentEntity != NULL) 71 { 72 this->setParent(dynamic_cast<WorldEntity*>(parentEntity)); 73 } 74 else 75 { 76 PRINTF(2)("Parent %s for %s::%s does not Exist\n", parent.c_str(), this->getClassName(), this->getName()); 63 77 } 64 78 } -
branches/script_engine/src/lib/script_engine/script_trigger.h
r8202 r8205 22 22 void setTarget(const std::string& targetName); 23 23 void setTarget(WorldEntity* target) { if(target!=NULL) this->target=target; } 24 25 void setTriggerParent(const std::string& name); 24 26 25 void setCallOnce( bool call) { this->callOnce = call;}26 void setRadius( float radius) { if(radius>0) this->radius = radius;}27 void setDelay( float time){if(delay>0) this->delay = delay;}28 void setScript( std::string& script){this->scriptFile = script;}29 void setFunction( std::string& function){this->functionName = function;}27 void setCallOnce(const bool call) { this->callOnce = call;} 28 void setRadius(const float radius) { if(radius>0) this->radius = radius;} 29 void setDelay(const float time){if(delay>0) this->delay = delay;} 30 void setScript(const std::string& script){this->scriptFile = script;} 31 void setFunction(const std::string& function){this->functionName = function;} 30 32 31 33 std::string getTargetName(); … … 33 35 private: 34 36 35 std::string parentName;36 37 WorldEntity* target; 37 bool worldEntityIsParent;38 38 bool callOnce; 39 bool scriptCalled;40 39 float radius; 41 40 float delay; … … 43 42 std::string functionName; 44 43 45 bool callScript; 46 bool triggered; 47 float timer; 44 45 bool scriptCalled; 46 bool callScript; 47 bool triggered; 48 float timer; 48 49 49 50 };
Note: See TracChangeset
for help on using the changeset viewer.