[Orxonox-commit 3874] r8548 - in code/branches/spacerace: data/levels src/modules/gametypes

msalomon at orxonox.net msalomon at orxonox.net
Mon May 23 17:20:40 CEST 2011


Author: msalomon
Date: 2011-05-23 17:20:40 +0200 (Mon, 23 May 2011)
New Revision: 8548

Modified:
   code/branches/spacerace/data/levels/spaceRace.oxw
   code/branches/spacerace/src/modules/gametypes/RaceCheckPoint.cc
   code/branches/spacerace/src/modules/gametypes/RaceCheckPoint.h
Log:


Modified: code/branches/spacerace/data/levels/spaceRace.oxw
===================================================================
--- code/branches/spacerace/data/levels/spaceRace.oxw	2011-05-23 15:16:00 UTC (rev 8547)
+++ code/branches/spacerace/data/levels/spaceRace.oxw	2011-05-23 15:20:40 UTC (rev 8548)
@@ -36,74 +36,213 @@
     skybox       = "Orxonox/skyBoxMoreNebula"
   >
 
-    <?lua math.randomseed(99) ?>
+    <?lua math.randomseed(98) ?>
 
     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
-    <SpawnPoint team=0 position="0,-2500,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
 
+    <!-- ------------------SpawnPoint----------------- -->
+    <SpawnPoint team=0 position="0,-2100,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff active="true" >
+      <events>
+        <activity>
+          <EventListener event="trigger1" />
+        </activity>
+      </events>
+    </SpawnPoint>
+    
     <!-- ------------------CheckPoints----------------- -->
-    <RaceCheckPoint name=checkpoint1 position="0,-2000,1000" scale=1 distance=20 checkpointindex=0 islast=false>
+    <RaceCheckPoint name=checkpoint1 position="0,-2000,1000" direction="0,-1,1" collisionType="static" scale=1 distance=40 checkpointindex=0 islast=false>
     <attached>
-      <Model mass="100" scale="100" mesh="checkPoint.mesh" />
+      <Model mass="50" scale="50" mesh="checkPoint.mesh" />
     </attached>
+    <collisionShapes>
+      <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
+      <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
+      <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
+      <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
+    </collisionShapes>
     </RaceCheckPoint>
 
-    <RaceCheckPoint name=checkpoint2 position="0,-1400,1400" scale=1 distance=20 checkpointindex=1 islast=false>
+    <RaceCheckPoint name=checkpoint2 position="0,-900,2300" collisionType="static" scale=1 distance=40 checkpointindex=1 islast=false>
     <attached>
-      <Billboard position=" 0,0,0" material="Examples/Flare" colour="1.0, 0.0, 0.0" />
+      <Model mass="50" scale="50" mesh="checkPoint.mesh" />
+      <DistanceTrigger name="trigger1" position="0,0,0" distance=40 stayActive="true" />
+      <SpawnPoint team=0 position="0,0,0" lookat="0,700,2700" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
+	<events>
+	  <activity>
+	    <EventListener event="trigger1" />
+	    <EventListener event="trigger2" />
+	  </activity>
+	</events>
+      </SpawnPoint>
     </attached>
+    <collisionShapes>
+      <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
+      <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
+      <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
+      <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
+    </collisionShapes>
     </RaceCheckPoint>
 
-    <RaceCheckPoint name=checkpoint3 position="0,500,2500" scale=1 distance=20 checkpointindex=2 islast=false>
+    <RaceCheckPoint name=checkpoint3 position="0,700,2700" direction="0,0,1" collisionType="static" scale=1 distance=40 checkpointindex=2 islast=false>
     <attached>
-      <Billboard position=" 0,0,0" material="Examples/Flare" colour="1.0, 0.0, 0.0" />
+      <Model mass="50" scale="50" mesh="checkPoint.mesh" />
+      <DistanceTrigger name="trigger2" position="0,0,0" distance=40 stayActive="true" />
+      <SpawnPoint team=0 position="0,0,0" lookat="0,2100,2300" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
+	<events>
+	  <activity>
+	    <EventListener event="trigger2" />
+	    <EventListener event="trigger3" />
+	  </activity>
+	</events>
+      </SpawnPoint>
     </attached>
