Index: data/branches/single_player_map/scripts/floorguy.lua
===================================================================
--- data/branches/single_player_map/scripts/floorguy.lua	(revision 4068)
+++ data/branches/single_player_map/scripts/floorguy.lua	(revision 4070)
@@ -4,5 +4,5 @@
 
 programRoute = true
-height = 10
+height = -10
 
 function tick(timestep)
Index: data/branches/single_player_map/scripts/guard.lua
===================================================================
--- data/branches/single_player_map/scripts/guard.lua	(revision 4068)
+++ data/branches/single_player_map/scripts/guard.lua	(revision 4070)
@@ -10,5 +10,5 @@
 guardStopped = false
 
-height = 29
+height = 34
 
 -- Returns the distance between (x1,x2,x3) and (y1,y2,y3)
@@ -31,19 +31,15 @@
 distance = dist( guardX,guardY,guardZ,playerX, playerY, playerZ)
 
---io.write(distance, " \n")
-
-if dist( guardX,guardY,guardZ,playerX, playerY, playerZ) > 150 and hangarRouteProgrammed and not guardStopped then
- io.write("guard stopped\n")
+if distance > 250 and hangarRouteProgrammed and not guardStopped then
  guard:stop()
  guardStopped = true
 end
 
-if dist( guardX,guardY,guardZ,playerX, playerY, playerZ) < 150 and hangarRouteProgrammed and guardStopped then
-io.write("guard resumed\n")
+if distance < 250 and hangarRouteProgrammed and guardStopped then
  guard:resume()
  guardStopped = false
 end
 
-if dist( playerX,playerY,playerZ,167.361526,29,483.163818 ) < 60 then
+if dist( playerX,playerY,playerZ,167.361526,29,483.163818 ) < 200 then
 playerInLock = true
 end
@@ -150,5 +146,5 @@
 
 if not hangarRouteProgrammed and playerInLock then
-guard:walkTo( 120.981117, height, 503.008972)
+
 guard:walkTo( 133.354797, height, 504.669128)
 guard:walkTo( 147.490158, height, 507.034393)
