Index: /data/trunk/scripts/attractor.lua
===================================================================
--- /data/trunk/scripts/attractor.lua	(revision 4201)
+++ /data/trunk/scripts/attractor.lua	(revision 4202)
@@ -3,4 +3,5 @@
 thisscript:registerClass("ScriptTrigger")
 
+-- Create the trigger
 trigger = ScriptTrigger()
 trigger:setScript("attractor.lua")
Index: /data/trunk/scripts/falldown.lua
===================================================================
--- /data/trunk/scripts/falldown.lua	(revision 4201)
+++ /data/trunk/scripts/falldown.lua	(revision 4202)
@@ -1,2 +1,12 @@
+-- Create the trigger
+trigger = ScriptTrigger()
+trigger:setName("falldowntrigger")
+trigger:setScript("falldown.lua")
+trigger:setFunction("tick")
+trigger:setAbsCoor(670.307190, 0, -410.386810)
+trigger:setTarget("Player")
+trigger:setRadius(100)
+
+
 -- Get objects from orxonox
 thisscript:addObject("TestEntity", "fallingguy")
@@ -102,11 +112,10 @@
 function tick(timestep)
  flee(timestep)
---RandTime()
-
---if randTime > 0 then
---randTime = randTime - timestep
---else
+RandTime()
+if randTime > 0 then
+randTime = randTime - timestep
+else
 fallDown(timestep)
---end
+end
 
 return eventFinished
Index: /data/trunk/scripts/floorguy.lua
===================================================================
--- /data/trunk/scripts/floorguy.lua	(revision 4201)
+++ /data/trunk/scripts/floorguy.lua	(revision 4202)
@@ -1,2 +1,11 @@
+-- Create the trigger
+trigger = ScriptTrigger()
+trigger:setName("floorguytrigger")
+trigger:setScript("floorguy.lua")
+trigger:setFunction("tick")
+trigger:setAbsCoor(576.753357, 19, 508.746613)
+trigger:setTarget("Player")
+trigger:setRadius(100)
+
 -- Get objects from orxonox
 thisscript:addObject("GenericNPC", "floorguy")
@@ -21,14 +30,13 @@
 if time < 0 and time > -0.4 then
 flyby:fire(true)
-end
-
-if flybyZ < 600 then
-flyby:setAbsCoor(flybyX + dx, flybyY + dy, flybyZ + dz)
 else
 flyby:fire(false)
 end
 
+if flybyZ < 600 then
+--flyby:setAbsCoor(flybyX + dx, flybyY + dy, flybyZ + dz)
 end
 
+end
 
 function tick(timestep)
Index: /data/trunk/scripts/guard.lua
===================================================================
--- /data/trunk/scripts/guard.lua	(revision 4201)
+++ /data/trunk/scripts/guard.lua	(revision 4202)
@@ -1,2 +1,9 @@
+-- Create the trigger
+trigger = ScriptTrigger()
+trigger:setName("guardtrigger")
+trigger:setScript("guard.lua")
+trigger:setFunction("tick")
+trigger:setActiveOnCreation(true)
+
 -- Get objects from orxonox
 thisscript:addObject("GenericNPC","guard")
Index: /data/trunk/scripts/hangar.lua
===================================================================
--- /data/trunk/scripts/hangar.lua	(revision 4201)
+++ /data/trunk/scripts/hangar.lua	(revision 4202)
@@ -1,2 +1,13 @@
+-- Create the trigger
+trigger = ScriptTrigger()
+trigger:setName("hangartrigger")
+trigger:setScript("hangar.lua")
+trigger:setFunction("tick")
+trigger:setAbsCoor(678.946838, -11.959779, -920.512634)
+trigger:setTarget("Player")
+trigger:setRadius(100)
+
+
+
 -- Get objects from orxonox
 thisscript:addObject("Claw", "spaceshipclaw")
Index: /data/trunk/scripts/lua_extra_functions
===================================================================
--- /data/trunk/scripts/lua_extra_functions	(revision 4201)
+++ /data/trunk/scripts/lua_extra_functions	(revision 4202)
@@ -15,6 +15,4 @@
 -- Returns the distance between (x1,x2,x3) and (y1,y2,y3)
 function dist( x1,x2,x3, y1,y2,y3 )
-
 return math.sqrt( (x1-y1)^2 + (x2-y2)^2 + (x3-y3)^2 )
-
 end
Index: /data/trunk/scripts/prisoner.lua
===================================================================
--- /data/trunk/scripts/prisoner.lua	(revision 4201)
+++ /data/trunk/scripts/prisoner.lua	(revision 4202)
@@ -1,2 +1,10 @@
+-- Create the trigger
+trigger = ScriptTrigger()
+trigger:setName("prisonertrigger")
+trigger:setScript("prisoner.lua")
+trigger:setFunction("tick")
+trigger:setActiveOnCreation(true)
+
+
 -- Get objects from orxonox
 thisscript:addObject("GenericNPC", "prisoner")