+     <collisionShapes>
+      <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
+      <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
+      <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
+      <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
+    </collisionShapes>
     </RaceCheckPoint>
 
-    <RaceCheckPoint name=checkpoint4 position="0,1500,1700" scale=1 distance=20 checkpointindex=3 islast=false>
-    <attached>
-      <Billboard position=" 0,0,0" material="Examples/Flare" colour="1.0, 0.0, 0.0" />
+    <RaceCheckPoint name=checkpoint4 position="0,2100,2300" direction="0,1,1" collisionType="static" scale=1 distance=40 checkpointindex=3 islast=false>
+   <attached>
+      <Model mass="50" scale="50" mesh="checkPoint.mesh" />
+      <DistanceTrigger name="trigger3" position="0,0,0" distance=40 stayActive="true" />
+      <SpawnPoint team=0 position="0,0,0" lookat="0,2200,500" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
+	<events>
+	  <activity>
+	    <EventListener event="trigger3" />
+	    <EventListener event="trigger4" />
+	  </activity>
+	</events>
+      </SpawnPoint>
     </attached>
+     <collisionShapes>
+      <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
+      <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
+      <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
+      <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
+    </collisionShapes>
     </RaceCheckPoint>
 
-    <RaceCheckPoint name=checkpoint5 position="0,2200,500" scale=1 distance=20 checkpointindex=4 islast=false>
+    <RaceCheckPoint name=checkpoint5 position="0,2200,500" direction="0,1,0" collisionType="static" scale=1 distance=40 checkpointindex=4 islast=false>
     <attached>
-      <Billboard position=" 0,0,0" material="Examples/Flare" colour="1.0, 0.0, 0.0" />
+      <Model mass="50" scale="50" mesh="checkPoint.mesh" />
+      <DistanceTrigger name="trigger4" position="0,0,0" distance=40 stayActive="true" />
+      <SpawnPoint team=0 position="0,0,0" lookat="0,1500,-800" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
+	<events>
+	  <activity>
+	    <EventListener event="trigger4" />
+	    <EventListener event="trigger5" />
+	  </activity>
+	</events>
+      </SpawnPoint>
     </attached>
+     <collisionShapes>
+      <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
+      <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
+      <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
+      <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
+    </collisionShapes>
     </RaceCheckPoint>
 
-    <RaceCheckPoint name=checkpoint6 position="0,1500,-800" scale=1 distance=20 checkpointindex=5 islast=false>
+    <RaceCheckPoint name=checkpoint6 position="0,1500,-800" direction="0,1,-1" collisionType="static" scale=1 distance=40 checkpointindex=5 islast=false>
     <attached>
-      <Billboard position=" 0,0,0" material="Examples/Flare" colour="1.0, 0.0, 0.0" />
+      <Model mass="50" scale="50" mesh="checkPoint.mesh" />
+      <DistanceTrigger name="trigger5" position="0,0,0" distance=40 stayActive="true" />
+      <SpawnPoint team=0 position="0,0,0" lookat="0,200,-1900" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
+	<events>
+	  <activity>
+	    <EventListener event="trigger5" />
+	    <EventListener event="trigger6" />
+	  </activity>
+	</events>
+      </SpawnPoint>
     </attached>
+     <collisionShapes>
+      <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
+      <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
+      <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
+      <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
+    </collisionShapes>
     </RaceCheckPoint>
 
-    <RaceCheckPoint name=checkpoint7 position="0,200,-1900" scale=1 distance=20 checkpointindex=6 islast=false>
+    <RaceCheckPoint name=checkpoint7 position="0,200,-1900" collisionType="static" scale=1 distance=40 checkpointindex=6 islast=false>
     <attached>