Index: data/branches/single_player_map/scripts/hangar.lua
===================================================================
--- data/branches/single_player_map/scripts/hangar.lua	(revision 4070)
+++ data/branches/single_player_map/scripts/hangar.lua	(revision 4070)
@@ -0,0 +1,239 @@
+-- Get objects from orxonox
+thisscript:addObject("Claw", "spaceshipclaw")
+thisscript:addObject("RepairStation", "repair")
+thisscript:addObject("FPSPlayer", "Player")
+thisscript:addObject("SpaceShip", "spaceship")
+thisscript:addObject("GenericNPC", "mechanic")
+
+-- Global Variables
+playerEnteredSpaceShip = false
+playerReachedTrigger = false
+spaceshipOnPad = false
+spaceshipLaunchReady = false
+
+
+-- 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
+
+
+
+function observePlayer()
+
+--playerEnteredSpaceShip = spaceship:hasPlayer()
+
+playerX = Player:getAbsCoorX()
+playerY = Player:getAbsCoorY()
+playerZ = Player:getAbsCoorZ()
+
+if dist( playerX,playerY,playerZ,678.946838, -11.959779, -920.512634 ) < 200 then
+playerReachedTrigger = true
+end
+
+end
+
+
+
+
+
+programRoute = true
+mheight = 5
+function mechanicMove(timestep)
+if programRoute then
+
+mechanic:walkTo( 991.192261, mheight, -1878.394287)
+mechanic:walkTo( 976.976685, mheight, -1879.182129)
+mechanic:walkTo( 963.752625, mheight, -1880.202881)
+mechanic:walkTo( 948.094543, mheight, -1880.980713)
+mechanic:walkTo( 931.008606, mheight, -1880.974854)
+mechanic:walkTo( 917.888428, mheight, -1880.832764)
+mechanic:walkTo( 901.552368, mheight, -1880.655762)
+mechanic:walkTo( 886.475220, mheight, -1880.522949)
+mechanic:walkTo( 872.041504, mheight, -1880.545410)
+mechanic:walkTo( 851.380249, mheight, -1880.577637)
+mechanic:walkTo( 840.637512, mheight, -1880.594238)
+mechanic:walkTo( 828.564941, mheight, -1880.489868)
+mechanic:walkTo( 811.580322, mheight, -1880.085205)
+mechanic:walkTo( 801.953003, mheight, -1880.036377)
+mechanic:walkTo( 784.801086, mheight, -1880.280762)
+mechanic:walkTo( 774.514343, mheight, -1880.380005)
+mechanic:walkTo( 762.351746, mheight, -1880.248779)
+mechanic:walkTo( 750.737549, mheight, -1880.123413)
+mechanic:walkTo( 739.186890, mheight, -1879.999023)
+mechanic:walkTo( 728.210022, mheight, -1879.880371)
+mechanic:walkTo( 717.243835, mheight, -1879.761719)
+mechanic:walkTo( 708.253235, mheight, -1879.649048)
+mechanic:walkTo( 695.825867, mheight, -1877.611938)
+mechanic:walkTo( 687.077820, mheight, -1869.800659)
+mechanic:walkTo( 683.886963, mheight, -1859.888062)
+mechanic:walkTo( 685.589905, mheight, -1844.102051)
+mechanic:walkTo( 686.333069, mheight, -1837.212524)
+mechanic:walkTo( 687.256042, mheight, -1828.656860)
+mechanic:walkTo( 688.759583, mheight, -1820.024048)
+mechanic:walkTo( 690.621216, mheight, -1809.834595)
+mechanic:walkTo( 692.045593, mheight, -1803.566772)
+mechanic:walkTo( 695.021851, mheight, -1795.320923)
+mechanic:walkTo( 703.956360, mheight, -1789.028931)
+mechanic:walkTo( 711.400574, mheight, -1785.378418)
+mechanic:walkTo( 720.236267, mheight, -1782.750977)
+mechanic:walkTo( 741.346130, mheight, -1786.131836)
+mechanic:walkTo( 744.505798, mheight, -1788.214111)
+mechanic:walkTo( 753.788513, mheight, -1796.320557)
+mechanic:walkTo( 760.480408, mheight, -1804.107788)
+mechanic:walkTo( 765.918274, mheight, -1811.952393)
+mechanic:walkTo( 772.114990, mheight, -1823.565674)
+mechanic:walkTo( 776.130737, mheight, -1830.713989)
+mechanic:walkTo( 781.833313, mheight, -1836.770996)
+mechanic:walkTo( 796.051880, mheight, -1843.499512)
+mechanic:walkTo( 805.178101, mheight, -1844.844116)
+mechanic:walkTo( 816.733154, mheight, -1846.198608)
+mechanic:walkTo( 830.296326, mheight, -1844.374146)
+mechanic:walkTo( 841.234680, mheight, -1841.184814)
+mechanic:walkTo( 853.356201, mheight, -1837.650391)
+mechanic:walkTo( 866.242981, mheight, -1833.892944)
+mechanic:walkTo( 877.006836, mheight, -1830.820923)
+mechanic:walkTo( 889.236816, mheight, -1828.092773)
+mechanic:walkTo( 897.856689, mheight, -1826.204346)
+mechanic:walkTo( 909.685486, mheight, -1823.613037)
+mechanic:walkTo( 922.058777, mheight, -1819.907227)
+mechanic:walkTo( 933.861328, mheight, -1814.044800)
+mechanic:walkTo( 943.290588, mheight, -1809.960205)
+mechanic:walkTo( 952.188293, mheight, -1806.317261)
+mechanic:walkTo( 985.450745, mheight, -1800.297729)
+mechanic:walkTo( 1000.339722, mheight, -1800.916626)
+mechanic:walkTo( 1013.447937, mheight, -1802.642090)
+mechanic:walkTo( 1022.703430, mheight, -1808.694946)
+mechanic:walkTo( 1030.242554, mheight, -1821.859253)
+mechanic:walkTo( 1030.063354, mheight, -1839.935547)
+mechanic:walkTo( 1025.804932, mheight, -1864.135986)
+mechanic:walkTo( 1019.079651, mheight, -1878.196777)
+
+programRoute = false
+end
+
+if mechanic:finalGoalReached() then
+programRoute = true
+end
+
+end
+
+
+
+
+
+
+
+
+
+positionReached = false
+spaceShipReleased = false
+function moveToLaunchSite(timestep)
+
+if not positionReached then
+dx = 10 * timestep
+dy = 0 * timestep
+dz = 0* timestep
+end
+
+if not spaceShipReleased and positionReached then 
+dx = 0 * timestep
+dy = 10 * timestep
+dz = 0 * timestep
+end
+
+if positionReached and spaceShipReleased then
+dx = 0 * timestep
+dy = 1 * timestep
+dz = 0 * timestep
+end
+
+
+if spaceshipOnPad then
+
+if not spaceShipReleased then
+--spaceshipclaw:playAnimation(1,1)
+io.write("release spaceship\n")
+spaceShipReleased = true
+playerEnteredSpaceShip = true
+end
+
+--if clawY > 100 then
+spaceshipLaunchReady = true
+--end
+
+end
+
+
+-- set new coordinates
+--clawX = claw:getAbsCoorX()
+--clawY = claw:getAbsCoorY()
+--clawZ = claw:getAbsCoorZ()
+
+--claw:setAbsCoor(clawX + dx, clawY + dy, clawZ + dz)
+spaceshipX = spaceship:getAbsCoorX()
+spaceshipY = spaceship:getAbsCoorY()
+spaceshipZ = spaceship:getAbsCoorZ()
+
+spaceship:setAbsCoor(spaceshipX + dx, spaceshipY + dy, spaceshipZ + dz)
+
+
+
+--if dist( clawX,clawY,clawZ,1020.025024, -11.959781, -1721.614380 ) < 60 then
+if dist( spaceshipX,spaceshipY,spaceshipZ,1020.025024, -11.959781, -1721.614380 ) < 60 then
+positionReached = true
+end
+
+
+--if dist( clawX,clawY,clawZ,167.361526,29,483.163818 ) < 60 then
+if  spaceshipY > 10 then
+spaceshipOnPad = true
+end
+
+
+end
+
+hoverPosReached = false
+function launchSpaceShip(timestep)
+
+if not hoverPosReached then
+dx = 0 * timestep
+dy = 1 * timestep
+dz = 0 * timestep
+else
+dx = 200 * timestep
+dy = 0 * timestep
+dz = 0 * timestep
+end
+
+spaceshipX = spaceship:getAbsCoorX()
+spaceshipY = spaceship:getAbsCoorY()
+spaceshipZ = spaceship:getAbsCoorZ()
+
+spaceship:setAbsCoor(spaceshipX + dx, spaceshipY + dy, spaceshipZ + dz)
+
+if spaceshipY > 15 then
+hoverPosReached = true
+end
+
+end
+
+
+function tick(timestep)
+
+observePlayer()
+mechanicMove(timestep)
+
+if playerReachedTrigger and not spaceshipLaunchReady then
+moveToLaunchSite(timestep)
+end
+
+if spaceshipLaunchReady then
+launchSpaceShip(timestep)
+end
+
+
+return false
+end
Index: data/branches/single_player_map/scripts/prisoner.lua
===================================================================
--- data/branches/single_player_map/scripts/prisoner.lua	(revision 4068)
+++ data/branches/single_player_map/scripts/prisoner.lua	(revision 4070)
@@ -17,5 +17,5 @@
 
 randTime = 0
