[Orxonox-commit 7806] r12398 - in code/branches/Boxhead_FS19: data/levels data/levels/templates src/modules/hover src/orxonox/scriptablecontroller

cwaupoti at orxonox.net cwaupoti at orxonox.net
Fri May 17 16:29:11 CEST 2019


Author: cwaupoti
Date: 2019-05-17 16:29:11 +0200 (Fri, 17 May 2019)
New Revision: 12398

Modified:
   code/branches/Boxhead_FS19/data/levels/Hover.oxw
   code/branches/Boxhead_FS19/data/levels/templates/spaceshipzombie.oxt
   code/branches/Boxhead_FS19/src/modules/hover/Hover.cc
   code/branches/Boxhead_FS19/src/modules/hover/Hover.h
   code/branches/Boxhead_FS19/src/modules/hover/HoverShip.cc
   code/branches/Boxhead_FS19/src/modules/hover/HoverWall.cc
   code/branches/Boxhead_FS19/src/orxonox/scriptablecontroller/scriptable_controller_api.cc
Log:
temorary

Modified: code/branches/Boxhead_FS19/data/levels/Hover.oxw
===================================================================
--- code/branches/Boxhead_FS19/data/levels/Hover.oxw	2019-05-17 13:00:54 UTC (rev 12397)
+++ code/branches/Boxhead_FS19/data/levels/Hover.oxw	2019-05-17 14:29:11 UTC (rev 12398)
@@ -20,7 +20,7 @@
 <?lua
 MAZE_NUM_CELLS = 10
 MAZE_CELL_SIZE = 100
-MAZE_CELL_HEIGHT = 100
+MAZE_CELL_HEIGHT = 400000
 MAZE_SIZE = MAZE_NUM_CELLS*MAZE_CELL_SIZE
 ?>
 
@@ -36,7 +36,7 @@
   <Scene
     ambientlight = "0.8, 0.8, 0.8"
     skybox       = "Orxonox/Starbox"
-    gravity      = "0, -200, 0"
+    gravity      = "0, -80, 0"
   >
 
     <StaticEntity position="0,0,0" collisionType="static">
@@ -80,21 +80,316 @@
       pawndesign=spaceshiphover
     />
 
-    <SpaceShip position="500,20,500" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="200" >
+    <SpaceShip position="400,20,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
       <templates>
               <Template link=spaceshipzombie />
       </templates>
+      <sleep seconds="10"/>
     </SpaceShip>
 
-    <SpaceShip position="500,10000,500" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="200" >
+    <SpaceShip position="400,200,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
       <templates>
               <Template link=spaceshipzombie />
       </templates>
+      <sleep seconds="10"/>
     </SpaceShip>
 
+    <SpaceShip position="400,800,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
 
+    <SpaceShip position="400,1000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
 
+    <SpaceShip position="400,1200,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+    
 
+    <SpaceShip position="300,3000,400" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+    </SpaceShip>
+
+    <SpaceShip position="300,4000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="300,4000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="300,5000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="300,6000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="300,6050,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="300,6100,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="300,6200,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="300,6300,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="300,6400,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="300,10000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+    <SpaceShip position="300,10000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+    <SpaceShip position="300,10000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+    <SpaceShip position="300,10000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+    <SpaceShip position="300,10000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+    <SpaceShip position="300,10000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+    <SpaceShip position="300,10000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+    <SpaceShip position="300,10000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="400,30000,400" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="400,40000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="300,50000,400" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="300,60000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="400,70000,400" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="200,80000,500" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="300,90000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="400,90000,400" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="400,90000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="300,90000,400" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="300,90000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="400,90000,400" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="400,90000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="300,90000,400" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="300,90000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="400,90000,400" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="400,90000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="300,90000,400" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="300,90000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="400,90000,400" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="400,90000,300" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+    <SpaceShip position="300,90000,400" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="60" >
+      <templates>
+              <Template link=spaceshipzombie />
+      </templates>
+      <sleep seconds="10"/>
+    </SpaceShip>
+
+
+
     
   </Scene>
 </Level>