-      <Billboard position=" 0,0,0" material="Examples/Flare" colour="1.0, 0.0, 0.0" />
+      <Model mass="50" scale="50" mesh="checkPoint.mesh" />
+      <DistanceTrigger name="trigger6" position="0,0,0" distance=40 stayActive="true" />
+      <SpawnPoint team=0 position="0,0,0" lookat="0,-700,-1400" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
+	<events>
+	  <activity>
+	    <EventListener event="trigger6" />
+	    <EventListener event="trigger7" />
+	  </activity>
+	</events>
+      </SpawnPoint>
     </attached>
+     <collisionShapes>
+      <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
+      <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
+      <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
+      <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
+    </collisionShapes>
     </RaceCheckPoint>
 
-    <RaceCheckPoint name=checkpoint8 position="0,-500,-1500" scale=1 distance=20 checkpointindex=7 islast=false>
+    <RaceCheckPoint name=checkpoint8 position="0,-700,-1400" direction="0,-1,-1" collisionType="static" scale=1 distance=40 checkpointindex=7 islast=false>
     <attached>
-      <Billboard position=" 0,0,0" material="Examples/Flare" colour="1.0, 0.0, 0.0" />
+      <Model mass="50" scale="50" mesh="checkPoint.mesh" />
+      <DistanceTrigger name="trigger7" position="0,0,0" distance=40 stayActive="true" />
+      <SpawnPoint team=0 position="0,0,0" lookat="0,-1300,-800" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
+	<events>
+	  <activity>
+	    <EventListener event="trigger7" />
+	    <EventListener event="trigger8" />
+	  </activity>
+	</events>
+      </SpawnPoint>
     </attached>
+     <collisionShapes>
+      <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
+      <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
+      <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
+      <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
+    </collisionShapes>
     </RaceCheckPoint>
 
-    <RaceCheckPoint name=checkpoint9 position="0,-1300,-800" scale=1 distance=20 checkpointindex=8 islast=false>
+    <RaceCheckPoint name=checkpoint9 position="0,-1300,-800" collisionType="static" scale=1 distance=40 checkpointindex=8 islast=false>
     <attached>
-      <Billboard position=" 0,0,0" material="Examples/Flare" colour="1.0, 0.0, 0.0" />
+      <Model mass="50" scale="50" mesh="checkPoint.mesh" />
+      <DistanceTrigger name="trigger8" position="0,0,0" distance=40 stayActive="true" />
+      <SpawnPoint team=0 position="0,0,0" lookat="0,-2400,0" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
+	<events>
+	  <activity>
+	    <EventListener event="trigger8" />
+	  </activity>
+	</events>
+      </SpawnPoint>
     </attached>
+     <collisionShapes>
+      <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
+      <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
+      <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
+      <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
+    </collisionShapes>
     </RaceCheckPoint>
 
-    <RaceCheckPoint name=checkpoint10 position="0,-2500,0" scale=1 distance=20 checkpointindex=9 islast=true>
+    <RaceCheckPoint name=checkpoint10 position="0,-2100,0" collisionType="static" scale=1 distance=40 checkpointindex=9 islast=true>
     <attached>
-      <Billboard position=" 0,0,0" material="Examples/Flare" colour="1.0, 0.0, 0.0" />
+      <Model mass="50" scale="50" mesh="checkPoint.mesh" />
     </attached>
+     <collisionShapes>
+      <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
+      <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
+      <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
+      <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
+    </collisionShapes>
     </RaceCheckPoint>
 
-    <!-- ------------------Planet needs gravity----------------- -->
-    <Planet position="0,0,0" scale=400 pitch=-90 mesh="iceplanet.mesh" atmosphere="atmosphere1" rotationaxis="8,1,0" rotationrate="1" atmospheresize=224.0f imagesize=1024.0f />
+    <!-- ------------------Planet----------------- -->
+    <Planet position="0,0,0" scale=300 pitch=-90 mesh="iceplanet.mesh" atmosphere="atmosphere1" rotationaxis="8,1,0" rotationrate="1" atmospheresize=224.0f imagesize=1024.0f />
     <StaticEntity position="0,0,0" collisionType=static>
 	<collisionShapes>
 	    <SphereCollisionShape radius="399" />
