Index: data/branches/single_player_map/scripts/falldown.lua
===================================================================
--- data/branches/single_player_map/scripts/falldown.lua	(revision 4051)
+++ data/branches/single_player_map/scripts/falldown.lua	(revision 4056)
@@ -13,5 +13,5 @@
 math.randomseed(os.clock())
 randinit = true
-randTime = 10 * math.random()
+randTime = 8 * math.random()
 end
 end
@@ -26,5 +26,5 @@
 fallingguy:setAbsCoor(thisX, thisY - dy, thisZ)
 
-if thisY < 0 then
+if thisY < -100 then
 eventFinished = true
 end
Index: data/branches/single_player_map/scripts/guard.lua
===================================================================
--- data/branches/single_player_map/scripts/guard.lua	(revision 4051)
+++ data/branches/single_player_map/scripts/guard.lua	(revision 4056)
@@ -127,61 +127,75 @@
 
 if not hangarRouteProgrammed and playerInLock then
-guard:walkTo( 138.422943, height, 504.832733)
-guard:walkTo( 188.685089, height, 509.034851)
-guard:walkTo( 259.451904, height, 515.326111)
-guard:walkTo( 351.655762, height, 519.210571)
-guard:walkTo( 495.821381, height, 517.551392)
-guard:walkTo( 650.267029, height, 516.826843)
-guard:walkTo( 752.277100, height, 506.265289)
-guard:walkTo( 780.652405, height, 397.283752)
-guard:walkTo( 780.212830, height, 317.386017)
-guard:walkTo( 778.699158, height, 241.875305)
-guard:walkTo( 776.305542, height, 120.869957)
-guard:walkTo( 774.626343, height, 26.204597)
-guard:walkTo( 773.148804, height, -30.654911)
-guard:walkTo( 771.164978, height, -106.990250)
-guard:walkTo( 756.719971, height, -197.656296)
-guard:walkTo( 730.690796, height, -269.808075)
-guard:walkTo( 702.250854, height, -341.732147)
-guard:walkTo( 681.786011, height, -393.487030)
-guard:walkTo( 664.005981, height, -441.609131)
-guard:walkTo( 655.612671, height, -523.194153)
-guard:walkTo( 664.289978, height, -585.003540)
-guard:walkTo( 670.221069, height, -645.366333)
-guard:walkTo( 674.347290, height, -704.953674)
-guard:walkTo( 677.495605, height, -750.421082)
-guard:walkTo( 680.699280, height, -796.687073)
-guard:walkTo( 686.407043, height, -879.117859)
-guard:walkTo( 692.573364, height, -952.031555)
-guard:walkTo( 701.940552, height, -1025.037964)
-guard:walkTo( 710.218628, height, -1086.598389)
-guard:walkTo( 719.834900, height, -1142.248779)
-guard:walkTo( 731.087158, height, -1198.201538)
-guard:walkTo( 745.157715, height, -1258.461182)
-guard:walkTo( 753.189331, height, -1290.539551)
-guard:walkTo( 763.940369, height, -1347.249268)
-guard:walkTo( 768.509949, height, -1377.040039)
-guard:walkTo( 770.845215, height, -1408.751953)
-guard:walkTo( 770.785583, height, -1435.573608)
-guard:walkTo( 765.031799, height, -1462.657593)
-guard:walkTo( 753.982727, height, -1483.425415)
-guard:walkTo( 735.194580, height, -1500.978394)
-guard:walkTo( 707.312500, height, -1514.814575)
-guard:walkTo( 672.638550, height, -1522.803589)
-guard:walkTo( 560.158936, height, -1530.277344)
-guard:walkTo( 500.429626, height, -1532.241577)
-guard:walkTo( 371.231262, height, -1535.953613)
-guard:walkTo( 204.211609, height, -1539.026611)
-guard:walkTo( 104.032593, height, -1546.350220)
-guard:walkTo( 45.058315, height, -1550.720337)
-guard:walkTo( 1.504358, height, -1574.713745)
-guard:walkTo( -20.050890, height, -1627.849854)
-guard:walkTo( -28.036245, height, -1674.240479)
-guard:walkTo( -29.157598, height, -1702.924316)
-guard:walkTo( -29.760004, height, -1730.014526)
-guard:walkTo( -29.538343, height, -1759.887329)
-guard:walkTo( -21.584003, height, -1790.162842)
-guard:walkTo( -8.572795, height, -1823.067871)
-guard:walkTo( 13.254844, height, -1861.705688)
+guard:walkTo( 120.981117, height, 503.008972)
+guard:walkTo( 133.354797, height, 504.669128)
+guard:walkTo( 147.490158, height, 507.034393)
+guard:walkTo( 157.640610, height, 508.901001)
+guard:walkTo( 168.830688, height, 510.958710)
+guard:walkTo( 185.020630, height, 512.736206)
+guard:walkTo( 201.232452, height, 513.413818)
+guard:walkTo( 265.666138, height, 513.736023)
+guard:walkTo( 362.377960, height, 515.575806)
+guard:walkTo( 426.176392, height, 515.666748)
+guard:walkTo( 500.031677, height, 515.197266)
+guard:walkTo( 551.294250, height, 514.430237)
+guard:walkTo( 604.974731, height, 515.106323)
+guard:walkTo( 651.117920, height, 516.026550)
+guard:walkTo( 664.581909, height, 516.295227)
+guard:walkTo( 683.122803, height, 516.665100)
+guard:walkTo( 694.547485, height, 516.892944)
+guard:walkTo( 704.408569, height, 517.089539)
+guard:walkTo( 714.413208, height, 517.289185)
+guard:walkTo( 739.045288, height, 515.581970)
+guard:walkTo( 763.904541, height, 497.281738)
+guard:walkTo( 767.672791, height, 481.974457)
+guard:walkTo( 769.436951, height, 468.704559)
+guard:walkTo( 770.490967, height, 453.283386)
+guard:walkTo( 771.185303, height, 435.960114)
+guard:walkTo( 771.952820, height, 379.502045)
+guard:walkTo( 771.938293, height, 310.049042)
+guard:walkTo( 772.514526, height, 231.579498)
+guard:walkTo( 773.601074, height, 135.177933)
+guard:walkTo( 773.790771, height, 50.675163)
+guard:walkTo( 773.316162, height, -36.961666)
+guard:walkTo( 772.885986, height, -116.407944)
+guard:walkTo( 772.841309, height, -124.651726)
+guard:walkTo( 772.491333, height, -137.742279)
+guard:walkTo( 770.644775, height, -153.245926)
+guard:walkTo( 768.774414, height, -163.767120)
+guard:walkTo( 766.336426, height, -174.224228)
+guard:walkTo( 762.794128, height, -187.312271)
+guard:walkTo( 733.548279, height, -274.004791)
+guard:walkTo( 713.113647, height, -329.657959)
+guard:walkTo( 694.801819, height, -379.530243)
+guard:walkTo( 681.276062, height, -422.047028)
+guard:walkTo( 672.579102, height, -458.540985)
+guard:walkTo( 670.843384, height, -465.824615)
+guard:walkTo( 669.948364, height, -480.910645)
+guard:walkTo( 669.361511, height, -493.648529)
+guard:walkTo( 669.686829, height, -501.598572)
+guard:walkTo( 674.055664, height, -582.077637)
+guard:walkTo( 676.046387, height, -630.403809)
+guard:walkTo( 677.839050, height, -674.209534)
+guard:walkTo( 680.754944, height, -765.965515)
+guard:walkTo( 681.034180, height, -803.351135)
+guard:walkTo( 680.088806, height, -844.069031)
+guard:walkTo( 677.801514, height, -899.952148)
+guard:walkTo( 675.205627, height, -950.496460)
+guard:walkTo( 672.847778, height, -996.413574)
+guard:walkTo( 676.204041, height, -1043.556274)
+guard:walkTo( 691.304382, height, -1088.596558)
+guard:walkTo( 705.101318, height, -1128.320312)
+guard:walkTo( 720.476013, height, -1164.364380)
+guard:walkTo( 729.216797, height, -1183.948364)
+guard:walkTo( 740.145203, height, -1212.598267)
+guard:walkTo( 746.547363, height, -1238.340576)
+guard:walkTo( 756.866211, height, -1280.605347)
+guard:walkTo( 763.380554, height, -1314.622314)
+guard:walkTo( 768.731506, height, -1347.977539)
+guard:walkTo( 772.446655, height, -1381.641479)
+guard:walkTo( 772.721069, height, -1421.184937)
+guard:walkTo( 772.414734, height, -1457.349121)
+guard:walkTo( 772.803284, height, -1489.560913)
+
 hangarRouteProgrammed  = true
 end
