- Timestamp:
- Jun 26, 2006, 2:00:31 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/defs/class_id.h
r8761 r8783 252 252 CL_SCRIPT = 0x00000651, 253 253 CL_SCRIPT_CLASS = 0x00000652, 254 CL_SCRIPT_TRIGGER = 0x0000065 2,254 CL_SCRIPT_TRIGGER = 0x00000653, 255 255 256 256 -
trunk/src/lib/lang/class_list.cc
r8316 r8783 235 235 BaseObject* ClassList::getObject(const std::string& objectName, const std::string& className) 236 236 { 237 237 238 ClassList* cl = ClassList::getClassList(className); 238 239 if (cl != NULL) -
trunk/src/lib/script_engine/script.cc
r8711 r8783 114 114 void Script::addObject(const std::string& className, const std::string& objectName) 115 115 { 116 //printf("Script %p: I am about to add %s of class %s\n",this,objectName.c_str(),className.c_str());116 // printf("Script %p: I am about to add %s of class %s\n",this,objectName.c_str(),className.c_str()); 117 117 118 118 BaseObject* scriptClass = ClassList::getObject(className, CL_SCRIPT_CLASS); 119 //printf("The script class for %s is at %p \n",className.c_str(),scriptClass);119 // printf("The script class for %s is at %p \n",className.c_str(),scriptClass); 120 120 WorldObject tmpObj; 121 121 if (scriptClass != NULL) … … 128 128 129 129 BaseObject* object = ClassList::getObject(objectName, className); 130 //printf("%s is at %p \n",objectName.c_str(),object);130 // printf("%s is at %p \n",objectName.c_str(),object); 131 131 if (object != NULL && !objectIsAdded(objectName)) 132 132 { -
trunk/src/world_entities/npcs/generic_npc.cc
r8724 r8783 125 125 * @param coordinate: coordinate to go to 126 126 */ 127 bool GenericNPC::walkTo(const Vector& coordinate, float time)127 float GenericNPC::walkTo(const Vector& coordinate, const Quaternion& dir) 128 128 { 129 129 … … 136 136 * @param coordinate: coordinate to go to 137 137 */ 138 bool GenericNPC::walkTo(float x, float y, float z, float time)138 float GenericNPC::walkTo(float x, float y, float z, float qu, float qx, float qy, float qz) 139 139 { 140 140 -
trunk/src/world_entities/npcs/generic_npc.h
r8724 r8783 38 38 void playSound(int i); 39 39 40 bool walkTo(const Vector& coordinate, float time); 41 bool walkTo(float x, float y, float z, float time); 40 float walkTo(const Vector& coordinate, const Quaternion& dir); 41 float walkTo(float x, float y, float z, float qu, float qx, float qy, float qz); 42 float walkTo(float x, float y, float qu, float qx, float qy, float qz); 43 44 float runTo(const Vector& coordinate, const Quaternion& dir); 45 float runTo(float x, float y, float z, float qu, float qx, float qy, float qz); 46 float runTo(float x, float y, float qu, float qx, float qy, float qz); 47 48 float crouchTo(const Vector& coordinate, const Quaternion& dir); 49 float crouchTo(float x, float y, float z, float qu, float qx, float qy, float qz); 50 float crouchTo(float x, float y, float qu, float qx, float qy, float qz); 51 42 52 43 53 void destroy(); -
trunk/src/world_entities/script_trigger.cc
r8711 r8783 21 21 #include "state.h" 22 22 23 24 CREATE_SCRIPTABLE_CLASS(ScriptTrigger, CL_SCRIPT_TRIGGER, 25 addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor)) 26 ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX)) 27 ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY)) 28 ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ)) 29 ); 23 30 24 31 … … 40 47 scriptIsOk = false; 41 48 triggerLasts = false; 49 addToScript = false; 50 51 if(root != NULL) 52 { 53 42 54 loadParams(root); 43 55 56 if(addToScript) 57 { 58 script->addObject( "ScriptTrigger", this->getName()); 59 } 60 61 } 44 62 } 45 63 … … 60 78 void ScriptTrigger::loadParams(const TiXmlElement* root) 61 79 { 62 if(root != NULL) 63 { 80 64 81 WorldEntity ::loadParams(root); 65 82 … … 97 114 .describe("True if the script should only be called once") 98 115 .defaultValues(""); 99 } 100 116 LoadParam(root, "addtoscript", this, ScriptTrigger, setAddToScript) 117 .describe("True if this scripttrigger should be aviable in the script") 118 .defaultValues(""); 101 119 } 102 120 -
trunk/src/world_entities/script_trigger.h
r8711 r8783 14 14 #include "script_manager.h" 15 15 #include "script.h" 16 #include "script_class.h" 16 17 17 18 class ScriptTrigger : public WorldEntity … … 42 43 void setFunction(const std::string& function){ this->functionName = function;} 43 44 void setDebugDraw(const bool draw) { this->doDebugDraw = draw; } 45 void setAddToScript(const bool add) { this->addToScript = add; } 44 46 45 47 ///DRAWING … … 57 59 std::string functionName; 58 60 bool doDebugDraw; 59 61 bool addToScript; 60 62 //for internal use 61 63 bool scriptCalled; … … 66 68 }; 67 69 70 68 71 #endif -
trunk/src/world_entities/space_ships/helicopter.cc
r8495 r8783 36 36 CREATE_FACTORY(Helicopter, CL_HELICOPTER); 37 37 #include "script_class.h" 38 //CREATE_SCRIPTABLE_CLASS(Helicopter, CL_HELICOPTER, NULL); 39 38 CREATE_SCRIPTABLE_CLASS(Helicopter, CL_HELICOPTER, 39 addMethod("moveUp", ExecutorLua1<Helicopter,bool>(&Helicopter::moveUp)) 40 ->addMethod("moveDown", ExecutorLua1<Helicopter,bool>(&Helicopter::moveDown)) 41 ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor)) 42 ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX)) 43 ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY)) 44 ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ)) 45 46 ); 40 47 41 48 /** -
trunk/src/world_entities/space_ships/helicopter.h
r8711 r8783 83 83 }; 84 84 85 CREATE_SCRIPTABLE_CLASS(Helicopter, CL_HELICOPTER,86 addMethod("moveUp", ExecutorLua1<Helicopter,bool>(&Helicopter::moveUp))87 ->addMethod("moveDown", ExecutorLua1<Helicopter,bool>(&Helicopter::moveDown))88 ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))89 ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))90 ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY))91 ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ))92 93 );94 95 96 85 #endif /* _HELICOPTERS_H */
Note: See TracChangeset
for help on using the changeset viewer.