@@ -119,13 +258,20 @@
     z = math.cos(i/max*6)*2500
     x = 0
     ?>
-<?lua
-for k = 1, 20, 1
-do
-j = math.random()
-?>
+    <?lua
+    for k = 1, 15, 1
+    do
+    j = math.random()
+    ?>
 
-    <StaticEntity position="<?lua print(x + math.random() * 500) ?>,<?lua print(y + math.random() * 500) ?>,<?lua print(z + math.random() * 1000) ?>" scale="<?lua print(j * 5) ?>" >
+    <MovableEntity
+      position = "<?lua print(x + math.random() * 500) ?>,<?lua print(y + math.random() * 500) ?>,<?lua print(z + math.random() * 1000) ?>"
+      collisionType = "dynamic"
+      linearDamping = "0.5"
+      angularDamping = "0.01"
+      collisiondamage = "0.01"
+      enablecollisiondamage = "true"
+      scale="<?lua print(j * 5) ?>" >
       <attached>
         <Model position="0,0,0" scale="<?lua print(j * 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh">
 	  <?lua if k == 5 then ?><attached><!-- ---------asteroid fog----- -->
@@ -133,36 +279,69 @@
           </attached> <?lua end ?>
 	</Model>
       </attached>
-      <?lua if i == 5 then ?><collisionShapes>
-        <SphereCollisionShape radius="<?lua print(j * 70) ?>" />
-      </collisionShapes> <?lua end ?>
-    </StaticEntity>
-<?lua
-end
-?>
-<?lua end ?>
+      <collisionShapes>
+        <SphereCollisionShape radius="<?lua print(j * 80) ?>" />
+      </collisionShapes>
+    </MovableEntity>
+    <?lua
+    end
+    ?>
+    <?lua end ?>
 
-    <ForceField position="9000,9000,0" direction="-1,-1,0" diameter=500 velocity=5000 length=5000 />
-        <MovableEntity position="9000,9000,0">
+    <!-- ---------------ForceFields----------------- -->
+    <ForceField position="0,-700,2700" direction="0,1,0" diameter=500 velocity=2000 length=600 />
+        <MovableEntity position="0,-400,2700">
             <attached>
                 <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.5,0,0" scale=2/>
-                <?lua for i=0,20,1 do ?>
-                    <Billboard position="<?lua print(-i*200*1.414/2) ?>,<?lua print(-i*200*1.414/2) ?>,-100" material="Examples/Flare" colour="0.5,0,0" scale=1/>
-                    <Billboard position="<?lua print(-i*200*1.414/2) ?>,<?lua print(-i*200*1.414/2) ?>,100" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+                <?lua for i=0,15,1 do ?>
+                    <Billboard position="-200,<?lua print(i*40) ?>,0" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+                    <Billboard position="200,<?lua print(i*40) ?>,0" material="Examples/Flare" colour="0.5,0,0" scale=1/>
                 <?lua end ?>
                 </attached>
         </MovableEntity>
 
-    <ForceField position="0,500,-2500" direction="1,1,0" diameter=500 velocity=5000 length=5000 />
-        <MovableEntity position="9000,9000,0">
+     <ForceField position="0,2500,2000" direction="0,0,-1" diameter=250 velocity=2000 length=600 />
+        <MovableEntity position="0,2500,2000">
             <attached>
                 <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.5,0,0" scale=2/>
+                <?lua for i=0,15,1 do ?>
+                    <Billboard position="-100,0,-<?lua print(i*40) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+                    <Billboard position="100,0,-<?lua print(i*40) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+                <?lua end ?>
+                </attached>
+        </MovableEntity>
+
+    <ForceField position="0,1300,-800" direction="0,-1,-1" diameter=250 velocity=2000 length=800 />
+        <MovableEntity position="0,1300,-800">
+            <attached>
+                <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.5,0,0" scale=2/>
                 <?lua for i=0,20,1 do ?>