-height = 29
+height = 34
 
 
@@ -47,16 +47,17 @@
 guardZ = guard:getAbsCoorZ()
 
-
-if dist( playerX,playerY,playerZ,161.76,49,358.87 ) < 60 then
+distance = dist( guardX,guardY,guardZ,playerX, playerY, playerZ)
+
+if dist( playerX,playerY,playerZ,161.76,49,358.87 ) < 100 then
 playerInLock = true
 end
 
 
-if dist( guardX,guardY,guardZ,playerX, playerY, playerZ) > 150 and hangarProgrammed then
+if distance > 250 and hangarRouteProgrammed and not guardStopped then
  prisoner:stop()
  guardStopped = true
 end
 
-if dist( guardX,guardY,guardZ,playerX, playerY, playerZ) < 150 and hangarProgrammed and guardStopped then
+if distance < 250 and hangarRouteProgrammed and guardStopped then
  prisoner:resume()
  guardStopped = false
@@ -129,4 +130,17 @@
 prisoner:walkTo( 153.191757, height, 253.635788)
 prisoner:walkTo( 153.191757, height, 253.635788)
+prisoner:walkTo( 151.838257, height, 257.185974)
+prisoner:walkTo( 153.967865, height, 270.535095)
+prisoner:walkTo( 156.288605, height, 284.582123)
+prisoner:walkTo( 158.034988, height, 300.072937)
+prisoner:walkTo( 158.817184, height, 311.973724)
+prisoner:walkTo( 159.794891, height, 326.848816)
+prisoner:walkTo( 160.789093, height, 342.474060)
+prisoner:walkTo( 161.391815, height, 357.817505)
+prisoner:walkTo( 162.055618, height, 374.715668)
+prisoner:walkTo( 161.595901, height, 389.146759)
+prisoner:walkTo( 160.607056, height, 407.092896)
+prisoner:walkTo( 160.508041, height, 416.996307)
+
    exitProgrammed = true
   end