Index: data/branches/single_player_map/scripts/prisoner.lua
===================================================================
--- data/branches/single_player_map/scripts/prisoner.lua	(revision 4051)
+++ data/branches/single_player_map/scripts/prisoner.lua	(revision 4056)
@@ -130,121 +130,106 @@
 
 if not hangarRouteProgrammed and playerInLock then
-prisoner:walkTo( 149.255554, height, 253.358582)
-prisoner:walkTo( 155.679886, height, 274.126282)
-prisoner:walkTo( 157.556641, height, 285.543640)
-prisoner:walkTo( 159.016068, height, 294.552338)
-prisoner:walkTo( 160.234924, height, 303.494812)
-prisoner:walkTo( 161.399475, height, 313.532013)
-prisoner:walkTo( 162.218994, height, 323.290924)
-prisoner:walkTo( 162.030823, height, 335.226715)
-prisoner:walkTo( 161.351410, height, 378.328094)
-prisoner:walkTo( 161.183487, height, 388.983093)
-prisoner:walkTo( 160.590225, height, 426.615540)
-prisoner:walkTo( 160.313049, height, 444.198425)
-prisoner:walkTo( 160.410721, height, 454.192413)
-prisoner:walkTo( 161.796692, height, 465.085663)
-prisoner:walkTo( 163.096069, height, 474.038086)
-prisoner:walkTo( 165.596329, height, 485.415924)
-prisoner:walkTo( 167.407303, height, 493.229279)
-prisoner:walkTo( 169.595749, height, 499.048309)
-prisoner:walkTo( 173.485214, height, 504.383026)
-prisoner:walkTo( 182.131546, height, 510.774567)
-prisoner:walkTo( 187.788422, height, 512.870789)
-prisoner:walkTo( 196.524994, height, 514.751892)
-prisoner:walkTo( 205.403473, height, 515.840271)
-prisoner:walkTo( 205.403473, height, 515.840271)
-prisoner:walkTo( 220.813049, height, 515.886658)
-prisoner:walkTo( 392.501221, height, 516.405579)
-prisoner:walkTo( 441.405975, height, 516.502502)
-prisoner:walkTo( 513.379517, height, 515.572266)
-prisoner:walkTo( 586.638611, height, 514.625244)
-prisoner:walkTo( 651.319214, height, 513.789246)
-prisoner:walkTo( 680.890869, height, 513.406982)
-prisoner:walkTo( 701.035828, height, 512.568359)
-prisoner:walkTo( 716.025879, height, 510.741150)
-prisoner:walkTo( 723.756042, height, 509.009583)
-prisoner:walkTo( 733.522095, height, 504.761475)
-prisoner:walkTo( 738.782104, height, 501.529327)
-prisoner:walkTo( 744.840637, height, 496.154846)
-prisoner:walkTo( 750.059875, height, 487.892670)
-prisoner:walkTo( 753.419373, height, 477.053894)
-prisoner:walkTo( 754.661743, height, 470.759735)
-prisoner:walkTo( 765.877319, height, 397.575897)
-prisoner:walkTo( 768.522522, height, 360.462250)
-prisoner:walkTo( 769.531250, height, 326.195801)
-prisoner:walkTo( 770.420532, height, 286.531830)
-prisoner:walkTo( 769.840393, height, 238.220535)
-prisoner:walkTo( 771.094543, height, 172.138474)
-prisoner:walkTo( 772.765137, height, 94.427673)
-prisoner:walkTo( 771.779175, height, 62.094421)
-prisoner:walkTo( 771.069336, height, 35.182930)
-prisoner:walkTo( 769.679199, height, 4.657598)
-prisoner:walkTo( 768.049377, height, -23.208313)
-prisoner:walkTo( 766.691711, height, -54.609066)
-prisoner:walkTo( 765.022156, height, -85.732277)
-prisoner:walkTo( 763.538635, height, -110.417847)
-prisoner:walkTo( 761.547485, height, -143.547577)
-prisoner:walkTo( 760.982483, height, -147.543091)
-prisoner:walkTo( 756.619934, height, -163.474457)
-prisoner:walkTo( 751.651611, height, -180.926727)
-prisoner:walkTo( 739.842041, height, -216.826782)
-prisoner:walkTo( 716.715149, height, -294.878693)
-prisoner:walkTo( 698.400146, height, -365.404541)
-prisoner:walkTo( 692.199890, height, -396.395386)
-prisoner:walkTo( 685.157593, height, -437.489929)
-prisoner:walkTo( 678.175537, height, -475.680817)
-prisoner:walkTo( 674.907837, height, -505.428314)
-prisoner:walkTo( 674.588501, height, -531.477478)
-prisoner:walkTo( 674.703308, height, -550.883789)
-prisoner:walkTo( 675.315063, height, -567.361206)
-prisoner:walkTo( 676.178345, height, -583.178772)
-prisoner:walkTo( 678.579407, height, -638.655518)
-prisoner:walkTo( 689.508118, height, -884.296448)
-prisoner:walkTo( 690.749084, height, -917.750366)
-prisoner:walkTo( 691.617676, height, -933.357056)
-prisoner:walkTo( 696.260742, height, -972.685669)
-prisoner:walkTo( 698.526550, height, -990.077209)
-prisoner:walkTo( 705.576599, height, -1033.587646)
-prisoner:walkTo( 719.388611, height, -1111.123657)
-prisoner:walkTo( 724.847229, height, -1137.902832)
-prisoner:walkTo( 729.118652, height, -1159.426514)
-prisoner:walkTo( 733.152161, height, -1179.577393)
-prisoner:walkTo( 737.474365, height, -1200.200684)
-prisoner:walkTo( 740.808777, height, -1216.996216)
-prisoner:walkTo( 748.261108, height, -1252.447021)
-prisoner:walkTo( 748.648682, height, -1254.182983)
-prisoner:walkTo( 752.690430, height, -1272.386719)
-prisoner:walkTo( 755.726562, height, -1286.795532)
-prisoner:walkTo( 758.134705, height, -1302.620117)
-prisoner:walkTo( 759.900879, height, -1317.258911)
-prisoner:walkTo( 760.405212, height, -1357.575195)
-prisoner:walkTo( 760.203979, height, -1396.744385)
-prisoner:walkTo( 759.262085, height, -1433.674316)
-prisoner:walkTo( 758.916016, height, -1447.247437)
-prisoner:walkTo( 757.844910, height, -1474.596558)
-prisoner:walkTo( 756.331238, height, -1484.150269)
-prisoner:walkTo( 754.152283, height, -1491.574585)
-prisoner:walkTo( 750.549561, height, -1497.667236)
-prisoner:walkTo( 741.115356, height, -1509.581177)
-prisoner:walkTo( 733.292236, height, -1516.592407)
-prisoner:walkTo( 724.755798, height, -1522.380615)
-prisoner:walkTo( 712.188721, height, -1528.557495)
-prisoner:walkTo( 707.279907, height, -1530.261841)
-prisoner:walkTo( 698.749390, height, -1532.002563)
-prisoner:walkTo( 681.891785, height, -1532.067871)
-prisoner:walkTo( 625.072388, height, -1531.572266)
-prisoner:walkTo( 501.572601, height, -1533.919922)
-prisoner:walkTo( 237.189667, height, -1538.984985)
-prisoner:walkTo( 146.071304, height, -1540.965820)
-prisoner:walkTo( 88.186996, height, -1549.110962)
-prisoner:walkTo( 85.715096, height, -1549.537842)
-prisoner:walkTo( 66.997787, height, -1552.770264)
-prisoner:walkTo( 52.632504, height, -1555.359009)
-prisoner:walkTo( 38.350941, height, -1560.845459)
-prisoner:walkTo( 26.315248, height, -1568.211060)
-prisoner:walkTo( 15.210221, height, -1580.474121)
-prisoner:walkTo( 6.527347, height, -1594.483398)
-prisoner:walkTo( 3.175952, height, -1610.220093)
-
+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)
+prisoner:walkTo( 162.708481, height, 436.786591)
+prisoner:walkTo( 162.789124, height, 447.704620)
+prisoner:walkTo( 162.863098, height, 457.719055)
+prisoner:walkTo( 162.916428, height, 464.939545)
+prisoner:walkTo( 162.975830, height, 472.982452)
+prisoner:walkTo( 163.028259, height, 480.078857)
+prisoner:walkTo( 164.319611, height, 491.340607)
+prisoner:walkTo( 168.597382, height, 497.577728)
+prisoner:walkTo( 186.090088, height, 506.772766)
+prisoner:walkTo( 205.179825, height, 510.814911)
+prisoner:walkTo( 210.280609, height, 511.704041)
+prisoner:walkTo( 216.508865, height, 512.518982)
+prisoner:walkTo( 224.820663, height, 513.199585)
+prisoner:walkTo( 233.553589, height, 513.803711)
+prisoner:walkTo( 275.363922, height, 514.931763)
+prisoner:walkTo( 325.490265, height, 515.918945)
+prisoner:walkTo( 365.214355, height, 516.691833)
+prisoner:walkTo( 403.109619, height, 515.911804)
+prisoner:walkTo( 464.696991, height, 514.644348)
+prisoner:walkTo( 524.817627, height, 513.407104)
+prisoner:walkTo( 565.836670, height, 512.870239)
+prisoner:walkTo( 608.300232, height, 512.717957)
+prisoner:walkTo( 634.151794, height, 512.625183)
+prisoner:walkTo( 656.115234, height, 512.546570)
+prisoner:walkTo( 679.420166, height, 512.462708)
+prisoner:walkTo( 696.694702, height, 512.400635)
+prisoner:walkTo( 712.425781, height, 512.344299)
+prisoner:walkTo( 720.998474, height, 512.273193)
+prisoner:walkTo( 733.098389, height, 512.028137)
+prisoner:walkTo( 755.905273, height, 493.950714)
+prisoner:walkTo( 758.626648, height, 472.345520)
+prisoner:walkTo( 758.944458, height, 464.883545)
+prisoner:walkTo( 760.426208, height, 404.809967)
+prisoner:walkTo( 761.147827, height, 370.829987)
+prisoner:walkTo( 761.848511, height, 337.836395)
+prisoner:walkTo( 762.567932, height, 303.964020)
+prisoner:walkTo( 763.293335, height, 269.808380)
+prisoner:walkTo( 764.076294, height, 232.951477)
+prisoner:walkTo( 765.114441, height, 184.070221)
+prisoner:walkTo( 765.890076, height, 147.545258)
+prisoner:walkTo( 766.753296, height, 106.902954)
+prisoner:walkTo( 767.115967, height, 76.410255)
+prisoner:walkTo( 766.648621, height, 39.034630)
+prisoner:walkTo( 766.501282, height, 3.641552)
+prisoner:walkTo( 766.630615, height, -25.998037)
+prisoner:walkTo( 766.773560, height, -58.753052)
+prisoner:walkTo( 766.897766, height, -87.277809)
+prisoner:walkTo( 766.534546, height, -107.109718)
+prisoner:walkTo( 764.282104, height, -135.666809)
+prisoner:walkTo( 761.187439, height, -155.214981)
+prisoner:walkTo( 756.769043, height, -180.015106)
+prisoner:walkTo( 748.603821, height, -224.832336)
+prisoner:walkTo( 741.901978, height, -259.153870)
+prisoner:walkTo( 735.091492, height, -293.963196)
+prisoner:walkTo( 726.579651, height, -329.477051)
+prisoner:walkTo( 716.802002, height, -367.452911)
+prisoner:walkTo( 706.963806, height, -402.515228)
+prisoner:walkTo( 697.003357, height, -438.013824)
+prisoner:walkTo( 688.261230, height, -471.035400)
+prisoner:walkTo( 683.497986, height, -504.091461)
+prisoner:walkTo( 681.250732, height, -528.006287)
+prisoner:walkTo( 679.264771, height, -554.841125)
+prisoner:walkTo( 678.647949, height, -582.533508)
+prisoner:walkTo( 678.731018, height, -612.342407)
+prisoner:walkTo( 678.873230, height, -663.699585)
+prisoner:walkTo( 683.213135, height, -824.669922)
+prisoner:walkTo( 691.796326, height, -993.215332)
+prisoner:walkTo( 696.237244, height, -1045.909302)
+prisoner:walkTo( 702.897461, height, -1072.645020)
+prisoner:walkTo( 710.501160, height, -1095.735107)
+prisoner:walkTo( 715.637573, height, -1111.740845)
+prisoner:walkTo( 725.408020, height, -1144.843506)
+prisoner:walkTo( 747.384888, height, -1223.670410)
+prisoner:walkTo( 751.330872, height, -1238.939941)
+prisoner:walkTo( 757.179504, height, -1262.104980)
+prisoner:walkTo( 761.473145, height, -1287.161133)
+prisoner:walkTo( 764.180298, height, -1311.035767)
+prisoner:walkTo( 765.995178, height, -1339.139648)
+prisoner:walkTo( 767.811340, height, -1381.138428)
+prisoner:walkTo( 769.017273, height, -1409.277344)
+prisoner:walkTo( 769.463684, height, -1430.375244)
+prisoner:walkTo( 769.351685, height, -1451.503418)
 hangarRouteProgrammed = true
 end
