Changeset 9245 in orxonox.OLD for branches/scripting/src/world_entities
- Timestamp:
- Jul 6, 2006, 5:32:31 PM (18 years ago)
- Location:
- branches/scripting/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/scripting/src/world_entities/script_trigger.cc
r9242 r9245 32 32 ->addMethod("setTarget", ExecutorLua1<ScriptTrigger, const std::string&>(&ScriptTrigger::setTarget)) 33 33 ->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)) 35 36 ->addMethod("setInvert", ExecutorLua1<ScriptTrigger, bool>(&ScriptTrigger::setInvert)) 36 37 ->addMethod("setRadius", ExecutorLua1<ScriptTrigger, float>(&ScriptTrigger::setRadius)) … … 59 60 scriptCalled = false; 60 61 scriptIsOk = false; 61 trigger Lasts = true;62 triggerRemains = true; 62 63 addToScript = false; 64 this->activeOnCreation = false; 63 65 64 66 if(root != NULL) … … 119 121 .describe("") 120 122 .defaultValues(false); 121 LoadParam(root, "trigger lasts", this, ScriptTrigger, setTriggerLasts)123 LoadParam(root, "triggerRemains", this, ScriptTrigger, setTriggerRemains) 122 124 .describe("") 123 125 .defaultValues(true); … … 172 174 if(scriptFinished) return; 173 175 174 if(triggerLasts && scriptCalled) 176 if(activeOnCreation) 177 { 178 executeAction(timestep); 179 return; 180 } 181 182 if(triggerRemains && scriptCalled) 175 183 { 176 184 executeAction(timestep); … … 182 190 executeAction(timestep); 183 191 scriptCalled = true; 192 return; 184 193 185 194 } … … 188 197 executeAction(timestep); 189 198 scriptCalled = true; 199 return; 190 200 } 191 201 //else -
branches/scripting/src/world_entities/script_trigger.h
r9006 r9245 35 35 void setTarget(WorldEntity* target) { if(target!=NULL) this->target=target; } 36 36 void setTriggerParent(const std::string& name); 37 void setTriggerLasts(const bool lasts) { this->triggerLasts = lasts; } 37 void setTriggerRemains(const bool lasts) { this->triggerRemains = lasts; } 38 void setActiveOnCreation(const bool avtive) { this->activeOnCreation = avtive; } 38 39 void setInvert(const bool inv) { this->invert = invert; } 39 40 void setDelay(float delay) { this->delay = delay; }; … … 50 51 51 52 WorldEntity* target; 52 bool triggerLasts; 53 bool triggerRemains; 54 bool activeOnCreation; 53 55 bool invert; 54 56 float radius;
Note: See TracChangeset
for help on using the changeset viewer.