Modified: code/branches/Boxhead_FS19/data/levels/templates/spaceshipzombie.oxt
===================================================================
--- code/branches/Boxhead_FS19/data/levels/templates/spaceshipzombie.oxt	2019-05-17 13:00:54 UTC (rev 12397)
+++ code/branches/Boxhead_FS19/data/levels/templates/spaceshipzombie.oxt	2019-05-17 14:29:11 UTC (rev 12398)
@@ -8,7 +8,7 @@
 
    health            = 200
    maxhealth         = 200
-   initialhealth     = 100
+   initialhealth     = 30
 
    shieldhealth        = 25
    initialshieldhealth = 0
@@ -32,7 +32,7 @@
    boostCooldownDuration = 10
 
    collisionType     = "dynamic"
-   mass              = 100
+   mass              = 1000
    linearDamping     = 0
    angularDamping    = 0
 

Modified: code/branches/Boxhead_FS19/src/modules/hover/Hover.cc
===================================================================
--- code/branches/Boxhead_FS19/src/modules/hover/Hover.cc	2019-05-17 13:00:54 UTC (rev 12397)
+++ code/branches/Boxhead_FS19/src/modules/hover/Hover.cc	2019-05-17 14:29:11 UTC (rev 12398)
@@ -50,7 +50,6 @@
 
 
 
-
 namespace orxonox
 {
     RegisterUnloadableClass(Hover);
@@ -64,8 +63,80 @@
 
         this->setHUDTemplate("HoverHUD");
     }
+    // void Hover::spawnZombie(std::string id)
+    // {
+    //     Identifier *identifier = ClassByString("SpaceShip");
 
+    //       if(!identifier)
+    //     {
+    //         orxout(user_error) << "Script tried to spawn unknown object" << std::endl;
+    //         return;
+    //     }
 
+    //     if(!identifier->isLoadable())
+    //     {
+    //         orxout(user_error) << "Script tried to spawn unloadable object" << std::endl;
+    //         return;
+    //     }
+        
+    
+    //     WorldEntity *entity;
+    //     Identifiable *obj = identifier->fabricate(this->controller_->getWorldEntityByID("Player")->getContext());
+
+
+
+    //     orxout(user_status) << "First hit!" << std::endl;
+
+    //    if(obj->isA(ClassIdentifier<WorldEntity>::getIdentifier()))
+    //     {
+    //         orxout(user_status) << "Is WorldEntity!" << std::endl;
+    //         entity = orxonox_cast<WorldEntity*>(obj);
+    //     }
+    //     else if(obj->isA(ClassIdentifier<PlayerInfo>::getIdentifier()))
+    //     {
+    //         // TODO This does not work yet because somehow the controllable entity is not set
+    //         // yet at this stage.
+    // //        entity = orxonox_cast<PlayerInfo*>(obj)->getControllableEntity();
+
+    //         orxout(user_status) << "Is PlayerInfo!" << std::endl;
+
+    //         //use TEMPLATES in the map to define objects that are not present on the map yet
+    //         return;
+    //     }
+    //     else
+    //     {
+    //         orxout(user_warning) << "Script tried to spawn an object that is neither a WorldEntity, nor a PlayerInfo" << std::endl;
+            
+    //         return;
+    //     }
+       
+    //     if(entity->isA(ClassIdentifier<MobileEntity>::getIdentifier())) {
+    //         orxout(user_status) << "Is MobileEntity!" << std::endl;
+    //         this->controller_->registerMobileEntity(id, orxonox_cast<MobileEntity*>(entity));
+    //     }
+
+        
+
+    //     if(entity->isA(ClassIdentifier<Pawn>::getIdentifier())) {
+    //         orxout(user_status) << "Is Pawn!" << std::endl;
+    //         this->controller_->registerPawn(id, orxonox_cast<Pawn*>(entity));
+    //     }
+        
+    //     this->controller_->registerWorldEntity(id, orxonox_cast<WorldEntity*>(entity));
+
+
+    //     ///////////////GOLD!!!!!!!!!!!!!!!////////////////////////
+    //     Pawn* pawn = this->controller_->getPawnByID(id);
+
+    //     //Attach to pawn
+    //     SpaceShip* drone = new SpaceShip(pawn->getContext()); // this is neccessary because the projectiles fired need a valid creator for the particlespawner (when colliding against something)
+        
+    //     drone->addTemplate("spaceshipzombie"); //ScriptableControllerDroneTemplate spaceshipescort
+
+    //     Vector3 spawnPosition = pawn->getWorldPosition() + Vector3(500,20,500);
+    //     drone->setPosition(spawnPosition);
+    // }
+
     void Hover::tick(float dt)
     {
         SUPER(Hover, tick, dt);
@@ -131,7 +202,7 @@
         // numberOfFlags_ = flags_.size();
 
         //Spawn Zombies
-        //spawnZombie(1);
+        //spawnZombie(z1);
 
 
     }

