Index: code/branches/presentation2/data/levels/presentationHS09b.oxw
===================================================================
--- code/branches/presentation2/data/levels/presentationHS09b.oxw	(revision 6347)
+++ code/branches/presentation2/data/levels/presentationHS09b.oxw	(revision 6358)
@@ -24,10 +24,10 @@
   >
 
-    
+
 <AmbientSound ambientSource="Mars.ogg" loop="true" play="true" />
 
    <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" />
 <?lua
-   for i = 1, 50, 1 
+   for i = 1, 50, 1
    do
    x = math.random() * 2000  + 4000
@@ -36,6 +36,6 @@
    s = math.random() * 100
    ?>
-    
-    <MovableEntity collisiontype=dynamic mass=<?lua print(s*10)?> position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.01 angularDamping=0 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 100 - 15) ?>"> 
+
+    <MovableEntity collisiontype=dynamic mass=<?lua print(s*10)?> position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.01 angularDamping=0 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 100 - 15) ?>">
       <attached>
         <Model position="0,0,0" scale=<?lua print(s) ?> mesh="asteroid_UV.mesh" />
@@ -46,5 +46,5 @@
     </MovableEntity>
      <ParticleSpawner position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" source="Orxonox/Steam" lifetime=3.0 loop=1 />
-<?lua 
+<?lua
 end
 ?>
@@ -56,5 +56,5 @@
     return table.getn(elements)
 end
-for i = 1, 100, 1 
+for i = 1, 100, 1
 do
 x = math.random() * 750 - 4500
@@ -63,15 +63,15 @@
 e = math.floor(math.random()*elements.length()+1)
 ?>
-    
-    <MovableEntity mass=90000 position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.8 angularDamping=0.8 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30- 15) ?>"> 
+
+    <MovableEntity mass=90000 position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.8 angularDamping=0.8 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30- 15) ?>">
       <attached>
         <Model position="0,0,0" scale="<?lua print(sizes[e]) ?>" mesh="<?lua print( elements[e]) ?>" />
       </attached>
     </MovableEntity>
-	<?lua 
+	<?lua
 	end
 	?>
 <?lua
-for i = 1,25, 1 
+for i = 1,25, 1
 do
 ?>
@@ -88,5 +88,5 @@
       </controller>
     </SpaceShip>
-<?lua 
+<?lua
 end
 ?>
@@ -189,5 +189,5 @@
 
    <?lua
-   for i = 1, 50, 1 
+   for i = 1, 50, 1
    do
    x = -(math.random() * 2000  + 4000)
@@ -196,6 +196,6 @@
    s = math.random() * 100
    ?>
-    
-<MovableEntity collisiontype=dynamic mass=<?lua print(s*10)?> position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.01 angularDamping=0 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 100 - 15) ?>"> 
+
+<MovableEntity collisiontype=dynamic mass=<?lua print(s*10)?> position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.01 angularDamping=0 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 100 - 15) ?>">
       <attached>
         <Model position="0,0,0" scale=<?lua print(s) ?> mesh="asteroid_ice.mesh" />
@@ -206,26 +206,54 @@
     </MovableEntity>
      <ParticleSpawner position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" source="Orxonox/Steam" lifetime=3.0 loop=1 />
-<?lua 
-end
-?>
-<?lua
-for i = 1,25, 1 
+<?lua
+end
+?>
+<!--<EventDispatcher>
+      <targets>
+        <EventTarget target=attack />
+	<EventTarget target=wait />
+      </targets>
+      <events>
+        <activity>
+          <DistanceTrigger position="0, 0, 4500" distance=100 target="SpaceShip" stayactive=true />
+        </activity>
+      </events>
+</EventDispatcher>
+
+<EventDispatcher>
+      <targets>
+        <EventTarget target=wait />
+      </targets>
+      <events>
+        <activity>
+          <DistanceTrigger position="0, 0, 4500" distance=100 target="SpaceShip" stayactive=false />
+        </activity>
+      </events>
+</EventDispatcher>-->
+
+<?lua
+for i = 1,25, 1
 do
 ?>
-    <SpaceShip position="-5000,0,<?lua print(i*50 - 150) ?>" >
+<SpaceShip position="<?lua print(-(math.random()*500 + 4500)) ?>,<?lua print(-(math.random()*500 -250)) ?>,<?lua print(i*50 - 150) ?>" >
       <templates>
         <Template link=spaceshipghost />
       </templates>
       <controller>
-	<WaypointPatrolController alertnessradius=1000 team=1 active=true>
-          <waypoints>
-            <StaticEntity position="-5000,<?lua print(math.random()*50)?> ,<?lua print(i*50 -150) ?>" />
-          </waypoints>
-        </WaypointPatrolController>
+
+          <WaypointPatrolController name=attack alertnessradius=15000 team=1 active=false>
+          <events>
+           <activity>
+             <DistanceTrigger position="-5000, 100, 100" distance=2000 target="Camera" stayactive=true />
+           </activity>
+          </events>
+          </WaypointPatrolController>
+
       </controller>
     </SpaceShip>
-<?lua 
-end
-?>
+<?lua
+end
+?>
+
 
 