Index: data/branches/single_player_map/scripts/secondguard.lua
===================================================================
--- data/branches/single_player_map/scripts/secondguard.lua	(revision 4051)
+++ data/branches/single_player_map/scripts/secondguard.lua	(revision 4056)
@@ -162,128 +162,92 @@
 
 if not hangarProgrammed and prisonerReachedLock then
-secondguard:walkTo( 194.153641, height, 244.749863)
-secondguard:walkTo( 185.976517, height, 243.876404)
-secondguard:walkTo( 179.645737, height, 243.505066)
-secondguard:walkTo( 169.583008, height, 244.959457)
-secondguard:walkTo( 161.454269, height, 249.422363)
-secondguard:walkTo( 158.488998, height, 260.951874)
-secondguard:walkTo( 158.228958, height, 272.121582)
-secondguard:walkTo( 158.326004, height, 288.892853)
-secondguard:walkTo( 158.389069, height, 299.792603)
-secondguard:walkTo( 158.437561, height, 308.174896)
-secondguard:walkTo( 158.479034, height, 315.341095)
-secondguard:walkTo( 158.542801, height, 326.362518)
-secondguard:walkTo( 158.621414, height, 339.950256)
-secondguard:walkTo( 158.664566, height, 347.408417)
-secondguard:walkTo( 158.737900, height, 360.080902)
-secondguard:walkTo( 158.795013, height, 369.950531)
-secondguard:walkTo( 158.857086, height, 380.676056)
-secondguard:walkTo( 158.935440, height, 394.219177)
-secondguard:walkTo( 158.984039, height, 402.618896)
-secondguard:walkTo( 159.035522, height, 411.518219)
-secondguard:walkTo( 159.089432, height, 420.837036)
-secondguard:walkTo( 159.143021, height, 430.104523)
-secondguard:walkTo( 159.203644, height, 440.579224)
-secondguard:walkTo( 159.257263, height, 449.841522)
-secondguard:walkTo( 159.304810, height, 458.057617)
-secondguard:walkTo( 159.351440, height, 466.113068)
-secondguard:walkTo( 160.060013, height, 482.411865)
-secondguard:walkTo( 161.352600, height, 488.302185)
-secondguard:walkTo( 174.254333, height, 503.439209)
-secondguard:walkTo( 181.668213, height, 506.381195)
-secondguard:walkTo( 189.177277, height, 508.729156)
-secondguard:walkTo( 213.465332, height, 512.184326)
-secondguard:walkTo( 223.635010, height, 512.920715)
-secondguard:walkTo( 233.668503, height, 513.374512)
-secondguard:walkTo( 448.702118, height, 512.187744)
-secondguard:walkTo( 477.701050, height, 511.587463)
-secondguard:walkTo( 525.645752, height, 511.139526)
-secondguard:walkTo( 559.871216, height, 510.819763)
-secondguard:walkTo( 596.801941, height, 510.632080)
-secondguard:walkTo( 640.160767, height, 510.906891)
-secondguard:walkTo( 684.745239, height, 510.429138)
-secondguard:walkTo( 706.457214, height, 508.596039)
-secondguard:walkTo( 718.750916, height, 507.558044)
-secondguard:walkTo( 728.147827, height, 506.649780)
-secondguard:walkTo( 743.581970, height, 502.185822)
-secondguard:walkTo( 752.977234, height, 495.788635)
-secondguard:walkTo( 759.201721, height, 483.407104)
-secondguard:walkTo( 761.196167, height, 461.130798)
-secondguard:walkTo( 762.335449, height, 398.166901)
-secondguard:walkTo( 762.908691, height, 366.482208)
-secondguard:walkTo( 763.506409, height, 333.456848)
-secondguard:walkTo( 764.330750, height, 287.894409)
-secondguard:walkTo( 767.909790, height, 194.910492)
-secondguard:walkTo( 770.649231, height, 122.865265)
-secondguard:walkTo( 770.102112, height, 44.244534)
-secondguard:walkTo( 767.269775, height, -37.871273)
-secondguard:walkTo( 763.989197, height, -132.996460)
-secondguard:walkTo( 755.274231, height, -217.520859)
-secondguard:walkTo( 739.636230, height, -307.869354)
-secondguard:walkTo( 722.792725, height, -390.075226)
-secondguard:walkTo( 702.582275, height, -475.155273)
-secondguard:walkTo( 687.325012, height, -551.699036)
-secondguard:walkTo( 681.873169, height, -628.924316)
-secondguard:walkTo( 679.997437, height, -708.013794)
-secondguard:walkTo( 681.080933, height, -772.108887)
-secondguard:walkTo( 681.686035, height, -845.449524)
-secondguard:walkTo( 682.188538, height, -906.434998)
-secondguard:walkTo( 682.669800, height, -964.887085)
-secondguard:walkTo( 684.829895, height, -1023.870117)
-secondguard:walkTo( 690.728516, height, -1069.400146)
-secondguard:walkTo( 695.965027, height, -1097.353149)
-secondguard:walkTo( 701.128540, height, -1118.496216)
-secondguard:walkTo( 708.865234, height, -1144.444214)
-secondguard:walkTo( 724.753845, height, -1192.741699)
-secondguard:walkTo( 737.665771, height, -1230.398560)
-secondguard:walkTo( 741.520081, height, -1241.704712)
-secondguard:walkTo( 756.537842, height, -1287.260376)
-secondguard:walkTo( 764.046631, height, -1310.927002)
-secondguard:walkTo( 769.402771, height, -1342.806152)
-secondguard:walkTo( 772.158691, height, -1363.218750)
-secondguard:walkTo( 772.599426, height, -1374.571899)
-secondguard:walkTo( 771.977844, height, -1390.778320)
-secondguard:walkTo( 771.576355, height, -1401.246826)
-secondguard:walkTo( 770.982666, height, -1423.905273)
-secondguard:walkTo( 770.952637, height, -1429.344360)
-secondguard:walkTo( 770.912476, height, -1436.589966)
-secondguard:walkTo( 770.880249, height, -1442.399536)
-secondguard:walkTo( 770.847107, height, -1448.385376)
-secondguard:walkTo( 770.785339, height, -1454.349365)
-secondguard:walkTo( 768.858459, height, -1464.382080)
-secondguard:walkTo( 767.639709, height, -1469.028809)
-secondguard:walkTo( 765.099487, height, -1476.370605)
-secondguard:walkTo( 762.003601, height, -1484.767456)
-secondguard:walkTo( 758.787231, height, -1492.394287)
-secondguard:walkTo( 755.135986, height, -1496.482788)
-secondguard:walkTo( 752.631165, height, -1498.550049)
-secondguard:walkTo( 746.021912, height, -1502.547485)
-secondguard:walkTo( 739.376099, height, -1505.427734)
-secondguard:walkTo( 731.429199, height, -1507.691162)
-secondguard:walkTo( 719.202393, height, -1510.812622)
-secondguard:walkTo( 716.329712, height, -1511.546021)
-secondguard:walkTo( 711.301514, height, -1512.674438)
-secondguard:walkTo( 702.414124, height, -1514.126099)
-secondguard:walkTo( 695.724304, height, -1515.173218)
-secondguard:walkTo( 576.522278, height, -1521.146362)
-secondguard:walkTo( 542.552246, height, -1522.204712)
-secondguard:walkTo( 499.907288, height, -1524.441772)
-secondguard:walkTo( 461.101288, height, -1525.987915)
-secondguard:walkTo( 417.154602, height, -1526.579102)
-secondguard:walkTo( 367.752686, height, -1527.168091)
-secondguard:walkTo( 322.209106, height, -1527.709473)
-secondguard:walkTo( 273.998047, height, -1528.283447)
-secondguard:walkTo( 234.330612, height, -1528.756348)
-secondguard:walkTo( 188.730209, height, -1529.299438)
-secondguard:walkTo( 140.078659, height, -1529.880249)
-secondguard:walkTo( 105.882103, height, -1530.287109)
-secondguard:walkTo( 71.860947, height, -1532.856079)
-secondguard:walkTo( 39.777569, height, -1541.485596)
-secondguard:walkTo( 13.919314, height, -1565.188110)
-secondguard:walkTo( -0.632493, height, -1604.602783)
-secondguard:walkTo( -2.103141, height, -1639.236694)
-secondguard:walkTo( 0.498238, height, -1674.846558)
-secondguard:walkTo( 2.861493, height, -1705.131958)
-
+secondguard:walkTo( 198.984589, height, 243.144440)
+secondguard:walkTo( 188.270493, height, 242.143143)
+secondguard:walkTo( 185.177658, height, 241.854080)
+secondguard:walkTo( 166.990906, height, 249.598251)
+secondguard:walkTo( 160.702652, height, 251.610641)
+secondguard:walkTo( 157.542480, height, 260.691101)
+secondguard:walkTo( 158.720688, height, 285.526489)
+secondguard:walkTo( 158.819519, height, 295.229065)
+secondguard:walkTo( 158.941727, height, 307.225800)
+secondguard:walkTo( 159.095718, height, 322.344818)
+secondguard:walkTo( 159.248337, height, 332.535400)
+secondguard:walkTo( 159.600082, height, 343.361420)
+secondguard:walkTo( 160.006805, height, 355.880432)
+secondguard:walkTo( 161.582108, height, 441.998688)
+secondguard:walkTo( 161.650970, height, 447.407074)
+secondguard:walkTo( 161.755173, height, 455.592651)
+secondguard:walkTo( 162.311462, height, 471.569611)
+secondguard:walkTo( 164.966690, height, 482.971222)
+secondguard:walkTo( 168.578796, height, 492.256317)
+secondguard:walkTo( 204.727936, height, 507.833527)
+secondguard:walkTo( 212.031540, height, 508.235596)
+secondguard:walkTo( 226.355484, height, 509.024170)
+secondguard:walkTo( 441.672638, height, 512.266846)
+secondguard:walkTo( 509.640350, height, 512.965515)
+secondguard:walkTo( 576.208435, height, 512.614258)
+secondguard:walkTo( 638.251770, height, 512.247986)
+secondguard:walkTo( 667.897888, height, 512.072693)
+secondguard:walkTo( 683.874451, height, 511.978363)
+secondguard:walkTo( 693.377319, height, 511.922302)
+secondguard:walkTo( 700.632446, height, 511.837494)
+secondguard:walkTo( 703.564148, height, 511.713562)
+secondguard:walkTo( 710.958313, height, 510.896362)
+secondguard:walkTo( 724.824585, height, 502.160461)
+secondguard:walkTo( 728.256226, height, 497.817627)
+secondguard:walkTo( 734.361206, height, 484.795380)
+secondguard:walkTo( 737.112488, height, 478.616089)
+secondguard:walkTo( 740.696350, height, 470.796539)
+secondguard:walkTo( 743.915833, height, 462.804688)
+secondguard:walkTo( 750.241150, height, 438.829529)
+secondguard:walkTo( 751.186340, height, 432.598022)
+secondguard:walkTo( 751.977051, height, 427.385315)
+secondguard:walkTo( 756.962708, height, 379.979919)
+secondguard:walkTo( 759.845581, height, 337.377167)
+secondguard:walkTo( 762.304626, height, 288.355713)
+secondguard:walkTo( 764.125244, height, 248.893723)
+secondguard:walkTo( 766.738892, height, 164.214142)
+secondguard:walkTo( 767.405884, height, 116.896973)
+secondguard:walkTo( 767.289917, height, 68.270233)
+secondguard:walkTo( 767.680176, height, 31.480713)
+secondguard:walkTo( 767.315247, height, -46.728809)
+secondguard:walkTo( 767.634888, height, -85.314407)
+secondguard:walkTo( 767.905823, height, -112.270973)
+secondguard:walkTo( 767.716003, height, -134.956741)
+secondguard:walkTo( 765.699829, height, -159.042664)
+secondguard:walkTo( 762.026978, height, -178.211639)
+secondguard:walkTo( 751.512512, height, -219.904297)
+secondguard:walkTo( 735.898499, height, -277.525970)
+secondguard:walkTo( 722.206055, height, -329.591888)
+secondguard:walkTo( 709.354858, height, -383.514618)
+secondguard:walkTo( 697.115295, height, -434.870483)
+secondguard:walkTo( 685.142822, height, -485.212402)
+secondguard:walkTo( 681.659058, height, -532.429504)
+secondguard:walkTo( 679.999634, height, -581.595886)
+secondguard:walkTo( 678.678101, height, -632.772156)
+secondguard:walkTo( 678.162842, height, -682.753113)
+secondguard:walkTo( 678.398376, height, -731.779053)
+secondguard:walkTo( 679.124756, height, -782.160034)
+secondguard:walkTo( 680.050781, height, -831.132141)
+secondguard:walkTo( 678.395569, height, -877.242920)
+secondguard:walkTo( 676.737793, height, -919.301819)
+secondguard:walkTo( 676.191956, height, -962.443909)
+secondguard:walkTo( 676.493774, height, -994.707703)
+secondguard:walkTo( 677.446716, height, -1018.486389)
+secondguard:walkTo( 681.286865, height, -1042.623901)
+secondguard:walkTo( 685.302917, height, -1060.096436)
+secondguard:walkTo( 692.212036, height, -1083.229370)
+secondguard:walkTo( 698.947937, height, -1103.496826)
+secondguard:walkTo( 710.392944, height, -1137.932617)
+secondguard:walkTo( 719.685608, height, -1164.374634)
+secondguard:walkTo( 728.124512, height, -1186.812622)
+secondguard:walkTo( 746.270569, height, -1235.059082)
+secondguard:walkTo( 754.436340, height, -1259.201660)
+secondguard:walkTo( 760.588013, height, -1286.830933)
+secondguard:walkTo( 765.026733, height, -1329.641113)
+secondguard:walkTo( 765.849609, height, -1362.461670)
+secondguard:walkTo( 765.842346, height, -1398.791016)
+secondguard:walkTo( 765.749695, height, -1425.336304)
+secondguard:walkTo( 765.650024, height, -1454.007935)
 hangarProgrammed = true
 end
Index: data/branches/single_player_map/scripts/spaceship.lua
===================================================================
--- data/branches/single_player_map/scripts/spaceship.lua	(revision 4051)
+++ data/branches/single_player_map/scripts/spaceship.lua	(revision 4056)
@@ -4,7 +4,134 @@
 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