@@ -147,22 +161,4 @@
 
 if not hangarRouteProgrammed and playerInLock then
-prisoner:walkTo( 153.801224, height, 253.259750)
-prisoner:walkTo( 156.047333, height, 263.016998)
-prisoner:walkTo( 158.592575, height, 275.126709)
-prisoner:walkTo( 160.208252, height, 284.592896)
-prisoner:walkTo( 161.436462, height, 293.934601)
-prisoner:walkTo( 162.154053, height, 299.829407)
-prisoner:walkTo( 162.288696, height, 307.149750)
-prisoner:walkTo( 161.846405, height, 314.288727)
-prisoner:walkTo( 161.481949, height, 320.171295)
-prisoner:walkTo( 161.149612, height, 331.675751)
-prisoner:walkTo( 160.959152, height, 344.682129)
-prisoner:walkTo( 161.191635, height, 359.230835)
-prisoner:walkTo( 161.436386, height, 364.404175)
-prisoner:walkTo( 161.829483, height, 372.712799)
-prisoner:walkTo( 162.251343, height, 382.889465)
-prisoner:walkTo( 162.375793, height, 391.746979)
-prisoner:walkTo( 162.433640, height, 399.580994)
-prisoner:walkTo( 162.492249, height, 407.515991)
 prisoner:walkTo( 162.624390, height, 425.402435)
 prisoner:walkTo( 162.666931, height, 431.160980)
Index: data/branches/single_player_map/scripts/secondguard.lua
===================================================================
--- data/branches/single_player_map/scripts/secondguard.lua	(revision 4068)
+++ data/branches/single_player_map/scripts/secondguard.lua	(revision 4070)
@@ -13,5 +13,5 @@
 guardStopped = false
 
-height = 80
+height = 90
 
 -- Returns the distance between (x1,x2,x3) and (y1,y2,y3)
@@ -42,11 +42,13 @@
 playerZ = Player:getAbsCoorZ()
 
-if dist( guardX,guardY,guardZ,playerX, playerY, playerZ) > 150 and hangarProgrammed then
+distance = dist( guardX,guardY,guardZ,playerX, playerY, playerZ)
+
+if distance > 250 and hangarProgrammed and not guardStopped then
  secondguard:stop()
  guardStopped = true
 end
 