-                    <Billboard position="<?lua print(i*200*1.414/2) ?>,<?lua print(i*200*1.414/2) ?>,-100" material="Examples/Flare" colour="0.5,0,0" scale=1/>
-                    <Billboard position="<?lua print(i*200*1.414/2) ?>,<?lua print(i*200*1.414/2) ?>,100" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+                    <Billboard position="-100,<?lua print(-i*40*0.7071) ?>,<?lua print(-i*40*0.7071) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+                    <Billboard position="100,<?lua print(-i*40*0.7071) ?>,<?lua print(-i*40*0.7071) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
                 <?lua end ?>
                 </attached>
         </MovableEntity>
 
+    <ForceField position="0,-1400,-700" direction="0,-1,1" diameter=250 velocity=2000 length=600 />
+        <MovableEntity position="0,-1400,-700">
+            <attached>
+                <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.5,0,0" scale=2/>
+                <?lua for i=0,15,1 do ?>
+                    <Billboard position="-100,<?lua print(-i*40*0.7071) ?>,<?lua print(i*40*0.7071) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+                    <Billboard position="100,<?lua print(-i*40*0.7071) ?>,<?lua print(i*40*0.7071) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+                <?lua end ?>
+                </attached>
+        </MovableEntity>
+
+    <!-- ---------------SpaceShips----------------- -->
+    <SpaceShip position="0,2000,2000" lookat="0,0,0" >
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <AIController />
+      </controller>
+    </SpaceShip>
+
   </Scene>
 </Level>

Modified: code/branches/spacerace/src/modules/gametypes/RaceCheckPoint.cc
===================================================================
--- code/branches/spacerace/src/modules/gametypes/RaceCheckPoint.cc	2011-05-23 15:16:00 UTC (rev 8547)
+++ code/branches/spacerace/src/modules/gametypes/RaceCheckPoint.cc	2011-05-23 15:20:40 UTC (rev 8548)
@@ -44,6 +44,7 @@
 	
 	this->bCheckpointIndex_ = 0;
 	this->bIsLast_ = false;
+	this->bTimeLimit_=0;
 	
 	this->setRadarObjectColour(ColourValue::Red);
         this->setRadarObjectShape(RadarViewable::Dot);
@@ -70,6 +71,7 @@
 	
 	XMLPortParam(RaceCheckPoint, "checkpointindex", setCheckpointIndex, getCheckpointIndex, xmlelement, mode).defaultValues(0);
 	XMLPortParam(RaceCheckPoint, "islast", setLast, getLast, xmlelement, mode).defaultValues(false);
+	XMLPortParam(RaceCheckPoint, "timelimit", setTimelimit, getTimeLimit, xmlelement, mode).defaultValues(0);
     }
     
     void RaceCheckPoint::triggered(bool bIsTriggered)

Modified: code/branches/spacerace/src/modules/gametypes/RaceCheckPoint.h
===================================================================
--- code/branches/spacerace/src/modules/gametypes/RaceCheckPoint.h	2011-05-23 15:16:00 UTC (rev 8547)
+++ code/branches/spacerace/src/modules/gametypes/RaceCheckPoint.h	2011-05-23 15:20:40 UTC (rev 8548)
@@ -56,13 +56,17 @@
 	    { this->bCheckpointIndex_ = checkpointIndex; }
 	inline int getCheckpointIndex()
 	    { return this->bCheckpointIndex_; }
+	inline void setTimelimit(int timeLimit)
+	    { this->bTimeLimit_ = timeLimit;}
+	inline int getTimeLimit()
+	    { return this->bTimeLimit_;}
 	inline const WorldEntity* getWorldEntity() const
             { return this; }
 	
     private:
 	int bCheckpointIndex_;
 	bool bIsLast_;
-	
+	int bTimeLimit_;
       
     };
 }




More information about the Orxonox-commit mailing list