Modified: code/branches/Boxhead_FS19/src/modules/hover/Hover.h
===================================================================
--- code/branches/Boxhead_FS19/src/modules/hover/Hover.h	2019-05-17 13:00:54 UTC (rev 12397)
+++ code/branches/Boxhead_FS19/src/modules/hover/Hover.h	2019-05-17 14:29:11 UTC (rev 12398)
@@ -61,16 +61,7 @@
             inline int getNumberOfFlags() const
                 { return this->numberOfFlags_; }
 
-             void spawnZombie(std::string id);
 
-            /**
-             * @brief Set the position of an object
-             * @param id The ID of the object
-             * @param x The position on the x-axis
-             * @param y The position on the y-axis
-             * @param z The position on the z-axis
-             */
-
         private:
             WeakPtr<HoverOrigin> origin_;
             std::vector<HoverFlag*> flags_;

Modified: code/branches/Boxhead_FS19/src/modules/hover/HoverShip.cc
===================================================================
--- code/branches/Boxhead_FS19/src/modules/hover/HoverShip.cc	2019-05-17 13:00:54 UTC (rev 12397)
+++ code/branches/Boxhead_FS19/src/modules/hover/HoverShip.cc	2019-05-17 14:29:11 UTC (rev 12398)
@@ -112,7 +112,7 @@
 
         if(otherObject->isA(Class(SpaceShip)))
         {
-            removeHealth(0.1);
+            removeHealth(0.2);
         }
 
         return false;

Modified: code/branches/Boxhead_FS19/src/modules/hover/HoverWall.cc
===================================================================
--- code/branches/Boxhead_FS19/src/modules/hover/HoverWall.cc	2019-05-17 13:00:54 UTC (rev 12397)
+++ code/branches/Boxhead_FS19/src/modules/hover/HoverWall.cc	2019-05-17 14:29:11 UTC (rev 12398)
@@ -108,7 +108,7 @@
         this->attach(model_);
 
         cs_ = new BoxCollisionShape(this->getContext());
-        cs_->setHalfExtents(Vector3(xSize_*1.0f, cellHeight*1.0f, zSize_*1.0f));
+        cs_->setHalfExtents(Vector3(xSize_*1.0f, cellHeight*100000.0f, zSize_*1.0f));
         cs_->setPosition(Vector3(xPos_*1.0f, 0.0f, zPos_*1.0f));
 
         this->attachCollisionShape(cs_);

Modified: code/branches/Boxhead_FS19/src/orxonox/scriptablecontroller/scriptable_controller_api.cc
===================================================================
--- code/branches/Boxhead_FS19/src/orxonox/scriptablecontroller/scriptable_controller_api.cc	2019-05-17 13:00:54 UTC (rev 12397)
+++ code/branches/Boxhead_FS19/src/orxonox/scriptablecontroller/scriptable_controller_api.cc	2019-05-17 14:29:11 UTC (rev 12398)
@@ -76,13 +76,6 @@
     //    new Timer(timeout, false, callback, true);
     //}
 
-
-
-
-
-
-
-
     void ScriptableControllerAPI::registerAtNearObject(std::function<void (std::string, std::string)> callback, std::string id1, std::string id2, double distance)
     {
         WorldEntity *entity1 = this->controller_->getWorldEntityByID(id1);
@@ -564,9 +557,6 @@
     }
 
 
-
-
-
     void ScriptableControllerAPI::moveControllableEntity(std::string id, double x, double y, double z)
     {
         MobileEntity *entity = this->controller_->getMobileEntityByID(id);



More information about the Orxonox-commit mailing list