-if dist( guardX,guardY,guardZ,playerX, playerY, playerZ) < 150 and hangarProgrammed and guardStopped then
- --secondguard:continue()
+if distance < 250 and hangarProgrammed and guardStopped then
+ secondguard:resume()
  guardStopped = false
 end
@@ -134,5 +136,4 @@
 
 if not guideProgrammed then
-secondguard:walkTo( -104.757011, height, 171.200729)
 secondguard:walkTo( -100.266739, height, 171.345627)
 secondguard:walkTo( -91.152046, height, 171.639709)
Index: data/branches/single_player_map/scripts/spaceship.lua
===================================================================
--- data/branches/single_player_map/scripts/spaceship.lua	(revision 4068)
+++ 	(revision )
@@ -1,137 +1,0 @@
--- Get objects from orxonox
-thisscript:addObject("Claw", "spaceshipclaw")
-thisscript:addObject("RepairStation", "repair")
-thisscript:addObject("FPSPlayer", "Player")
-thisscript:addObject("SpaceShip", "spaceship")
-thisscript:addObject("SpaceShip", "spaceship2")
-
--- Global Variables
-playerEnteredSpaceShip = false
-playerReachedTrigger = false
-spaceshipOnPad = false
-spaceshipLaunchReady = false
-
-
--- 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
-
-
-
-function observePlayer()
-
-playerEnteredSpaceShip = spaceship:hasPlayer()
-
-playerX = Player:getAbsCoorX()
-playerY = Player:getAbsCoorY()
-playerZ = Player:getAbsCoorZ()
-
-if dist( playerX,playerY,playerZ,167.361526,29,483.163818 ) < 60 then
-playerReachedTrigger = true
-end
-
-end
-
-
-positionReached = false
-spaceShipReleased = false
-function moveToLaunchSite(timestep)
-
-if not positionReached then
-dx = 1 * timestep
-dy = 0 * timestep
-dz = 1* timestep
-end
-
-if not spaceShipReleased and positionReached then 
-dx = 0 * timestep
-dy = -1 * timestep
-dz = 0 * timestep
-end
-
-if positionReached and spaceShipReleased then
-dx = 0 * timestep
-dy = 1 * timestep
-dz = 0 * timestep
-end
-
-
-if spaceshipOnPad then
-
-if not spaceShipReleased then
-spaceshipclaw:playAnimation(1,1)
-spaceShipReleased = true
-end
-
-if clawY > 100 then
-spaceshipLaunchReady = true
-end
-
-end
-
-
--- set new coordinates
-clawX = claw:getAbsCoorX()
-clawY = claw:getAbsCoorY()
-clawZ = claw:getAbsCoorZ()
-
-claw:setAbsCoor(clawX + dx, clawY + dy, clawZ + dz)
-
-
-
-if dist( clawX,clawY,clawZ,167.361526,29,483.163818 ) < 60 then
-positionReached = true
-end
-
-
-if dist( clawX,clawY,clawZ,167.361526,29,483.163818 ) < 60 then
-spaceshipOnPad = true
-end
-
-
-end  --observePlayer
-
-hoverPosReached = false
-function launchSpaceShip(timestep)
-
-if not hoverPosReached then
-dx = 0 * timestep
-dy = 1 * timestep
-dz = 0 * timestep
-else
-dx = 1 * timestep
-dy = 0 * timestep
-dz = 1 * timestep
-end
-
-spaceshipX = spaceship:getAbsCoorX()
-spaceshipY = spaceship:getAbsCoorY()
-spaceshipZ = spaceship:getAbsCoorZ()
-
-spaceship:setAbsCoor(spaceshipX + dx, spaceshipY + dy, spaceshipZ + dz)
-
-if spaceshipY > 50 then
-hoverPosReached = true
-end
-
-end
-
-
-function tick(timestep)
---io.write("Spaceship called \n")
-observePlayer()
-
-if playerReachedTrigger then
---moveToLaunchSite(timestep)
-end
-
-if spaceshipLaunchReady then
---launchSpaceShip(timestep)
-end
-
-
-return false
-end