Index: /data/trunk/scripts/secondguard.lua
===================================================================
--- /data/trunk/scripts/secondguard.lua	(revision 4201)
+++ /data/trunk/scripts/secondguard.lua	(revision 4202)
@@ -1,2 +1,10 @@
+-- Create the trigger
+trigger = ScriptTrigger()
+trigger:setName("secondguardtrigger")
+trigger:setScript("secondguard.lua")
+trigger:setFunction("tick")
+trigger:setActiveOnCreation(true)
+
+
 -- Get objects from orxonox
 thisscript:addObject("GenericNPC", "secondguard")
Index: /data/trunk/scripts/secondprisoner.lua
===================================================================
--- /data/trunk/scripts/secondprisoner.lua	(revision 4201)
+++ /data/trunk/scripts/secondprisoner.lua	(revision 4202)
@@ -1,2 +1,9 @@
+-- Create the trigger
+trigger = ScriptTrigger()
+trigger:setName("secondprisonertrigger")
+trigger:setScript("secondprisoner.lua")
+trigger:setFunction("tick")
+trigger:setActiveOnCreation(true)
+
 -- Get objects from orxonox
 thisscript:addObject("GenericNPC", "Secondprisoner")
Index: /data/trunk/scripts/spaceship_flight.lua
===================================================================
--- /data/trunk/scripts/spaceship_flight.lua	(revision 4201)
+++ /data/trunk/scripts/spaceship_flight.lua	(revision 4202)
@@ -1,14 +1,71 @@
--- Global Variables
+-- Create the trigger
+trigger = ScriptTrigger()
+trigger:setName("spaceship_flight_trigger")
+trigger:setScript("spaceship_flight.lua")
+trigger:setFunction("tick")
+trigger:setAbsCoor(2500, 0, -1695)
+trigger:setTarget("SPACE_CRAFT")
+trigger:setRadius(150)
+
+-- Add Objects
 thisscript:addObject("GameWorld", "Ambush_at_Uranus")
 thisscript:addObject("Spacecraft2D", "SPACE_CRAFT")
+thisscript:addObject("Gate", "Hypergate")
+thisscript:addObject("SpaceShip", "TerranCruizer")
+-- Global Variables
+horizontalmode = false
+gateReached = false
+terrancriuseratgate = false
 
 
+function dist( x1,x2,x3, y1,y2,y3 )
+return math.sqrt( (x1-y1)^2 + (x2-y2)^2 + (x3-y3)^2 )
+end
+
+
+function observeSpaceCraft()
+SPACE_CRAFTX = SPACE_CRAFT:getAbsCoorX()
+SPACE_CRAFTY = SPACE_CRAFT:getAbsCoorY()
+SPACE_CRAFTZ = SPACE_CRAFT:getAbsCoorZ()
+
+distance = dist(SPACE_CRAFTX,SPACE_CRAFTY,SPACE_CRAFTZ,6053.186035, -2.306574, -1704.989624)
+
+if distance < 100 then
+Hypergate:destroy()
+end
+
+end
 
 function tick(timestep)
+observeSpaceCraft()
 
- Ambush_at_Uranus:setPlaymode("Horizontal")
+if not horizontalmode then
+ --Ambush_at_Uranus:setPlaymode("Horizontal")
  Ambush_at_Uranus:setSoundtrack("sound/music/00-luke_grey_-_hypermode.ogg")
  SPACE_CRAFT:setAirFriction(3.0)
+ horizontalmode = true
+end
 
- return true
+if not terrancriuseratgate then
+dx = 70 * timestep
+dy = 0 * timestep
+dz = 0 * timestep
+
+TerranCruizerX = TerranCruizer:getAbsCoorX()
+TerranCruizerY = TerranCruizer:getAbsCoorY()
+TerranCruizerZ = TerranCruizer:getAbsCoorZ()
+
+distance = dist(TerranCruizerX,TerranCruizerY,TerranCruizerZ,6053.186035, -2.306574, -1704.989624)
+
+if distance < 100  then
+TerranCruizer:hide()
+dx = 5000
+terrancriuseratgate = true
 end
+
+TerranCruizer:setAbsCoor(TerranCruizerX + dx, TerranCruizerY + dy, TerranCruizerZ + dz)
+
+end
+
+ return false
+end
Index: /data/trunk/worlds/sp_level_ambush_at_uranus.oxw
===================================================================
--- /data/trunk/worlds/sp_level_ambush_at_uranus.oxw	(revision 4201)
+++ /data/trunk/worlds/sp_level_ambush_at_uranus.oxw	(revision 4202)
@@ -49,98 +49,7 @@
     </Script>
 
