Changeset 11999
- Timestamp:
- May 24, 2018, 3:59:22 PM (7 years ago)
- Location:
- code/branches/ScriptableController_FS18
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ScriptableController_FS18/data/levels/AAAScriptableControllerTest.oxw
r11974 r11999 1 1 <LevelInfo 2 name = " AAAScriptableControllerTest"3 description = "Demonstrates moving and killing a drone by us e ofa script."2 name = "Scriptable Controller Moving and Killing Pawn" 3 description = "Demonstrates moving and killing a drone by using a lua script." 4 4 tags = "test" 5 5 screenshot = "emptylevel.png" -
code/branches/ScriptableController_FS18/data/levels/BBBScriptableControllerTest.oxw
r11932 r11999 1 1 <LevelInfo 2 name = " BBBScriptableControllerTest"3 description = "Demonstrates moving and killing a drone by use ofa script."2 name = "Scriptable Controller Spawning Pawn" 3 description = "Demonstrates spawning a drone by using a lua script." 4 4 tags = "test" 5 5 screenshot = "emptylevel.png" -
code/branches/ScriptableController_FS18/data/levels/scripts/AAAScriptableControllerTest.lua
r11974 r11999 63 63 orxPrint("Spawning dummy!") 64 64 spawnTest("dummy") 65 move_dummy() 65 66 end 66 67 … … 107 108 108 109 110 -
code/branches/ScriptableController_FS18/data/levels/templates/AAAAutonomousDroneTemplate.oxt
r11974 r11999 2 2 <AAAAutonomousDrone> 3 3 <attached> 4 <Model scale="10" position="0,0,0"mesh="drone.mesh"/>4 <Model scale="10" mesh="drone.mesh"/> 5 5 </attached> 6 6 <collisionShapes> -
code/branches/ScriptableController_FS18/src/libraries/core/BaseObject.cc
r11103 r11999 77 77 { 78 78 this->setFile(this->creator_->getFile()); 79 79 80 80 // store strong-pointers on all four base objects by default (can be overwritten with weak-ptr after the constructor if necessary) 81 81 this->setNamespace(this->creator_->namespace_.createStrongPtr()); -
code/branches/ScriptableController_FS18/src/orxonox/Level.h
r11974 r11999 64 64 65 65 void addObject(BaseObject* object); 66 BaseObject* getObject(unsigned int index) const; 66 67 67 68 private: 68 69 void registerVariables(); 69 70 //void addObject(BaseObject* object); 70 BaseObject* getObject(unsigned int index) const;71 //BaseObject* getObject(unsigned int index) const; 71 72 72 73 void addLodInfo(MeshLodInformation* object); -
code/branches/ScriptableController_FS18/src/orxonox/scriptablecontroller/scriptable_controller_api.cc
r11974 r11999 7 7 #include "infos/Bot.h" 8 8 #include "worldentities/pawns/ModularSpaceShip.h" 9 //#include "../modules/objects/collisionshapes/SphereCollisionShape.h" 10 #include "graphics/Model.h" 11 #include "worldentities/pawns/AAAAutonomousDrone.h" 12 9 13 10 14 namespace orxonox … … 268 272 } 269 273 270 //for (Level* level : ObjectList<Level>()) 271 // level->loadedNewXMLName(this); 272 273 274 275 276 277 /////!!!!!!!!!!!!!!!278 279 this->controller_->level_->addObject(orxonox_cast<Pawn*>(entity));280 281 274 275 276 ///////////////GOLD!!!!!!!!!!!!!!!//////////////////////// 277 Pawn* pawn = this->controller_->getPawnByID(id); 278 //Attach to pawn 279 AAAAutonomousDrone* drone = new AAAAutonomousDrone(pawn->getContext()); // this is neccessary because the projectiles fired need a valid creator for the particlespawner (when colliding against something) 280 281 drone->addTemplate("AAAAutonomousDroneTemplate"); //AAAAutonomousDroneTemplate spaceshipescort 282 283 Vector3 spawnPosition = pawn->getWorldPosition() + Vector3(30,0,-30); 284 drone->setPosition(spawnPosition); 285 //drone->moveFrontBack(1.0); 282 286 283 287 … … 494 498 { 495 499 MobileEntity *entity = this->controller_->getMobileEntityByID(id); 500 496 501 if(entity == nullptr) 497 502 { … … 499 504 return; 500 505 } 501 502 506 503 507 Identifier *identifier = ClassByString("ControllableEntity"); … … 505 509 ControllableEntity *controllable_entity; 506 510 507 508 511 if(identifier->isA(ClassIdentifier<ControllableEntity>::getIdentifier())) 509 512 { 513 orxout(user_info) << "Before final cast..."<< endl; 510 514 controllable_entity = orxonox_cast<ControllableEntity*>(entity); 515 orxout(user_info) << "After final cast..."<< endl; 511 516 //ATTACHED COLLISION SHAPE is MANDATORY in order to move the entity 512 517 controllable_entity->moveFrontBack(x); 513 518 controllable_entity->moveRightLeft(y); 514 519 controllable_entity->moveUpDown(z); 520 orxout(user_info) << "After move..."<< endl; 515 521 } 516 522
Note: See TracChangeset
for help on using the changeset viewer.