-    <Script>
-     <file>cruiser.lua</file>
-    </Script>
-
    </Scripts>
 
    <ScriptTriggers>
-
-    <ScriptTrigger>
-     <name>falldowntrigger</name>
-     <file>falldown.lua</file>
-     <function>tick</function>
-     <abs-coor>670.307190, 0, -410.386810</abs-coor>
-     <radius>100</radius>
-     <worldentity>Player</worldentity>
-
-    </ScriptTrigger>
-
-    <ScriptTrigger>
-     <name>guardtrigger</name>
-     <file>guard.lua</file>
-     <function>tick</function>
-     <abs-coor>-84, 19, 77</abs-coor>
-     <radius>100</radius>
-     <worldentity>Player</worldentity>
-    </ScriptTrigger>
-
-    <ScriptTrigger>
-     <name>secondguardtrigger</name>
-     <file>secondguard.lua</file>
-     <function>tick</function>
-     <abs-coor>-84, 19, 77</abs-coor>
-     <radius>100</radius>
-     <worldentity>Player</worldentity>
-    </ScriptTrigger>
-
-    <ScriptTrigger>
-     <name>prisonertrigger</name>
-     <file>prisoner.lua</file>
-     <function>tick</function>
-     <abs-coor>-84, 19, 77</abs-coor>
-     <radius>100</radius>
-     <worldentity>Player</worldentity>
-    </ScriptTrigger>
-
-   <ScriptTrigger>
-     <name>secondprisonertrigger</name>
-     <file>secondprisoner.lua</file>
-     <function>tick</function>
-     <abs-coor>-84, 19, 77</abs-coor>
-     <radius>100</radius>
-     <worldentity>Player</worldentity>
-    </ScriptTrigger>
-
-    <ScriptTrigger>
-     <name>hangartrigger</name>
-     <file>hangar.lua</file>
-     <function>tick</function>
-     <abs-coor>678.946838, -11.959779, -920.512634</abs-coor>
-     <radius>100</radius>
-     <worldentity>Player</worldentity>
-
-    </ScriptTrigger>
-
-
-    <ScriptTrigger>
-     <name>floorguytrigger</name>
-     <file>floorguy.lua</file>
-     <function>tick</function>
-     <abs-coor>576.753357, 19, 508.746613</abs-coor>
-     <radius>100</radius>
-     <worldentity>Player</worldentity>
-    </ScriptTrigger>
-
-    <ScriptTrigger>
-     <name>spaceship_flight_trigger</name>
-     <file>spaceship_flight.lua</file>
-     <function>tick</function>
-     <abs-coor>2500, 0, -1695</abs-coor>
-     <radius>150</radius>
-     <worldentity>SPACE_CRAFT</worldentity>
-    
-    </ScriptTrigger>
-
-
-    <ScriptTrigger>
-     <name>gatetrigger</name>
-     <file>cruiser.lua</file>
-     <function>tick</function>
-     <abs-coor>2500, 0, -1695</abs-coor>
-     <radius>150</radius>
-     <worldentity>TerranCruizer</worldentity>
-    
-    </ScriptTrigger>
 
    </ScriptTriggers>
@@ -284,9 +193,16 @@
 
 
+  <!--  <SpaceShip>
+      <name>SPACE_CRAFT</name>
+      <abs-coor>1600, 0.004610, -1700.0</abs-coor>
+      <enter-radius>100000</enter-radius>
+      <model>models/ships/mantawing.obj,20</model>
+    </SpaceShip>
+-->
 
     <SpaceShip>
       <name>flyby</name>
       <model>models/ships/reap_#.obj,20</model>
-      <abs-coor>900.753357, 19, 508.746613</abs-coor>
+      <abs-coor>800, 19, 508.746613</abs-coor>
       <abs-dir> 1.5,0,1,0 </abs-dir>
     </SpaceShip>
@@ -413,13 +329,14 @@
       <model>models/ships/terran_cruizer.obj</model>
       <enter-radius>500</enter-radius>
-      <abs-coor>5200, -300, -1700</abs-coor>
+      <abs-coor>5200, 0, -1700</abs-coor>
    </SpaceShip>
 
 
- <Gate>   <name>Hypergate</name>
-   <scale>800.0</scale>
-    <action-radius>8000.0</action-radius>
-  <abs-coor>6000, 0, -1700</abs-coor>
-  <abs-dir>1.57, 0, 1, 0</abs-dir>
+ <Gate>   
+   <name>Hypergate</name>
+   <scale>6400.0</scale>
+   <action-radius>500.0</action-radius>
+   <abs-coor>6000, 0, -1700</abs-coor>
+   <abs-dir>1.57, 0, 1, 0</abs-dir>
  </Gate> 
 
