Index: /data/trunk/scripts/ambush_at_uranus/falldown.lua
===================================================================
--- /data/trunk/scripts/ambush_at_uranus/falldown.lua	(revision 4448)
+++ /data/trunk/scripts/ambush_at_uranus/falldown.lua	(revision 4448)
@@ -0,0 +1,123 @@
+-- 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("GenericNPC", "fallingguy")
+thisscript:addObject("FPSPlayer", "Player")
+thisscript:addObject("GenericNPC","fleemechanic")
+
+dy = 0
+randTime = 0
+eventFinished = false
+randinit = false
+mtheight = -10
+
+function RandTime()
+
+if not randinit then
+math.randomseed(os.clock())
+randinit = true
+randTime = 8 * math.random()
+end
+end
+
+
+function fallDown(timestep)
+dy = dy + timestep
+thisX = fallingguy:getAbsCoorX()
+thisY = fallingguy:getAbsCoorY()
+thisZ = fallingguy:getAbsCoorZ()
+
+fallingguy:setAbsCoor(thisX, thisY - dy, thisZ)
+
+if thisY < -100 then
+eventFinished = true
+end
+
+end
+
+
+
+fleeprogrammed = false
+function flee(timestep)
+if not fleeprogrammed then
+fleemechanic:runTo( 735.658142, mtheight, -1525.291870)
+fleemechanic:runTo( 746.021912, mtheight, -1416.895508)
+fleemechanic:runTo( 746.021912, mtheight, -1415.689819)
+fleemechanic:runTo( 745.840454, mtheight, -1314.824585)
+fleemechanic:runTo( 745.840454, mtheight, -1313.533691)
+fleemechanic:runTo( 745.840454, mtheight, -1312.239258)
+fleemechanic:runTo( 745.840454, mtheight, -1310.942749)
+fleemechanic:runTo( 686.141907, mtheight, -1174.515015)
+fleemechanic:runTo( 685.479614, mtheight, -1173.372925)
+fleemechanic:runTo( 684.815857, mtheight, -1172.228271)
+fleemechanic:runTo( 630.430725, mtheight, -1072.972168)
+fleemechanic:runTo( 629.804199, mtheight, -1071.821777)
+fleemechanic:runTo( 629.174438, mtheight, -1070.665527)
+fleemechanic:runTo( 628.542786, mtheight, -1069.505859)
+fleemechanic:runTo( 627.905334, mtheight, -1068.335449)
+fleemechanic:runTo( 582.125610, mtheight, -969.282288)
+fleemechanic:runTo( 581.719971, mtheight, -968.030273)
+fleemechanic:runTo( 581.312866, mtheight, -966.773621)
+fleemechanic:runTo( 580.904602, mtheight, -965.513550)
+fleemechanic:runTo( 580.492493, mtheight, -964.241638)
+fleemechanic:runTo( 555.827942, mtheight, -873.071045)
+fleemechanic:runTo( 555.657410, mtheight, -871.761780)
+fleemechanic:runTo( 555.485962, mtheight, -870.445679)
+fleemechanic:runTo( 555.314087, mtheight, -869.126160)
+fleemechanic:runTo( 555.141418, mtheight, -867.800598)
+fleemechanic:runTo( 554.968262, mtheight, -866.471069)
+fleemechanic:runTo( 554.794922, mtheight, -865.140076)
+fleemechanic:runTo( 547.754639, mtheight, -767.221680)
+fleemechanic:runTo( 547.722961, mtheight, -765.892944)
+fleemechanic:runTo( 547.691223, mtheight, -764.562683)
+fleemechanic:runTo( 547.659180, mtheight, -763.219604)
+fleemechanic:runTo( 548.969849, mtheight, -649.171387)
+fleemechanic:runTo( 549.043274, mtheight, -647.850952)
+fleemechanic:runTo( 549.117126, mtheight, -646.523193)
+fleemechanic:runTo( 549.191101, mtheight, -645.193542)
+fleemechanic:runTo( 549.265137, mtheight, -643.862305)
+fleemechanic:runTo( 568.188416, mtheight, -510.499756)
+fleemechanic:runTo( 568.575439, mtheight, -509.219055)
+fleemechanic:runTo( 568.964539, mtheight, -507.931458)
+fleemechanic:runTo( 569.355469, mtheight, -506.637726)
+fleemechanic:runTo( 626.359924, mtheight, -384.633179)
+fleemechanic:runTo( 627.059998, mtheight, -383.511444)
+fleemechanic:runTo( 627.764282, mtheight, -382.382935)
+fleemechanic:runTo( 628.469055, mtheight, -381.253601)
+fleemechanic:runTo( 629.178345, mtheight, -380.117065)
+fleemechanic:runTo( 629.888367, mtheight, -378.979340)
+fleemechanic:runTo( 630.599548, mtheight, -377.839752)
+fleemechanic:runTo( 631.316711, mtheight, -376.690643)
+fleemechanic:runTo( 704.250305, mtheight, -250.679443)
+fleemechanic:runTo( 704.842896, mtheight, -249.538712)
+fleemechanic:runTo( 705.438721, mtheight, -248.391754)
+fleemechanic:runTo( 706.033630, mtheight, -247.246506)
+fleemechanic:runTo( 706.628479, mtheight, -246.101395)
+fleemechanic:runTo( 707.229248, mtheight, -244.944870)
+fleemechanic:runTo( 707.831665, mtheight, -243.785248)
+fleeprogrammed = true
+
+end
+end
+
+
+function tick(timestep)
+ flee(timestep)
+RandTime()
+if randTime > 0 then
+randTime = randTime - timestep
+else
+fallDown(timestep)
+end
+
+return eventFinished
+
+end
Index: /data/trunk/scripts/ambush_at_uranus/floorguy.lua
===================================================================
--- /data/trunk/scripts/ambush_at_uranus/floorguy.lua	(revision 4448)
+++ /data/trunk/scripts/ambush_at_uranus/floorguy.lua	(revision 4448)
@@ -0,0 +1,90 @@
+-- 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")
+thisscript:addObject("FPSPlayer", "Player")
+thisscript:addObject("SpaceShip", "flyby")
+
+programRoute = true
+height = -10
+time = 3
+
+
+function fly(timestep)
+
+dx = 0 * timestep
+dy = 0 * timestep
+dz = -500* timestep
+
+flybyX = flyby:getAbsCoorX()
+flybyY = flyby:getAbsCoorY()
+flybyZ = flyby:getAbsCoorZ()
+
+if time < 0 and time > -0.4 then
+flyby:fire(true)
+else
+flyby:fire(false)
+end
+
+if flybyZ < 600 then
+--flyby:setAbsCoor(flybyX + dx, flybyY + dy, flybyZ + dz)
+end
+
+end
+
+function tick(timestep)
+
+time = time - timestep
+
+if time < 0 then
+fly(timestep)
+end
+
+
+if programRoute then
+floorguy:runTo( 800.634338, height, -340.454163)
+floorguy:runTo( 800.965149, height, -317.040039)
+floorguy:runTo( 801.330627, height, -291.156891)
+floorguy:runTo( 801.922913, height, -274.193085)
+floorguy:runTo( 802.959045, height, -258.950653)
+floorguy:runTo( 803.812805, height, -246.390198)
+floorguy:runTo( 804.034180, height, -232.661407)
+floorguy:runTo( 816.056702, height, 407.114502)
+floorguy:runTo( 817.066284, height, 439.783112)
+floorguy:runTo( 817.734314, height, 461.401306)
+floorguy:runTo( 818.361816, height, 481.702789)
+floorguy:runTo( 820.161621, height, 540.826538)
+floorguy:runTo( 820.825195, height, 579.028748)
+floorguy:runTo( 821.907410, height, 641.302673)
+floorguy:runTo( 823.706055, height, 744.863098)
+floorguy:runTo( 820.552490, height, 761.699585)
+floorguy:runTo( 809.810425, height, 771.055420)
+floorguy:runTo( 794.455383, height, 779.180725)
+--floorguy:runTo( 779.520386, height, 773.730957)
+--floorguy:runTo( 769.395630, height, 762.138306)
+--floorguy:runTo( 761.172668, height, 749.739258)
+--floorguy:runTo( 756.049500, height, 736.094116)
+--floorguy:runTo( 755.904297, height, 648.224854)
+--floorguy:runTo( 742.674744, height, -243.343140)
+--floorguy:runTo( 742.312805, height, -273.083893)
+--floorguy:runTo( 741.927856, height, -304.735474)
+--floorguy:runTo( 741.548035, height, -335.971069)
+--floorguy:runTo( 741.181824, height, -366.028503)
+programRoute = false
+end
+
+
+if floorguy:finalGoalReached() then
+programRoute = true
+end
+
+
+return false
+end
Index: /data/trunk/scripts/ambush_at_uranus/guard.lua
===================================================================
--- /data/trunk/scripts/ambush_at_uranus/guard.lua	(revision 4448)
+++ /data/trunk/scripts/ambush_at_uranus/guard.lua	(revision 4448)
@@ -0,0 +1,316 @@
+-- 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")
+thisscript:addObject("FPSPlayer", "Player")
+
+-- Global Variables
+walkingRouteOne = true   -- True if thestranger is walking route one
+exitPositionReached = false
+playerInLock = false
+hangarReached = false
+guardStopped = false
+gotoSpaceship = false
+
+height = 34
+
+-- 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()
+
+guardX = guard:getAbsCoorX()
+guardY = guard:getAbsCoorY()
+guardZ = guard:getAbsCoorZ()
+
+playerX = Player:getAbsCoorX()
+playerY = Player:getAbsCoorY()
+playerZ = Player:getAbsCoorZ()
+
+
+distance = dist( guardX,guardY,guardZ,playerX, playerY, playerZ)
+
+if distance > 250 and hangarRouteProgrammed and not guardStopped and not gotoSpaceship then
+ guard:stop()
+ guardStopped = true
+end
+
+if distance < 250 and hangarRouteProgrammed and guardStopped and not gotoSpaceship then
+ guard:resume()
+ guardStopped = false
+end
+
+if dist( playerX,playerY,playerZ,167.361526,29,483.163818 ) < 150 then
+playerInLock = true
+end
+
+if dist( guardX,guardY,guardZ,772.325012, height, -1500.850708) < 200 then
+gotoSpaceship = true
+end
+
+
+end
+
+routeOneProgrammed = false
+function walkRouteOne(timestep)
+if not routeOneProgrammed then
+guard:walkTo( 266.396362, height, 241.398544)
+guard:walkTo( 254.577255, height, 241.159897)
+guard:walkTo( 221.120651, height, 240.484360)
+guard:walkTo( 187.732651, height, 239.810196)
+guard:walkTo( 165.661865, height, 239.364563)
+guard:walkTo( 148.642044, height, 239.020889)
+guard:walkTo( 128.012802, height, 238.604340)
+guard:walkTo( 65.664688, height, 237.345383)
+guard:walkTo( 30.099592, height, 236.627243)
+guard:walkTo( -14.031926, height, 236.483414)
+guard:walkTo( -52.224205, height, 241.776978)
+guard:walkTo( -83.528168, height, 245.757629)
+guard:walkTo( -98.730980, height, 247.394043)
+guard:walkTo( -111.666504, height, 246.585648)
+guard:walkTo( -111.666504, height, 246.585648)
+guard:walkTo( -114.805542, height, 246.144440)
+guard:walkTo( -119.267967, height, 245.360168)
+guard:walkTo( -138.284515, height, 239.281021)
+guard:walkTo( -146.166840, height, 234.512054)
+guard:walkTo( -157.210480, height, 222.620941)
+guard:walkTo( -158.519867, height, 219.674301)
+guard:walkTo( -158.519867, height, 219.674301)
+guard:walkTo( -158.478958, height, 213.490570)
+guard:walkTo( -158.478958, height, 213.490570)
+guard:walkTo( -155.965332, height, 210.303101)
+guard:walkTo( -150.804489, height, 203.959869)
+guard:walkTo( -148.853012, height, 201.561295)
+guard:walkTo( -145.451157, height, 197.554382)
+guard:walkTo( -143.694107, height, 196.373535)
+guard:walkTo( -139.281479, height, 193.407990)
+guard:walkTo( -137.526047, height, 192.228226)
+guard:walkTo( -103.046753, height, 182.510071)
+guard:runTo( -14.992087, height, 181.910767)
+guard:runTo( 46.347664, height, 181.493317)
+guard:runTo( 86.343376, height, 181.221130)
+guard:runTo( 124.465179, height, 194.251617)
+guard:runTo( 136.548996, height, 219.682953)
+guard:runTo( 145.162140, height, 244.268982)
+guard:runTo( 149.328720, height, 256.993256)
+guard:runTo( 162.649582, height, 268.181732)
+
+routeOneProgrammed = true
+end
+
+if guard:finalGoalReached() then
+return false
+end
+
+return true
+end
+
+
+exitRouteProgrammed = false
+function goToExitPosition(timestep)
+
+if not exitRouteProgrammed then
+--guard:runTo( 162.096558, height, 274.944366)
+--guard:runTo( 161.519516, height, 286.673370)
+--guard:runTo( 161.098618, height, 295.228699)
+--guard:runTo( 160.568466, height, 306.004486)
+guard:runTo( 160.151169, height, 314.486572)
+guard:runTo( 159.416641, height, 324.925232)
+guard:walkTo( 158.700073, height, 335.108154)
+guard:walkTo( 157.943298, height, 345.862610)
+guard:walkTo( 157.418381, height, 356.131256)
+guard:walkTo( 156.908035, height, 366.115417)
+guard:walkTo( 156.940308, height, 377.467712)
+guard:walkTo( 156.965408, height, 386.287933)
+guard:walkTo( 156.924698, height, 394.296417)
+guard:walkTo( 156.816116, height, 401.564911)
+guard:walkTo( 156.147583, height, 446.314850)
+guard:walkTo( 155.145660, height, 515.473877)
+guard:walkTo( 148.450058, height, 524.572571)
+guard:walkTo( 135.599609, height, 533.407166)
+guard:walkTo( 119.772217, height, 539.609192)
+guard:walkTo( 108.926720, height, 537.174927)
+guard:walkTo( 100.885788, height, 524.737793)
+guard:walkTo( 99.870834, height, 512.540100)
+guard:walkTo( 108.219215, height, 502.064178)
+
+exitRouteProgrammed = true
+end
+
+if guard:finalGoalReached() and playerInLock then
+return true
+end
+
+return false
+end
+
+
+hangarRouteProgrammed = false
+function goToHangar(timestep)
+
+if not hangarRouteProgrammed and playerInLock then
+
+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)
+
+guard:walkTo( 772.325012, height, -1500.850708)
+guard:walkTo( 772.325012, height, -1500.850708)
+guard:walkTo( 772.487854, height, -1508.028809)
+guard:walkTo( 774.761047, height, -1519.442139)
+guard:walkTo( 778.809204, height, -1525.292847)
+guard:walkTo( 783.482666, height, -1530.000610)
+guard:walkTo( 790.163269, height, -1536.350708)
+guard:walkTo( 797.713745, height, -1542.968018)
+guard:walkTo( 804.024475, height, -1548.390503)
+guard:walkTo( 810.316406, height, -1553.796875)
+guard:walkTo( 819.849731, height, -1561.323242)
+guard:walkTo( 826.676819, height, -1566.627197)
+guard:walkTo( 833.950928, height, -1572.278442)
+guard:walkTo( 840.587036, height, -1577.434082)
+guard:walkTo( 847.261230, height, -1582.458252)
+guard:walkTo( 852.104797, height, -1586.104370)
+guard:walkTo( 857.504944, height, -1590.169556)
+guard:walkTo( 861.696411, height, -1593.324829)
+guard:walkTo( 867.690613, height, -1597.837036)
+guard:walkTo( 874.808105, height, -1604.437378)
+guard:walkTo( 878.302429, height, -1608.333252)
+guard:walkTo( 884.001892, height, -1614.366211)
+guard:walkTo( 890.699646, height, -1621.398315)
+guard:walkTo( 895.391052, height, -1626.179688)
+guard:walkTo( 902.171509, height, -1633.090332)
+guard:walkTo( 906.807495, height, -1637.957764)
+guard:walkTo( 910.438599, height, -1641.770142)
+guard:walkTo( 915.626160, height, -1647.216797)
+guard:walkTo( 921.844727, height, -1653.745972)
+guard:walkTo( 928.565125, height, -1660.801636)
+guard:walkTo( 933.742004, height, -1666.236694)
+guard:walkTo( 938.956543, height, -1671.711182)
+guard:walkTo( 942.160706, height, -1675.745972)
+guard:walkTo( 947.547302, height, -1681.952881)
+guard:walkTo( 951.732483, height, -1687.077759)
+guard:walkTo( 957.284851, height, -1693.876709)
+guard:walkTo( 962.786438, height, -1700.614990)
+guard:walkTo( 966.177246, height, -1705.151245)
+guard:walkTo( 970.221619, height, -1710.886230)
+guard:walkTo( 974.503113, height, -1717.243896)
+guard:walkTo( 977.332153, height, -1722.064087)
+guard:walkTo( 981.496887, height, -1729.391357)
+guard:walkTo( 986.814148, height, -1738.394165)
+guard:walkTo( 991.428650, height, -1745.393799)
+guard:walkTo( 998.958069, height, -1755.184326)
+guard:walkTo( 1003.995300, height, -1761.734131)
+guard:walkTo( 1009.006226, height, -1768.234375)
+guard:walkTo( 1013.550842, height, -1773.405029)
+guard:walkTo( 1019.371277, height, -1778.674072)
+guard:walkTo( 1024.703491, height, -1782.708618)
+guard:walkTo( 1030.605469, height, -1787.173950)
+guard:walkTo( 1036.072876, height, -1790.982056)
+guard:walkTo( 1043.746094, height, -1795.485474)
+guard:walkTo( 1050.884644, height, -1799.663574)
+hangarRouteProgrammed  = true
+end
+
+if guard:finalGoalReached() and not guardStopped then
+return true
+end
+
+return false
+end
+
+
+
+function tick(timestep)
+--io.write("Guard called \n")
+observePlayer()
+
+
+if walkingRouteOne then
+walkingRouteOne = walkRouteOne(timestep)
+end
+
+if not walkingRouteOne and not exitPositionReached then
+exitPositionReached = goToExitPosition(timestep)
+end
+
+if not hangarReached and exitPositionReached then
+hangarReached = goToHangar(timestep)
+end
+
+return hangarReached
+end
+ 
Index: /data/trunk/scripts/ambush_at_uranus/hangar.lua
===================================================================
--- /data/trunk/scripts/ambush_at_uranus/hangar.lua	(revision 4448)
+++ /data/trunk/scripts/ambush_at_uranus/hangar.lua	(revision 4448)
@@ -0,0 +1,332 @@
+-- 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")
+thisscript:addObject("RepairStation", "repair")
+thisscript:addObject("FPSPlayer", "Player")
+thisscript:addObject("SpaceShip", "spaceship")
+thisscript:addObject("GenericNPC", "mechanic")
+thisscript:addObject("GenericNPC", "mechanic2")
+
+-- 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
+
+
+
+
+
+mprogramRoute = true
+mheight = 5
+function mechanicMove(timestep)
+if mprogramRoute 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)
+
+mprogramRoute = false
+end
+
+if mechanic:finalGoalReached() then
+mprogramRoute = true
+end
+
+end
+
+mtprogramRoute = true
+mtheight = 5
+waittime = 0
+waiting = false
+function mechanictMove(timestep)
+if mtprogramRoute then
+mechanic2:walkTo( 1564.473999, mtheight, -1923.821533)
+mechanic2:walkTo( 1556.049927, mtheight, -1916.359009)
+mechanic2:walkTo( 1550.970581, mtheight, -1913.087524)
+mechanic2:walkTo( 1542.345459, mtheight, -1912.611938)
+mechanic2:walkTo( 1534.643677, mtheight, -1912.361816)
+mechanic2:walkTo( 1524.490845, mtheight, -1912.074097)
+mechanic2:walkTo( 1516.120605, mtheight, -1912.511475)
+mechanic2:walkTo( 1508.607788, mtheight, -1912.904175)
+mechanic2:walkTo( 1498.452759, mtheight, -1913.434814)
+mechanic2:walkTo( 1492.513916, mtheight, -1913.744995)
+mechanic2:walkTo( 1483.056274, mtheight, -1914.239136)
+mechanic2:walkTo( 1471.428711, mtheight, -1916.435303)
+mechanic2:walkTo( 1460.068359, mtheight, -1916.473022)
+mechanic2:walkTo( 1451.006592, mtheight, -1913.691772)
+mechanic2:walkTo( 1444.585938, mtheight, -1911.533691)
+mechanic2:walkTo( 1439.008423, mtheight, -1909.659058)
+mechanic2:walkTo( 1421.636230, mtheight, -1915.466553)
+mechanic2:walkTo( 1420.582275, mtheight, -1926.693970)
+mechanic2:walkTo( 1422.506714, mtheight, -1934.938232)
+mechanic2:walkTo( 1430.749023, mtheight, -1942.431519)
+mechanic2:walkTo( 1440.773315, mtheight, -1948.152832)
+mechanic2:walkTo( 1452.532227, mtheight, -1950.169800)
+mechanic2:walkTo( 1465.584961, mtheight, -1949.407959)
+mechanic2:walkTo( 1475.635254, mtheight, -1948.756226)
+mechanic2:walkTo( 1481.961548, mtheight, -1948.346069)
+mechanic2:walkTo( 1495.564575, mtheight, -1947.588257)
+mechanic2:walkTo( 1505.660156, mtheight, -1947.679077)
+mechanic2:walkTo( 1514.055542, mtheight, -1947.901245)
+mechanic2:walkTo( 1523.532959, mtheight, -1948.351440)
+mechanic2:walkTo( 1537.855347, mtheight, -1949.461914)
+mechanic2:walkTo( 1545.510498, mtheight, -1950.162720)
+mechanic2:walkTo( 1553.132935, mtheight, -1950.860718)
+mechanic2:walkTo( 1556.371460, mtheight, -1951.157104)
+mechanic2:walkTo( 1563.450806, mtheight, -1951.804932)
+mechanic2:walkTo( 1572.594116, mtheight, -1952.320679)
+mechanic2:walkTo( 1582.691772, mtheight, -1950.470459)
+mechanic2:walkTo( 1589.872681, mtheight, -1929.683105)
+mechanic2:walkTo( 1587.794922, mtheight, -1922.749756)
+mechanic2:walkTo( 1582.800171, mtheight, -1917.671021)
+mechanic2:walkTo( 1573.449951, mtheight, -1915.750854)
+mechanic2:walkTo( 1564.055908, mtheight, -1914.986328)
+mtprogramRoute = false
+end
+
+mechanic2X = mechanic2:getAbsCoorX()
+mechanic2Y = mechanic2:getAbsCoorY()
+mechanic2Z = mechanic2:getAbsCoorZ()
+
+if dist(mechanic2X,mechanic2Y,mechanic2Z,1435.444824, mtheight, -1916.463013) < 10 and not waiting then
+mechanic2:stop()
+waittime = 5
+--io.write("mechanic2 stoped \n")
+waiting = true
+end
+
+if waittime >= 0 and waiting then
+waittime = waittime - timestep
+--io.write(waittime,"\n")
+if waittime < 0 then
+--io.write("mechanic2 finished waiting\n")
+mechanic2:resume()
+end
+end
+
+if dist(mechanic2X,mechanic2Y,mechanic2Z,1564.473999, mtheight, -1923.821533) < 10 and waiting then
+waiting = false
+end
+
+
+if mechanic2:finalGoalReached() then
+mtprogramRoute = 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)
+mechanictMove(timestep)
+
+--if playerReachedTrigger and not spaceshipLaunchReady then
+--moveToLaunchSite(timestep)
+--end
+
+--if spaceshipLaunchReady then
+--launchSpaceShip(timestep)
+--end
+
+
+return false
+end
Index: /data/trunk/scripts/ambush_at_uranus/prisoner.lua
===================================================================
--- /data/trunk/scripts/ambush_at_uranus/prisoner.lua	(revision 4448)
+++ /data/trunk/scripts/ambush_at_uranus/prisoner.lua	(revision 4448)
@@ -0,0 +1,387 @@
+-- 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")
+thisscript:addObject("FPSPlayer", "Player")
+thisscript:addObject("GenericNPC", "secondguard")
+thisscript:addObject("GenericNPC","guard")
+
+
+cellDoorOpened = false
+walkinCellFinished = false
+cellExitReached = false
+exitReached = false
+hangarReached = false
+spaceShipReached = false
+spaceShipEntered = false
+playerInLock = false
+guardStopped = false
+gotoSpaceship = false
+
+randTime = 0
+height = 36
+
+
+function dist( x1,x2,x3, y1,y2,y3 )
+
+return math.sqrt( (x1-y1)^2 + (x2-y2)^2 + (x3-y3)^2 )
+
+end
+
+function observeGuard()
+guardX = secondguard:getAbsCoorX()
+guardY = secondguard:getAbsCoorY()
+guardZ = secondguard:getAbsCoorZ()
+
+if dist( guardX,guardY,guardZ, -85.456375, height, 171.823486) < 60 then
+cellDoorOpened = true
+end
+
+end
+
+function observePlayer()
+playerX = Player:getAbsCoorX()
+playerY = Player:getAbsCoorY()
+playerZ = Player:getAbsCoorZ()
+
+
+guardX = guard:getAbsCoorX()
+guardY = guard:getAbsCoorY()
+guardZ = guard:getAbsCoorZ()
+
+distance = dist( guardX,guardY,guardZ,playerX, playerY, playerZ)
+
+if dist( playerX,playerY,playerZ,161.76,49,408.87 ) < 50 then
+playerInLock = true
+end
+
+
+if distance > 250 and hangarRouteProgrammed and not guardStopped and not gotoSpaceship then
+ prisoner:stop()
+ guardStopped = true
+end
+
+if distance < 250 and hangarRouteProgrammed and guardStopped and not gotoSpaceship then
+ prisoner:resume()
+ guardStopped = false
+end
+
+
+if dist( guardX,guardY,guardZ,772.325012, height, -1500.850708) < 200 then
+gotoSpaceship = true
+end
+
+
+end
+
+walkProgrammed = false
+exitProgrammed = false
+function walkInCell(timestep)
+
+
+if not walkProgrammed then
+--prisoner:walkTo( -66.454849, height, 62.363449)
+--prisoner:walkTo( -66.454849, height, 62.363449)
+prisoner:walkTo( -63.214821, height, 62.429710)
+prisoner:walkTo( -56.661182, height, 62.563740)
+prisoner:walkTo( -46.779755, height, 62.765827)
+prisoner:walkTo( -41.634224, height, 71.319214)
+prisoner:walkTo( -38.168526, height, 79.655807)
+prisoner:walkTo( -40.782196, height, 101.285233)
+prisoner:walkTo( -47.722874, height, 114.314980)
+prisoner:walkTo( -54.593349, height, 118.605423)
+prisoner:walkTo( -62.802982, height, 117.947144)
+prisoner:walkTo( -73.180130, height, 116.720863)
+prisoner:walkTo( -85.028603, height, 114.952316)
+prisoner:walkTo( -113.125824, height, 96.362946)
+prisoner:walkTo( -118.218887, height, 87.702599)
+prisoner:walkTo( -120.596275, height, 80.304184)
+prisoner:walkTo( -114.928169, height, 68.971840)
+prisoner:walkTo( -108.606766, height, 62.085098)
+prisoner:walkTo( -90.078171, height, 59.558804)
+prisoner:walkTo( -83.558510, height, 60.516567)
+prisoner:walkTo( -71.352402, height, 63.920750)
+walkProgrammed = true
+end
+
+
+if prisoner:finalGoalReached() and not cellDoorOpened then
+ walkProgrammed = false
+end
+
+
+if cellDoorOpened then
+
+  if not exitProgrammed then
+prisoner:walkTo( -61.875267, height, 158.254517)
+prisoner:walkTo( -62.335995, height, 170.318756)
+prisoner:walkTo( -62.358681, height, 179.232559)
+prisoner:walkTo( -55.998741, height, 189.289749)
+prisoner:walkTo( -49.237957, height, 195.076263)
+prisoner:walkTo( -39.007496, height, 195.889221)
+prisoner:walkTo( -24.234095, height, 195.547043)
+prisoner:walkTo( -11.409116, height, 196.236069)
+prisoner:walkTo( 2.545602, height, 196.805954)
+prisoner:walkTo( 13.875313, height, 196.377563)
+prisoner:walkTo( 28.379402, height, 195.829132)
+prisoner:walkTo( 41.672989, height, 195.326477)
+prisoner:walkTo( 57.125935, height, 194.742126)
+prisoner:walkTo( 70.114609, height, 194.251007)
+prisoner:walkTo( 81.857407, height, 193.806961)
+prisoner:walkTo( 97.840607, height, 193.974030)
+prisoner:walkTo( 107.569641, height, 196.299652)
+prisoner:walkTo( 120.975266, height, 202.754532)
+prisoner:walkTo( 129.063812, height, 207.099640)
+prisoner:walkTo( 140.468765, height, 214.389191)
+prisoner:walkTo( 145.902267, height, 224.194229)
+prisoner:walkTo( 148.106079, height, 233.095215)
+prisoner:walkTo( 150.907532, height, 244.410049)
+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
+
+  if prisoner:finalGoalReached() then
+   return true
+  end
+
+end 
+
+return false
+
+end
+
+
+hangarRouteProgrammed = false
+function goToHangar(timestep)
+
+if not hangarRouteProgrammed and playerInLock then
+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)
+
+prisoner:walkTo( 775.508972, height, -1457.168213)
+prisoner:walkTo( 776.536743, height, -1462.372925)
+prisoner:walkTo( 778.141663, height, -1470.500732)
+prisoner:walkTo( 779.744995, height, -1478.620117)
+prisoner:walkTo( 782.587646, height, -1489.528198)
+prisoner:walkTo( 785.285156, height, -1497.338013)
+prisoner:walkTo( 788.850159, height, -1506.399414)
+prisoner:walkTo( 792.417053, height, -1515.465820)
+prisoner:walkTo( 796.757446, height, -1525.825684)
+prisoner:walkTo( 802.122009, height, -1534.417847)
+prisoner:walkTo( 808.422058, height, -1541.669067)
+prisoner:walkTo( 816.134949, height, -1549.770508)
+prisoner:walkTo( 824.352783, height, -1557.150024)
+prisoner:walkTo( 832.695801, height, -1563.451172)
+prisoner:walkTo( 843.443665, height, -1571.163818)
+prisoner:walkTo( 850.623901, height, -1576.316284)
+prisoner:walkTo( 859.099182, height, -1580.545166)
+prisoner:walkTo( 868.999939, height, -1585.129028)
+prisoner:walkTo( 879.254211, height, -1588.827148)
+prisoner:walkTo( 888.822021, height, -1592.277832)
+prisoner:walkTo( 895.563293, height, -1594.931885)
+prisoner:walkTo( 900.941589, height, -1597.049438)
+prisoner:walkTo( 907.684387, height, -1599.704102)
+prisoner:walkTo( 914.599243, height, -1604.825928)
+prisoner:walkTo( 919.703430, height, -1609.984619)
+prisoner:walkTo( 925.728088, height, -1616.250977)
+prisoner:walkTo( 930.751343, height, -1621.475830)
+prisoner:walkTo( 934.714905, height, -1625.719360)
+prisoner:walkTo( 940.166260, height, -1631.555664)
+prisoner:walkTo( 946.152344, height, -1637.964600)
+prisoner:walkTo( 953.042297, height, -1646.456421)
+prisoner:walkTo( 958.174194, height, -1654.167847)
+prisoner:walkTo( 964.112854, height, -1663.534424)
+prisoner:walkTo( 968.981812, height, -1670.229248)
+prisoner:walkTo( 975.821045, height, -1678.569946)
+prisoner:walkTo( 982.743835, height, -1687.244385)
+prisoner:walkTo( 990.572571, height, -1697.622559)
+prisoner:walkTo( 995.849670, height, -1704.618164)
+prisoner:walkTo( 1001.152649, height, -1711.648193)
+prisoner:walkTo( 1005.204590, height, -1717.019531)
+prisoner:walkTo( 1012.097412, height, -1725.154907)
+prisoner:walkTo( 1017.283020, height, -1731.152222)
+prisoner:walkTo( 1022.044250, height, -1736.658936)
+prisoner:walkTo( 1028.422852, height, -1744.234863)
+prisoner:walkTo( 1033.080688, height, -1749.780884)
+prisoner:walkTo( 1036.395874, height, -1753.908936)
+prisoner:walkTo( 1040.509155, height, -1759.065186)
+prisoner:walkTo( 1044.627441, height, -1764.227783)
+prisoner:walkTo( 1050.220093, height, -1770.871094)
+prisoner:walkTo( 1054.504883, height, -1775.961060)
+prisoner:walkTo( 1060.259888, height, -1782.490723)
+prisoner:walkTo( 1067.060913, height, -1789.939209)
+prisoner:walkTo( 1072.477173, height, -1795.898315)
+prisoner:walkTo( 1076.556152, height, -1800.990845)
+prisoner:walkTo( 1080.718018, height, -1806.200439)
+prisoner:walkTo( 1085.281494, height, -1811.912476)
+prisoner:walkTo( 1090.934448, height, -1817.621094)
+prisoner:walkTo( 1095.896240, height, -1822.369141)
+prisoner:walkTo( 1100.940430, height, -1827.278564)
+prisoner:walkTo( 1107.045898, height, -1833.460693)
+prisoner:walkTo( 1113.230103, height, -1839.722534)
+
+hangarRouteProgrammed = true
+end
+
+thisX = prisoner:getAbsCoorX()
+thisY = prisoner:getAbsCoorY()
+thisZ = prisoner:getAbsCoorZ()
+
+distance = dist( thisX,thisY,thisZ, 1113.230103, height, -1839.722534)
+--io.write(distance,"\n")
+
+if dist( thisX,thisY,thisZ, 1113.230103, height, -1839.722534) < 40 then
+prisoner:hide()
+return true
+end
+
+
+return false
+
+end
+
+spaceshipRouteProgrammed = false
+function goToSpaceship(timestep)
+
+if not spaceshipRouteProgrammed then
+
+
+spaceshipRouteProgrammed = true
+end
+
+if prisoner:finalGoalReached() then
+   return true
+end
+
+return false
+
+end
+
+
+function enterSpaceship(timestep)
+
+return false
+end
+
+
+
+function tick(timestep)
+
+ observeGuard()
+ observePlayer()
+
+
+if not walkinCellFinished then
+walkinCellFinished = walkInCell(timestep)
+end
+
+
+if walkinCellFinished and not hangarReached then
+hangarReached = goToHangar(timestep)
+end
+
+
+return hangarReached
+end
Index: /data/trunk/scripts/ambush_at_uranus/secondguard.lua
===================================================================
--- /data/trunk/scripts/ambush_at_uranus/secondguard.lua	(revision 4448)
+++ /data/trunk/scripts/ambush_at_uranus/secondguard.lua	(revision 4448)
@@ -0,0 +1,343 @@
+-- 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")
+thisscript:addObject("GenericNPC", "guard")
+thisscript:addObject("FPSPlayer", "Player")
+thisscript:addObject("GenericNPC", "prisoner")
+
+-- Global Variables
+allOk = true
+cellReached = false
+guidePositionReached = false
+prisonerReachedLock = false
+hangarReached = false
+guardStopped = false
+letsgo = false
+
+height = 90
+
+-- 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 observeGuard()
+guardX = guard:getAbsCoorX()
+guardY = guard:getAbsCoorY()
+guardZ = guard:getAbsCoorZ()
+
+if dist( guardX,guardY,guardZ,35.48, 29, 191.28 ) < 30 then
+allOk = false
+end
+
+end
+
+function observePlayer()
+
+guardX = guard:getAbsCoorX()
+guardY = guard:getAbsCoorY()
+guardZ = guard:getAbsCoorZ()
+
+playerX = Player:getAbsCoorX()
+playerY = Player:getAbsCoorY()
+playerZ = Player:getAbsCoorZ()
+
+distance = dist( guardX,guardY,guardZ,playerX, playerY, playerZ)
+
+if distance > 250 and hangarProgrammed and not guardStopped then
+ secondguard:stop()
+ guardStopped = true
+end
+
+if distance < 250 and hangarProgrammed and guardStopped then
+ secondguard:resume()
+ guardStopped = false
+end
+
+if dist( playerX,playerY,playerZ,161.76,49,408.87 ) < 50  then
+letsgo = true
+end
+
+end
+
+
+
+function observePrisoner()
+
+prisonerX = prisoner:getAbsCoorX()
+prisonerY = prisoner:getAbsCoorY()
+prisonerZ = prisoner:getAbsCoorZ()
+
+if dist( prisonerX,prisonerY,prisonerZ,162.757919,49,363.489349 ) < 60 then
+--io.write("Prisonner reached lock \n")
+prisonerReachedLock = true
+end
+
+end
+
+cellProgrammed = false
+function goToCell(timestep)
+
+if not cellProgrammed then
+secondguard:walkTo( 442.173767, height, 176.429855)
+secondguard:walkTo( 442.173767, height, 176.429855)
+secondguard:walkTo( 436.727753, height, 188.191757)
+secondguard:walkTo( 432.311584, height, 198.882462)
+secondguard:walkTo( 426.079590, height, 213.968994)
+secondguard:walkTo( 420.553986, height, 226.714996)
+secondguard:walkTo( 412.681915, height, 235.053696)
+secondguard:walkTo( 398.758545, height, 241.846924)
+secondguard:walkTo( 384.690735, height, 242.851395)
+secondguard:walkTo( 348.930481, height, 242.394958)
+secondguard:walkTo( 336.467926, height, 241.985764)
+secondguard:walkTo( 324.042999, height, 241.577774)
+secondguard:walkTo( 303.851410, height, 240.914841)
+secondguard:walkTo( 293.013977, height, 240.559006)
+secondguard:walkTo( 276.207611, height, 240.007233)
+secondguard:walkTo( 261.475800, height, 239.523544)
+secondguard:walkTo( 239.185089, height, 238.791687)
+secondguard:walkTo( 226.655655, height, 238.491974)
+secondguard:walkTo( 211.996979, height, 238.851044)
+secondguard:walkTo( 192.956741, height, 239.859207)
+secondguard:walkTo( 178.496552, height, 241.852539)
+secondguard:walkTo( 160.421860, height, 244.009827)
+secondguard:walkTo( 145.371857, height, 244.946075)
+secondguard:walkTo( 129.918198, height, 245.307037)
+secondguard:walkTo( 113.065468, height, 245.108231)
+secondguard:walkTo( 99.159073, height, 244.695694)
+secondguard:walkTo( 82.069923, height, 244.188766)
+secondguard:walkTo( 65.880531, height, 243.708527)
+secondguard:walkTo( 48.133881, height, 243.182114)
+secondguard:walkTo( 34.706280, height, 242.783813)
+secondguard:walkTo( 20.682344, height, 242.367783)
+secondguard:walkTo( 5.419819, height, 241.915070)
+secondguard:walkTo( -10.556346, height, 241.058746)
+secondguard:walkTo( -24.159513, height, 240.127090)
+secondguard:walkTo( -33.819145, height, 239.995453)
+secondguard:walkTo( -45.414162, height, 240.373322)
+secondguard:walkTo( -60.228550, height, 240.856079)
+secondguard:walkTo( -73.269897, height, 241.260895)
+secondguard:walkTo( -86.128647, height, 240.457886)
+secondguard:walkTo( -100.443581, height, 236.485718)
+secondguard:walkTo( -112.346939, height, 233.967209)
+secondguard:walkTo( -127.331635, height, 227.615112)
+secondguard:walkTo( -135.153656, height, 215.476883)
+secondguard:walkTo( -131.529984, height, 202.931015)
+secondguard:walkTo( -122.671799, height, 193.644669)
+secondguard:walkTo( -113.823517, height, 183.986633)
+secondguard:walkTo( -104.089592, height, 170.659729)
+cellProgrammed = true
+end
+
+if secondguard:finalGoalReached() then
+return true
+end
+
+return false
+end
+
+guideProgrammed = false
+function goToGuidePosition(timestep)
+
+if not guideProgrammed then
+secondguard:walkTo( -100.266739, height, 171.345627)
+secondguard:walkTo( -91.152046, height, 171.639709)
+secondguard:walkTo( -85.456375, height, 171.823486)
+secondguard:walkTo( -74.048538, height, 172.191589)
+secondguard:walkTo( -53.574173, height, 172.852219)
+secondguard:walkTo( -43.275124, height, 173.184540)
+secondguard:walkTo( -35.155544, height, 173.446518)
+secondguard:walkTo( -31.645050, height, 173.559784)
+secondguard:walkTo( -23.426588, height, 173.824966)
+secondguard:walkTo( -10.576803, height, 174.239578)
+secondguard:walkTo( -2.389911, height, 174.503754)
+secondguard:walkTo( 6.950986, height, 174.805176)
+secondguard:walkTo( 16.313608, height, 175.161179)
+secondguard:walkTo( 23.271458, height, 175.547226)
+secondguard:walkTo( 31.248058, height, 176.199890)
+secondguard:walkTo( 43.694778, height, 177.753479)
+secondguard:walkTo( 50.441612, height, 178.595612)
+secondguard:walkTo( 71.374535, height, 181.208389)
+secondguard:walkTo( 82.251022, height, 181.855988)
+secondguard:walkTo( 91.975792, height, 182.434998)
+secondguard:walkTo( 101.695015, height, 183.013672)
+secondguard:walkTo( 110.377205, height, 183.530609)
+secondguard:walkTo( 122.299400, height, 184.240448)
+secondguard:walkTo( 129.848495, height, 184.689911)
+secondguard:walkTo( 141.687805, height, 185.394821)
+secondguard:walkTo( 150.166702, height, 186.776016)
+secondguard:walkTo( 155.342255, height, 189.285080)
+secondguard:walkTo( 162.508133, height, 192.849976)
+secondguard:walkTo( 171.747696, height, 197.075134)
+secondguard:walkTo( 177.846390, height, 199.864029)
+secondguard:walkTo( 182.707596, height, 204.381516)
+secondguard:walkTo( 182.707596, height, 204.381516)
+secondguard:walkTo( 187.317139, height, 211.966385)
+secondguard:walkTo( 193.191528, height, 221.632446)
+secondguard:walkTo( 197.856018, height, 229.307724)
+secondguard:walkTo( 198.350906, height, 232.634857)
+secondguard:walkTo( 198.427155, height, 243.656113)
+
+guideProgrammed = true
+end
+
+if secondguard:finalGoalReached() then
+return true
+end
+
+return false
+end
+
+hangarProgrammed = false
+function goToHangar(timestep)
+
+if not hangarProgrammed and prisonerReachedLock and letsgo then
+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
+
+guardX = secondguard:getAbsCoorX()
+guardY = secondguard:getAbsCoorY()
+guardZ = secondguard:getAbsCoorZ()
+
+if dist( guardX,guardY,guardZ, 2.861493, 29, -1705.131958) < 60 then
+return true
+end
+
+return false
+
+end
+
+time = 2
+function tick(timestep)
+--io.write("Secondguard called \n")
+ 
+observePrisoner()
+observeGuard()
+observePlayer()
+
+if not allOk then
+cellReached = goToCell(timestep)
+end
+
+--do talking
+if cellReached then
+time = time - timestep
+end
+
+
+if time < 0 then
+
+if cellReached and not guidePositionReached then
+guidePositionReached = goToGuidePosition(timestep)
+end
+
+if guidePositionReached and not hangarReached then
+hangarReached = goToHangar(timestep)
+end
+
+if hangarReached then
+return true
+end
+
+
+end
+
+
+return false
+end
Index: /data/trunk/scripts/ambush_at_uranus/secondprisoner.lua
===================================================================
--- /data/trunk/scripts/ambush_at_uranus/secondprisoner.lua	(revision 4448)
+++ /data/trunk/scripts/ambush_at_uranus/secondprisoner.lua	(revision 4448)
@@ -0,0 +1,39 @@
+-- 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")
+thisscript:addObject("FPSPlayer", "Player")
+
+-- Initialises the random number generator
+randinit = false
+function randInit()
+
+if not randinit then
+math.randomseed(os.clock())
+randinit = true
+end
+
+end
+
+
+function scream()
+
+end
+
+function tick(timestep)
+
+--io.write("Secondprisoner called \n")
+randInit()
+randNumber = 10 * math.random()
+
+if randNumber > 8 then
+scream()
+end
+
+return false
+end
Index: /data/trunk/scripts/ambush_at_uranus/spaceship_flight.lua
===================================================================
--- /data/trunk/scripts/ambush_at_uranus/spaceship_flight.lua	(revision 4448)
+++ /data/trunk/scripts/ambush_at_uranus/spaceship_flight.lua	(revision 4448)
@@ -0,0 +1,71 @@
+-- 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()
+
+  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
+
+  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/scripts/desert/movechopper.lua
===================================================================
--- /data/trunk/scripts/desert/movechopper.lua	(revision 4448)
+++ /data/trunk/scripts/desert/movechopper.lua	(revision 4448)
@@ -0,0 +1,56 @@
+targetOneReached = false
+targetTwoReached = false
+time = 0.0
+
+
+function handleTrigger()
+helo:moveUp(true)
+end
+
+function invertTargetReached()
+ targetReached = not targetReached
+end
+
+
+function tick(timestep)
+ time = timestep+time
+ heloYCoord = helo:getAbsCoorY()
+ heloXCoord = helo:getAbsCoorX()
+ heloZCoord = helo:getAbsCoorZ()
+
+--io.write(heloXCoord)
+--io.write("\n")
+
+ if heloYCoord < 0 and not targetOneReached then
+  heloYCoord = heloYCoord + 1*timestep
+ else
+  targetOneReached = true
+ end 
+
+ if targetOneReached then
+  heloXCoord = heloXCoord + 10*timestep
+ end
+
+ if heloXCoord > -1445 then
+  heloYCoord = heloYCoord - 1*timestep
+  heloXCoord = heloXCoord - 8*timestep
+ end
+
+ if heloXCoord > -1440 then
+  targetTwoReached = true
+ end
+
+ if  heloYCoord < -18 and targetTwoReached then
+  return true;
+ end
+
+ helo:setAbsCoor(heloXCoord, heloYCoord ,heloZCoord)
+ --if time < 1 and not targetReached then
+ -- handleTrigger()
+ --else
+ -- helo:moveUp(false)
+ --end
+
+ return false
+
+end
Index: ta/trunk/scripts/falldown.lua
===================================================================
--- /data/trunk/scripts/falldown.lua	(revision 4447)
+++ 	(revision )
@@ -1,123 +1,0 @@
--- 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("GenericNPC", "fallingguy")
-thisscript:addObject("FPSPlayer", "Player")
-thisscript:addObject("GenericNPC","fleemechanic")
-
-dy = 0
-randTime = 0
-eventFinished = false
-randinit = false
-mtheight = -10
-
-function RandTime()
-
-if not randinit then
-math.randomseed(os.clock())
-randinit = true
-randTime = 8 * math.random()
-end
-end
-
-
-function fallDown(timestep)
-dy = dy + timestep
-thisX = fallingguy:getAbsCoorX()
-thisY = fallingguy:getAbsCoorY()
-thisZ = fallingguy:getAbsCoorZ()
-
-fallingguy:setAbsCoor(thisX, thisY - dy, thisZ)
-
-if thisY < -100 then
-eventFinished = true
-end
-
-end
-
-
-
-fleeprogrammed = false
-function flee(timestep)
-if not fleeprogrammed then
-fleemechanic:runTo( 735.658142, mtheight, -1525.291870)
-fleemechanic:runTo( 746.021912, mtheight, -1416.895508)
-fleemechanic:runTo( 746.021912, mtheight, -1415.689819)
-fleemechanic:runTo( 745.840454, mtheight, -1314.824585)
-fleemechanic:runTo( 745.840454, mtheight, -1313.533691)
-fleemechanic:runTo( 745.840454, mtheight, -1312.239258)
-fleemechanic:runTo( 745.840454, mtheight, -1310.942749)
-fleemechanic:runTo( 686.141907, mtheight, -1174.515015)
-fleemechanic:runTo( 685.479614, mtheight, -1173.372925)
-fleemechanic:runTo( 684.815857, mtheight, -1172.228271)
-fleemechanic:runTo( 630.430725, mtheight, -1072.972168)
-fleemechanic:runTo( 629.804199, mtheight, -1071.821777)
-fleemechanic:runTo( 629.174438, mtheight, -1070.665527)
-fleemechanic:runTo( 628.542786, mtheight, -1069.505859)
-fleemechanic:runTo( 627.905334, mtheight, -1068.335449)
-fleemechanic:runTo( 582.125610, mtheight, -969.282288)
-fleemechanic:runTo( 581.719971, mtheight, -968.030273)
-fleemechanic:runTo( 581.312866, mtheight, -966.773621)
-fleemechanic:runTo( 580.904602, mtheight, -965.513550)
-fleemechanic:runTo( 580.492493, mtheight, -964.241638)
-fleemechanic:runTo( 555.827942, mtheight, -873.071045)
-fleemechanic:runTo( 555.657410, mtheight, -871.761780)
-fleemechanic:runTo( 555.485962, mtheight, -870.445679)
-fleemechanic:runTo( 555.314087, mtheight, -869.126160)
-fleemechanic:runTo( 555.141418, mtheight, -867.800598)
-fleemechanic:runTo( 554.968262, mtheight, -866.471069)
-fleemechanic:runTo( 554.794922, mtheight, -865.140076)
-fleemechanic:runTo( 547.754639, mtheight, -767.221680)
-fleemechanic:runTo( 547.722961, mtheight, -765.892944)
-fleemechanic:runTo( 547.691223, mtheight, -764.562683)
-fleemechanic:runTo( 547.659180, mtheight, -763.219604)
-fleemechanic:runTo( 548.969849, mtheight, -649.171387)
-fleemechanic:runTo( 549.043274, mtheight, -647.850952)
-fleemechanic:runTo( 549.117126, mtheight, -646.523193)
-fleemechanic:runTo( 549.191101, mtheight, -645.193542)
-fleemechanic:runTo( 549.265137, mtheight, -643.862305)
-fleemechanic:runTo( 568.188416, mtheight, -510.499756)
-fleemechanic:runTo( 568.575439, mtheight, -509.219055)
-fleemechanic:runTo( 568.964539, mtheight, -507.931458)
-fleemechanic:runTo( 569.355469, mtheight, -506.637726)
-fleemechanic:runTo( 626.359924, mtheight, -384.633179)
-fleemechanic:runTo( 627.059998, mtheight, -383.511444)
-fleemechanic:runTo( 627.764282, mtheight, -382.382935)
-fleemechanic:runTo( 628.469055, mtheight, -381.253601)
-fleemechanic:runTo( 629.178345, mtheight, -380.117065)
-fleemechanic:runTo( 629.888367, mtheight, -378.979340)
-fleemechanic:runTo( 630.599548, mtheight, -377.839752)
-fleemechanic:runTo( 631.316711, mtheight, -376.690643)
-fleemechanic:runTo( 704.250305, mtheight, -250.679443)
-fleemechanic:runTo( 704.842896, mtheight, -249.538712)
-fleemechanic:runTo( 705.438721, mtheight, -248.391754)
-fleemechanic:runTo( 706.033630, mtheight, -247.246506)
-fleemechanic:runTo( 706.628479, mtheight, -246.101395)
-fleemechanic:runTo( 707.229248, mtheight, -244.944870)
-fleemechanic:runTo( 707.831665, mtheight, -243.785248)
-fleeprogrammed = true
-
-end
-end
-
-
-function tick(timestep)
- flee(timestep)
-RandTime()
-if randTime > 0 then
-randTime = randTime - timestep
-else
-fallDown(timestep)
-end
-
-return eventFinished
-
-end
Index: ta/trunk/scripts/floorguy.lua
===================================================================
--- /data/trunk/scripts/floorguy.lua	(revision 4447)
+++ 	(revision )
@@ -1,90 +1,0 @@
--- 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")
-thisscript:addObject("FPSPlayer", "Player")
-thisscript:addObject("SpaceShip", "flyby")
-
-programRoute = true
-height = -10
-time = 3
-
-
-function fly(timestep)
-
-dx = 0 * timestep
-dy = 0 * timestep
-dz = -500* timestep
-
-flybyX = flyby:getAbsCoorX()
-flybyY = flyby:getAbsCoorY()
-flybyZ = flyby:getAbsCoorZ()
-
-if time < 0 and time > -0.4 then
-flyby:fire(true)
-else
-flyby:fire(false)
-end
-
-if flybyZ < 600 then
---flyby:setAbsCoor(flybyX + dx, flybyY + dy, flybyZ + dz)
-end
-
-end
-
-function tick(timestep)
-
-time = time - timestep
-
-if time < 0 then
-fly(timestep)
-end
-
-
-if programRoute then
-floorguy:runTo( 800.634338, height, -340.454163)
-floorguy:runTo( 800.965149, height, -317.040039)
-floorguy:runTo( 801.330627, height, -291.156891)
-floorguy:runTo( 801.922913, height, -274.193085)
-floorguy:runTo( 802.959045, height, -258.950653)
-floorguy:runTo( 803.812805, height, -246.390198)
-floorguy:runTo( 804.034180, height, -232.661407)
-floorguy:runTo( 816.056702, height, 407.114502)
-floorguy:runTo( 817.066284, height, 439.783112)
-floorguy:runTo( 817.734314, height, 461.401306)
-floorguy:runTo( 818.361816, height, 481.702789)
-floorguy:runTo( 820.161621, height, 540.826538)
-floorguy:runTo( 820.825195, height, 579.028748)
-floorguy:runTo( 821.907410, height, 641.302673)
-floorguy:runTo( 823.706055, height, 744.863098)
-floorguy:runTo( 820.552490, height, 761.699585)
-floorguy:runTo( 809.810425, height, 771.055420)
-floorguy:runTo( 794.455383, height, 779.180725)
---floorguy:runTo( 779.520386, height, 773.730957)
---floorguy:runTo( 769.395630, height, 762.138306)
---floorguy:runTo( 761.172668, height, 749.739258)
---floorguy:runTo( 756.049500, height, 736.094116)
---floorguy:runTo( 755.904297, height, 648.224854)
---floorguy:runTo( 742.674744, height, -243.343140)
---floorguy:runTo( 742.312805, height, -273.083893)
---floorguy:runTo( 741.927856, height, -304.735474)
---floorguy:runTo( 741.548035, height, -335.971069)
---floorguy:runTo( 741.181824, height, -366.028503)
-programRoute = false
-end
-
-
-if floorguy:finalGoalReached() then
-programRoute = true
-end
-
-
-return false
-end
Index: ta/trunk/scripts/guard.lua
===================================================================
--- /data/trunk/scripts/guard.lua	(revision 4447)
+++ 	(revision )
@@ -1,316 +1,0 @@
--- 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")
-thisscript:addObject("FPSPlayer", "Player")
-
--- Global Variables
-walkingRouteOne = true   -- True if thestranger is walking route one
-exitPositionReached = false
-playerInLock = false
-hangarReached = false
-guardStopped = false
-gotoSpaceship = false
-
-height = 34
-
--- 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()
-
-guardX = guard:getAbsCoorX()
-guardY = guard:getAbsCoorY()
-guardZ = guard:getAbsCoorZ()
-
-playerX = Player:getAbsCoorX()
-playerY = Player:getAbsCoorY()
-playerZ = Player:getAbsCoorZ()
-
-
-distance = dist( guardX,guardY,guardZ,playerX, playerY, playerZ)
-
-if distance > 250 and hangarRouteProgrammed and not guardStopped and not gotoSpaceship then
- guard:stop()
- guardStopped = true
-end
-
-if distance < 250 and hangarRouteProgrammed and guardStopped and not gotoSpaceship then
- guard:resume()
- guardStopped = false
-end
-
-if dist( playerX,playerY,playerZ,167.361526,29,483.163818 ) < 150 then
-playerInLock = true
-end
-
-if dist( guardX,guardY,guardZ,772.325012, height, -1500.850708) < 200 then
-gotoSpaceship = true
-end
-
-
-end
-
-routeOneProgrammed = false
-function walkRouteOne(timestep)
-if not routeOneProgrammed then
-guard:walkTo( 266.396362, height, 241.398544)
-guard:walkTo( 254.577255, height, 241.159897)
-guard:walkTo( 221.120651, height, 240.484360)
-guard:walkTo( 187.732651, height, 239.810196)
-guard:walkTo( 165.661865, height, 239.364563)
-guard:walkTo( 148.642044, height, 239.020889)
-guard:walkTo( 128.012802, height, 238.604340)
-guard:walkTo( 65.664688, height, 237.345383)
-guard:walkTo( 30.099592, height, 236.627243)
-guard:walkTo( -14.031926, height, 236.483414)
-guard:walkTo( -52.224205, height, 241.776978)
-guard:walkTo( -83.528168, height, 245.757629)
-guard:walkTo( -98.730980, height, 247.394043)
-guard:walkTo( -111.666504, height, 246.585648)
-guard:walkTo( -111.666504, height, 246.585648)
-guard:walkTo( -114.805542, height, 246.144440)
-guard:walkTo( -119.267967, height, 245.360168)
-guard:walkTo( -138.284515, height, 239.281021)
-guard:walkTo( -146.166840, height, 234.512054)
-guard:walkTo( -157.210480, height, 222.620941)
-guard:walkTo( -158.519867, height, 219.674301)
-guard:walkTo( -158.519867, height, 219.674301)
-guard:walkTo( -158.478958, height, 213.490570)
-guard:walkTo( -158.478958, height, 213.490570)
-guard:walkTo( -155.965332, height, 210.303101)
-guard:walkTo( -150.804489, height, 203.959869)
-guard:walkTo( -148.853012, height, 201.561295)
-guard:walkTo( -145.451157, height, 197.554382)
-guard:walkTo( -143.694107, height, 196.373535)
-guard:walkTo( -139.281479, height, 193.407990)
-guard:walkTo( -137.526047, height, 192.228226)
-guard:walkTo( -103.046753, height, 182.510071)
-guard:runTo( -14.992087, height, 181.910767)
-guard:runTo( 46.347664, height, 181.493317)
-guard:runTo( 86.343376, height, 181.221130)
-guard:runTo( 124.465179, height, 194.251617)
-guard:runTo( 136.548996, height, 219.682953)
-guard:runTo( 145.162140, height, 244.268982)
-guard:runTo( 149.328720, height, 256.993256)
-guard:runTo( 162.649582, height, 268.181732)
-
-routeOneProgrammed = true
-end
-
-if guard:finalGoalReached() then
-return false
-end
-
-return true
-end
-
-
-exitRouteProgrammed = false
-function goToExitPosition(timestep)
-
-if not exitRouteProgrammed then
---guard:runTo( 162.096558, height, 274.944366)
---guard:runTo( 161.519516, height, 286.673370)
---guard:runTo( 161.098618, height, 295.228699)
---guard:runTo( 160.568466, height, 306.004486)
-guard:runTo( 160.151169, height, 314.486572)
-guard:runTo( 159.416641, height, 324.925232)
-guard:walkTo( 158.700073, height, 335.108154)
-guard:walkTo( 157.943298, height, 345.862610)
-guard:walkTo( 157.418381, height, 356.131256)
-guard:walkTo( 156.908035, height, 366.115417)
-guard:walkTo( 156.940308, height, 377.467712)
-guard:walkTo( 156.965408, height, 386.287933)
-guard:walkTo( 156.924698, height, 394.296417)
-guard:walkTo( 156.816116, height, 401.564911)
-guard:walkTo( 156.147583, height, 446.314850)
-guard:walkTo( 155.145660, height, 515.473877)
-guard:walkTo( 148.450058, height, 524.572571)
-guard:walkTo( 135.599609, height, 533.407166)
-guard:walkTo( 119.772217, height, 539.609192)
-guard:walkTo( 108.926720, height, 537.174927)
-guard:walkTo( 100.885788, height, 524.737793)
-guard:walkTo( 99.870834, height, 512.540100)
-guard:walkTo( 108.219215, height, 502.064178)
-
-exitRouteProgrammed = true
-end
-
-if guard:finalGoalReached() and playerInLock then
-return true
-end
-
-return false
-end
-
-
-hangarRouteProgrammed = false
-function goToHangar(timestep)
-
-if not hangarRouteProgrammed and playerInLock then
-
-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)
-
-guard:walkTo( 772.325012, height, -1500.850708)
-guard:walkTo( 772.325012, height, -1500.850708)
-guard:walkTo( 772.487854, height, -1508.028809)
-guard:walkTo( 774.761047, height, -1519.442139)
-guard:walkTo( 778.809204, height, -1525.292847)
-guard:walkTo( 783.482666, height, -1530.000610)
-guard:walkTo( 790.163269, height, -1536.350708)
-guard:walkTo( 797.713745, height, -1542.968018)
-guard:walkTo( 804.024475, height, -1548.390503)
-guard:walkTo( 810.316406, height, -1553.796875)
-guard:walkTo( 819.849731, height, -1561.323242)
-guard:walkTo( 826.676819, height, -1566.627197)
-guard:walkTo( 833.950928, height, -1572.278442)
-guard:walkTo( 840.587036, height, -1577.434082)
-guard:walkTo( 847.261230, height, -1582.458252)
-guard:walkTo( 852.104797, height, -1586.104370)
-guard:walkTo( 857.504944, height, -1590.169556)
-guard:walkTo( 861.696411, height, -1593.324829)
-guard:walkTo( 867.690613, height, -1597.837036)
-guard:walkTo( 874.808105, height, -1604.437378)
-guard:walkTo( 878.302429, height, -1608.333252)
-guard:walkTo( 884.001892, height, -1614.366211)
-guard:walkTo( 890.699646, height, -1621.398315)
-guard:walkTo( 895.391052, height, -1626.179688)
-guard:walkTo( 902.171509, height, -1633.090332)
-guard:walkTo( 906.807495, height, -1637.957764)
-guard:walkTo( 910.438599, height, -1641.770142)
-guard:walkTo( 915.626160, height, -1647.216797)
-guard:walkTo( 921.844727, height, -1653.745972)
-guard:walkTo( 928.565125, height, -1660.801636)
-guard:walkTo( 933.742004, height, -1666.236694)
-guard:walkTo( 938.956543, height, -1671.711182)
-guard:walkTo( 942.160706, height, -1675.745972)
-guard:walkTo( 947.547302, height, -1681.952881)
-guard:walkTo( 951.732483, height, -1687.077759)
-guard:walkTo( 957.284851, height, -1693.876709)
-guard:walkTo( 962.786438, height, -1700.614990)
-guard:walkTo( 966.177246, height, -1705.151245)
-guard:walkTo( 970.221619, height, -1710.886230)
-guard:walkTo( 974.503113, height, -1717.243896)
-guard:walkTo( 977.332153, height, -1722.064087)
-guard:walkTo( 981.496887, height, -1729.391357)
-guard:walkTo( 986.814148, height, -1738.394165)
-guard:walkTo( 991.428650, height, -1745.393799)
-guard:walkTo( 998.958069, height, -1755.184326)
-guard:walkTo( 1003.995300, height, -1761.734131)
-guard:walkTo( 1009.006226, height, -1768.234375)
-guard:walkTo( 1013.550842, height, -1773.405029)
-guard:walkTo( 1019.371277, height, -1778.674072)
-guard:walkTo( 1024.703491, height, -1782.708618)
-guard:walkTo( 1030.605469, height, -1787.173950)
-guard:walkTo( 1036.072876, height, -1790.982056)
-guard:walkTo( 1043.746094, height, -1795.485474)
-guard:walkTo( 1050.884644, height, -1799.663574)
-hangarRouteProgrammed  = true
-end
-
-if guard:finalGoalReached() and not guardStopped then
-return true
-end
-
-return false
-end
-
-
-
-function tick(timestep)
---io.write("Guard called \n")
-observePlayer()
-
-
-if walkingRouteOne then
-walkingRouteOne = walkRouteOne(timestep)
-end
-
-if not walkingRouteOne and not exitPositionReached then
-exitPositionReached = goToExitPosition(timestep)
-end
-
-if not hangarReached and exitPositionReached then
-hangarReached = goToHangar(timestep)
-end
-
-return hangarReached
-end
- 
Index: ta/trunk/scripts/hangar.lua
===================================================================
--- /data/trunk/scripts/hangar.lua	(revision 4447)
+++ 	(revision )
@@ -1,332 +1,0 @@
--- 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")
-thisscript:addObject("RepairStation", "repair")
-thisscript:addObject("FPSPlayer", "Player")
-thisscript:addObject("SpaceShip", "spaceship")
-thisscript:addObject("GenericNPC", "mechanic")
-thisscript:addObject("GenericNPC", "mechanic2")
-
--- 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
-
-
-
-
-
-mprogramRoute = true
-mheight = 5
-function mechanicMove(timestep)
-if mprogramRoute 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)
-
-mprogramRoute = false
-end
-
-if mechanic:finalGoalReached() then
-mprogramRoute = true
-end
-
-end
-
-mtprogramRoute = true
-mtheight = 5
-waittime = 0
-waiting = false
-function mechanictMove(timestep)
-if mtprogramRoute then
-mechanic2:walkTo( 1564.473999, mtheight, -1923.821533)
-mechanic2:walkTo( 1556.049927, mtheight, -1916.359009)
-mechanic2:walkTo( 1550.970581, mtheight, -1913.087524)
-mechanic2:walkTo( 1542.345459, mtheight, -1912.611938)
-mechanic2:walkTo( 1534.643677, mtheight, -1912.361816)
-mechanic2:walkTo( 1524.490845, mtheight, -1912.074097)
-mechanic2:walkTo( 1516.120605, mtheight, -1912.511475)
-mechanic2:walkTo( 1508.607788, mtheight, -1912.904175)
-mechanic2:walkTo( 1498.452759, mtheight, -1913.434814)
-mechanic2:walkTo( 1492.513916, mtheight, -1913.744995)
-mechanic2:walkTo( 1483.056274, mtheight, -1914.239136)
-mechanic2:walkTo( 1471.428711, mtheight, -1916.435303)
-mechanic2:walkTo( 1460.068359, mtheight, -1916.473022)
-mechanic2:walkTo( 1451.006592, mtheight, -1913.691772)
-mechanic2:walkTo( 1444.585938, mtheight, -1911.533691)
-mechanic2:walkTo( 1439.008423, mtheight, -1909.659058)
-mechanic2:walkTo( 1421.636230, mtheight, -1915.466553)
-mechanic2:walkTo( 1420.582275, mtheight, -1926.693970)
-mechanic2:walkTo( 1422.506714, mtheight, -1934.938232)
-mechanic2:walkTo( 1430.749023, mtheight, -1942.431519)
-mechanic2:walkTo( 1440.773315, mtheight, -1948.152832)
-mechanic2:walkTo( 1452.532227, mtheight, -1950.169800)
-mechanic2:walkTo( 1465.584961, mtheight, -1949.407959)
-mechanic2:walkTo( 1475.635254, mtheight, -1948.756226)
-mechanic2:walkTo( 1481.961548, mtheight, -1948.346069)
-mechanic2:walkTo( 1495.564575, mtheight, -1947.588257)
-mechanic2:walkTo( 1505.660156, mtheight, -1947.679077)
-mechanic2:walkTo( 1514.055542, mtheight, -1947.901245)
-mechanic2:walkTo( 1523.532959, mtheight, -1948.351440)
-mechanic2:walkTo( 1537.855347, mtheight, -1949.461914)
-mechanic2:walkTo( 1545.510498, mtheight, -1950.162720)
-mechanic2:walkTo( 1553.132935, mtheight, -1950.860718)
-mechanic2:walkTo( 1556.371460, mtheight, -1951.157104)
-mechanic2:walkTo( 1563.450806, mtheight, -1951.804932)
-mechanic2:walkTo( 1572.594116, mtheight, -1952.320679)
-mechanic2:walkTo( 1582.691772, mtheight, -1950.470459)
-mechanic2:walkTo( 1589.872681, mtheight, -1929.683105)
-mechanic2:walkTo( 1587.794922, mtheight, -1922.749756)
-mechanic2:walkTo( 1582.800171, mtheight, -1917.671021)
-mechanic2:walkTo( 1573.449951, mtheight, -1915.750854)
-mechanic2:walkTo( 1564.055908, mtheight, -1914.986328)
-mtprogramRoute = false
-end
-
-mechanic2X = mechanic2:getAbsCoorX()
-mechanic2Y = mechanic2:getAbsCoorY()
-mechanic2Z = mechanic2:getAbsCoorZ()
-
-if dist(mechanic2X,mechanic2Y,mechanic2Z,1435.444824, mtheight, -1916.463013) < 10 and not waiting then
-mechanic2:stop()
-waittime = 5
---io.write("mechanic2 stoped \n")
-waiting = true
-end
-
-if waittime >= 0 and waiting then
-waittime = waittime - timestep
---io.write(waittime,"\n")
-if waittime < 0 then
---io.write("mechanic2 finished waiting\n")
-mechanic2:resume()
-end
-end
-
-if dist(mechanic2X,mechanic2Y,mechanic2Z,1564.473999, mtheight, -1923.821533) < 10 and waiting then
-waiting = false
-end
-
-
-if mechanic2:finalGoalReached() then
-mtprogramRoute = 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)
-mechanictMove(timestep)
-
---if playerReachedTrigger and not spaceshipLaunchReady then
---moveToLaunchSite(timestep)
---end
-
---if spaceshipLaunchReady then
---launchSpaceShip(timestep)
---end
-
-
-return false
-end
Index: ta/trunk/scripts/movechopper.lua
===================================================================
--- /data/trunk/scripts/movechopper.lua	(revision 4447)
+++ 	(revision )
@@ -1,56 +1,0 @@
-targetOneReached = false
-targetTwoReached = false
-time = 0.0
-
-
-function handleTrigger()
-helo:moveUp(true)
-end
-
-function invertTargetReached()
- targetReached = not targetReached
-end
-
-
-function tick(timestep)
- time = timestep+time
- heloYCoord = helo:getAbsCoorY()
- heloXCoord = helo:getAbsCoorX()
- heloZCoord = helo:getAbsCoorZ()
-
---io.write(heloXCoord)
---io.write("\n")
-
- if heloYCoord < 0 and not targetOneReached then
-  heloYCoord = heloYCoord + 1*timestep
- else
-  targetOneReached = true
- end 
-
- if targetOneReached then
-  heloXCoord = heloXCoord + 10*timestep
- end
-
- if heloXCoord > -1445 then
-  heloYCoord = heloYCoord - 1*timestep
-  heloXCoord = heloXCoord - 8*timestep
- end
-
- if heloXCoord > -1440 then
-  targetTwoReached = true
- end
-
- if  heloYCoord < -18 and targetTwoReached then
-  return true;
- end
-
- helo:setAbsCoor(heloXCoord, heloYCoord ,heloZCoord)
- --if time < 1 and not targetReached then
- -- handleTrigger()
- --else
- -- helo:moveUp(false)
- --end
-
- return false
-
-end
Index: ta/trunk/scripts/prisoner.lua
===================================================================
--- /data/trunk/scripts/prisoner.lua	(revision 4447)
+++ 	(revision )
@@ -1,387 +1,0 @@
--- 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")
-thisscript:addObject("FPSPlayer", "Player")
-thisscript:addObject("GenericNPC", "secondguard")
-thisscript:addObject("GenericNPC","guard")
-
-
-cellDoorOpened = false
-walkinCellFinished = false
-cellExitReached = false
-exitReached = false
-hangarReached = false
-spaceShipReached = false
-spaceShipEntered = false
-playerInLock = false
-guardStopped = false
-gotoSpaceship = false
-
-randTime = 0
-height = 36
-
-
-function dist( x1,x2,x3, y1,y2,y3 )
-
-return math.sqrt( (x1-y1)^2 + (x2-y2)^2 + (x3-y3)^2 )
-
-end
-
-function observeGuard()
-guardX = secondguard:getAbsCoorX()
-guardY = secondguard:getAbsCoorY()
-guardZ = secondguard:getAbsCoorZ()
-
-if dist( guardX,guardY,guardZ, -85.456375, height, 171.823486) < 60 then
-cellDoorOpened = true
-end
-
-end
-
-function observePlayer()
-playerX = Player:getAbsCoorX()
-playerY = Player:getAbsCoorY()
-playerZ = Player:getAbsCoorZ()
-
-
-guardX = guard:getAbsCoorX()
-guardY = guard:getAbsCoorY()
-guardZ = guard:getAbsCoorZ()
-
-distance = dist( guardX,guardY,guardZ,playerX, playerY, playerZ)
-
-if dist( playerX,playerY,playerZ,161.76,49,408.87 ) < 50 then
-playerInLock = true
-end
-
-
-if distance > 250 and hangarRouteProgrammed and not guardStopped and not gotoSpaceship then
- prisoner:stop()
- guardStopped = true
-end
-
-if distance < 250 and hangarRouteProgrammed and guardStopped and not gotoSpaceship then
- prisoner:resume()
- guardStopped = false
-end
-
-
-if dist( guardX,guardY,guardZ,772.325012, height, -1500.850708) < 200 then
-gotoSpaceship = true
-end
-
-
-end
-
-walkProgrammed = false
-exitProgrammed = false
-function walkInCell(timestep)
-
-
-if not walkProgrammed then
---prisoner:walkTo( -66.454849, height, 62.363449)
---prisoner:walkTo( -66.454849, height, 62.363449)
-prisoner:walkTo( -63.214821, height, 62.429710)
-prisoner:walkTo( -56.661182, height, 62.563740)
-prisoner:walkTo( -46.779755, height, 62.765827)
-prisoner:walkTo( -41.634224, height, 71.319214)
-prisoner:walkTo( -38.168526, height, 79.655807)
-prisoner:walkTo( -40.782196, height, 101.285233)
-prisoner:walkTo( -47.722874, height, 114.314980)
-prisoner:walkTo( -54.593349, height, 118.605423)
-prisoner:walkTo( -62.802982, height, 117.947144)
-prisoner:walkTo( -73.180130, height, 116.720863)
-prisoner:walkTo( -85.028603, height, 114.952316)
-prisoner:walkTo( -113.125824, height, 96.362946)
-prisoner:walkTo( -118.218887, height, 87.702599)
-prisoner:walkTo( -120.596275, height, 80.304184)
-prisoner:walkTo( -114.928169, height, 68.971840)
-prisoner:walkTo( -108.606766, height, 62.085098)
-prisoner:walkTo( -90.078171, height, 59.558804)
-prisoner:walkTo( -83.558510, height, 60.516567)
-prisoner:walkTo( -71.352402, height, 63.920750)
-walkProgrammed = true
-end
-
-
-if prisoner:finalGoalReached() and not cellDoorOpened then
- walkProgrammed = false
-end
-
-
-if cellDoorOpened then
-
-  if not exitProgrammed then
-prisoner:walkTo( -61.875267, height, 158.254517)
-prisoner:walkTo( -62.335995, height, 170.318756)
-prisoner:walkTo( -62.358681, height, 179.232559)
-prisoner:walkTo( -55.998741, height, 189.289749)
-prisoner:walkTo( -49.237957, height, 195.076263)
-prisoner:walkTo( -39.007496, height, 195.889221)
-prisoner:walkTo( -24.234095, height, 195.547043)
-prisoner:walkTo( -11.409116, height, 196.236069)
-prisoner:walkTo( 2.545602, height, 196.805954)
-prisoner:walkTo( 13.875313, height, 196.377563)
-prisoner:walkTo( 28.379402, height, 195.829132)
-prisoner:walkTo( 41.672989, height, 195.326477)
-prisoner:walkTo( 57.125935, height, 194.742126)
-prisoner:walkTo( 70.114609, height, 194.251007)
-prisoner:walkTo( 81.857407, height, 193.806961)
-prisoner:walkTo( 97.840607, height, 193.974030)
-prisoner:walkTo( 107.569641, height, 196.299652)
-prisoner:walkTo( 120.975266, height, 202.754532)
-prisoner:walkTo( 129.063812, height, 207.099640)
-prisoner:walkTo( 140.468765, height, 214.389191)
-prisoner:walkTo( 145.902267, height, 224.194229)
-prisoner:walkTo( 148.106079, height, 233.095215)
-prisoner:walkTo( 150.907532, height, 244.410049)
-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
-
-  if prisoner:finalGoalReached() then
-   return true
-  end
-
-end 
-
-return false
-
-end
-
-
-hangarRouteProgrammed = false
-function goToHangar(timestep)
-
-if not hangarRouteProgrammed and playerInLock then
-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)
-
-prisoner:walkTo( 775.508972, height, -1457.168213)
-prisoner:walkTo( 776.536743, height, -1462.372925)
-prisoner:walkTo( 778.141663, height, -1470.500732)
-prisoner:walkTo( 779.744995, height, -1478.620117)
-prisoner:walkTo( 782.587646, height, -1489.528198)
-prisoner:walkTo( 785.285156, height, -1497.338013)
-prisoner:walkTo( 788.850159, height, -1506.399414)
-prisoner:walkTo( 792.417053, height, -1515.465820)
-prisoner:walkTo( 796.757446, height, -1525.825684)
-prisoner:walkTo( 802.122009, height, -1534.417847)
-prisoner:walkTo( 808.422058, height, -1541.669067)
-prisoner:walkTo( 816.134949, height, -1549.770508)
-prisoner:walkTo( 824.352783, height, -1557.150024)
-prisoner:walkTo( 832.695801, height, -1563.451172)
-prisoner:walkTo( 843.443665, height, -1571.163818)
-prisoner:walkTo( 850.623901, height, -1576.316284)
-prisoner:walkTo( 859.099182, height, -1580.545166)
-prisoner:walkTo( 868.999939, height, -1585.129028)
-prisoner:walkTo( 879.254211, height, -1588.827148)
-prisoner:walkTo( 888.822021, height, -1592.277832)
-prisoner:walkTo( 895.563293, height, -1594.931885)
-prisoner:walkTo( 900.941589, height, -1597.049438)
-prisoner:walkTo( 907.684387, height, -1599.704102)
-prisoner:walkTo( 914.599243, height, -1604.825928)
-prisoner:walkTo( 919.703430, height, -1609.984619)
-prisoner:walkTo( 925.728088, height, -1616.250977)
-prisoner:walkTo( 930.751343, height, -1621.475830)
-prisoner:walkTo( 934.714905, height, -1625.719360)
-prisoner:walkTo( 940.166260, height, -1631.555664)
-prisoner:walkTo( 946.152344, height, -1637.964600)
-prisoner:walkTo( 953.042297, height, -1646.456421)
-prisoner:walkTo( 958.174194, height, -1654.167847)
-prisoner:walkTo( 964.112854, height, -1663.534424)
-prisoner:walkTo( 968.981812, height, -1670.229248)
-prisoner:walkTo( 975.821045, height, -1678.569946)
-prisoner:walkTo( 982.743835, height, -1687.244385)
-prisoner:walkTo( 990.572571, height, -1697.622559)
-prisoner:walkTo( 995.849670, height, -1704.618164)
-prisoner:walkTo( 1001.152649, height, -1711.648193)
-prisoner:walkTo( 1005.204590, height, -1717.019531)
-prisoner:walkTo( 1012.097412, height, -1725.154907)
-prisoner:walkTo( 1017.283020, height, -1731.152222)
-prisoner:walkTo( 1022.044250, height, -1736.658936)
-prisoner:walkTo( 1028.422852, height, -1744.234863)
-prisoner:walkTo( 1033.080688, height, -1749.780884)
-prisoner:walkTo( 1036.395874, height, -1753.908936)
-prisoner:walkTo( 1040.509155, height, -1759.065186)
-prisoner:walkTo( 1044.627441, height, -1764.227783)
-prisoner:walkTo( 1050.220093, height, -1770.871094)
-prisoner:walkTo( 1054.504883, height, -1775.961060)
-prisoner:walkTo( 1060.259888, height, -1782.490723)
-prisoner:walkTo( 1067.060913, height, -1789.939209)
-prisoner:walkTo( 1072.477173, height, -1795.898315)
-prisoner:walkTo( 1076.556152, height, -1800.990845)
-prisoner:walkTo( 1080.718018, height, -1806.200439)
-prisoner:walkTo( 1085.281494, height, -1811.912476)
-prisoner:walkTo( 1090.934448, height, -1817.621094)
-prisoner:walkTo( 1095.896240, height, -1822.369141)
-prisoner:walkTo( 1100.940430, height, -1827.278564)
-prisoner:walkTo( 1107.045898, height, -1833.460693)
-prisoner:walkTo( 1113.230103, height, -1839.722534)
-
-hangarRouteProgrammed = true
-end
-
-thisX = prisoner:getAbsCoorX()
-thisY = prisoner:getAbsCoorY()
-thisZ = prisoner:getAbsCoorZ()
-
-distance = dist( thisX,thisY,thisZ, 1113.230103, height, -1839.722534)
---io.write(distance,"\n")
-
-if dist( thisX,thisY,thisZ, 1113.230103, height, -1839.722534) < 40 then
-prisoner:hide()
-return true
-end
-
-
-return false
-
-end
-
-spaceshipRouteProgrammed = false
-function goToSpaceship(timestep)
-
-if not spaceshipRouteProgrammed then
-
-
-spaceshipRouteProgrammed = true
-end
-
-if prisoner:finalGoalReached() then
-   return true
-end
-
-return false
-
-end
-
-
-function enterSpaceship(timestep)
-
-return false
-end
-
-
-
-function tick(timestep)
-
- observeGuard()
- observePlayer()
-
-
-if not walkinCellFinished then
-walkinCellFinished = walkInCell(timestep)
-end
-
-
-if walkinCellFinished and not hangarReached then
-hangarReached = goToHangar(timestep)
-end
-
-
-return hangarReached
-end
Index: ta/trunk/scripts/secondguard.lua
===================================================================
--- /data/trunk/scripts/secondguard.lua	(revision 4447)
+++ 	(revision )
@@ -1,343 +1,0 @@
--- 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")
-thisscript:addObject("GenericNPC", "guard")
-thisscript:addObject("FPSPlayer", "Player")
-thisscript:addObject("GenericNPC", "prisoner")
-
--- Global Variables
-allOk = true
-cellReached = false
-guidePositionReached = false
-prisonerReachedLock = false
-hangarReached = false
-guardStopped = false
-letsgo = false
-
-height = 90
-
--- 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 observeGuard()
-guardX = guard:getAbsCoorX()
-guardY = guard:getAbsCoorY()
-guardZ = guard:getAbsCoorZ()
-
-if dist( guardX,guardY,guardZ,35.48, 29, 191.28 ) < 30 then
-allOk = false
-end
-
-end
-
-function observePlayer()
-
-guardX = guard:getAbsCoorX()
-guardY = guard:getAbsCoorY()
-guardZ = guard:getAbsCoorZ()
-
-playerX = Player:getAbsCoorX()
-playerY = Player:getAbsCoorY()
-playerZ = Player:getAbsCoorZ()
-
-distance = dist( guardX,guardY,guardZ,playerX, playerY, playerZ)
-
-if distance > 250 and hangarProgrammed and not guardStopped then
- secondguard:stop()
- guardStopped = true
-end
-
-if distance < 250 and hangarProgrammed and guardStopped then
- secondguard:resume()
- guardStopped = false
-end
-
-if dist( playerX,playerY,playerZ,161.76,49,408.87 ) < 50  then
-letsgo = true
-end
-
-end
-
-
-
-function observePrisoner()
-
-prisonerX = prisoner:getAbsCoorX()
-prisonerY = prisoner:getAbsCoorY()
-prisonerZ = prisoner:getAbsCoorZ()
-
-if dist( prisonerX,prisonerY,prisonerZ,162.757919,49,363.489349 ) < 60 then
---io.write("Prisonner reached lock \n")
-prisonerReachedLock = true
-end
-
-end
-
-cellProgrammed = false
-function goToCell(timestep)
-
-if not cellProgrammed then
-secondguard:walkTo( 442.173767, height, 176.429855)
-secondguard:walkTo( 442.173767, height, 176.429855)
-secondguard:walkTo( 436.727753, height, 188.191757)
-secondguard:walkTo( 432.311584, height, 198.882462)
-secondguard:walkTo( 426.079590, height, 213.968994)
-secondguard:walkTo( 420.553986, height, 226.714996)
-secondguard:walkTo( 412.681915, height, 235.053696)
-secondguard:walkTo( 398.758545, height, 241.846924)
-secondguard:walkTo( 384.690735, height, 242.851395)
-secondguard:walkTo( 348.930481, height, 242.394958)
-secondguard:walkTo( 336.467926, height, 241.985764)
-secondguard:walkTo( 324.042999, height, 241.577774)
-secondguard:walkTo( 303.851410, height, 240.914841)
-secondguard:walkTo( 293.013977, height, 240.559006)
-secondguard:walkTo( 276.207611, height, 240.007233)
-secondguard:walkTo( 261.475800, height, 239.523544)
-secondguard:walkTo( 239.185089, height, 238.791687)
-secondguard:walkTo( 226.655655, height, 238.491974)
-secondguard:walkTo( 211.996979, height, 238.851044)
-secondguard:walkTo( 192.956741, height, 239.859207)
-secondguard:walkTo( 178.496552, height, 241.852539)
-secondguard:walkTo( 160.421860, height, 244.009827)
-secondguard:walkTo( 145.371857, height, 244.946075)
-secondguard:walkTo( 129.918198, height, 245.307037)
-secondguard:walkTo( 113.065468, height, 245.108231)
-secondguard:walkTo( 99.159073, height, 244.695694)
-secondguard:walkTo( 82.069923, height, 244.188766)
-secondguard:walkTo( 65.880531, height, 243.708527)
-secondguard:walkTo( 48.133881, height, 243.182114)
-secondguard:walkTo( 34.706280, height, 242.783813)
-secondguard:walkTo( 20.682344, height, 242.367783)
-secondguard:walkTo( 5.419819, height, 241.915070)
-secondguard:walkTo( -10.556346, height, 241.058746)
-secondguard:walkTo( -24.159513, height, 240.127090)
-secondguard:walkTo( -33.819145, height, 239.995453)
-secondguard:walkTo( -45.414162, height, 240.373322)
-secondguard:walkTo( -60.228550, height, 240.856079)
-secondguard:walkTo( -73.269897, height, 241.260895)
-secondguard:walkTo( -86.128647, height, 240.457886)
-secondguard:walkTo( -100.443581, height, 236.485718)
-secondguard:walkTo( -112.346939, height, 233.967209)
-secondguard:walkTo( -127.331635, height, 227.615112)
-secondguard:walkTo( -135.153656, height, 215.476883)
-secondguard:walkTo( -131.529984, height, 202.931015)
-secondguard:walkTo( -122.671799, height, 193.644669)
-secondguard:walkTo( -113.823517, height, 183.986633)
-secondguard:walkTo( -104.089592, height, 170.659729)
-cellProgrammed = true
-end
-
-if secondguard:finalGoalReached() then
-return true
-end
-
-return false
-end
-
-guideProgrammed = false
-function goToGuidePosition(timestep)
-
-if not guideProgrammed then
-secondguard:walkTo( -100.266739, height, 171.345627)
-secondguard:walkTo( -91.152046, height, 171.639709)
-secondguard:walkTo( -85.456375, height, 171.823486)
-secondguard:walkTo( -74.048538, height, 172.191589)
-secondguard:walkTo( -53.574173, height, 172.852219)
-secondguard:walkTo( -43.275124, height, 173.184540)
-secondguard:walkTo( -35.155544, height, 173.446518)
-secondguard:walkTo( -31.645050, height, 173.559784)
-secondguard:walkTo( -23.426588, height, 173.824966)
-secondguard:walkTo( -10.576803, height, 174.239578)
-secondguard:walkTo( -2.389911, height, 174.503754)
-secondguard:walkTo( 6.950986, height, 174.805176)
-secondguard:walkTo( 16.313608, height, 175.161179)
-secondguard:walkTo( 23.271458, height, 175.547226)
-secondguard:walkTo( 31.248058, height, 176.199890)
-secondguard:walkTo( 43.694778, height, 177.753479)
-secondguard:walkTo( 50.441612, height, 178.595612)
-secondguard:walkTo( 71.374535, height, 181.208389)
-secondguard:walkTo( 82.251022, height, 181.855988)
-secondguard:walkTo( 91.975792, height, 182.434998)
-secondguard:walkTo( 101.695015, height, 183.013672)
-secondguard:walkTo( 110.377205, height, 183.530609)
-secondguard:walkTo( 122.299400, height, 184.240448)
-secondguard:walkTo( 129.848495, height, 184.689911)
-secondguard:walkTo( 141.687805, height, 185.394821)
-secondguard:walkTo( 150.166702, height, 186.776016)
-secondguard:walkTo( 155.342255, height, 189.285080)
-secondguard:walkTo( 162.508133, height, 192.849976)
-secondguard:walkTo( 171.747696, height, 197.075134)
-secondguard:walkTo( 177.846390, height, 199.864029)
-secondguard:walkTo( 182.707596, height, 204.381516)
-secondguard:walkTo( 182.707596, height, 204.381516)
-secondguard:walkTo( 187.317139, height, 211.966385)
-secondguard:walkTo( 193.191528, height, 221.632446)
-secondguard:walkTo( 197.856018, height, 229.307724)
-secondguard:walkTo( 198.350906, height, 232.634857)
-secondguard:walkTo( 198.427155, height, 243.656113)
-
-guideProgrammed = true
-end
-
-if secondguard:finalGoalReached() then
-return true
-end
-
-return false
-end
-
-hangarProgrammed = false
-function goToHangar(timestep)
-
-if not hangarProgrammed and prisonerReachedLock and letsgo then
-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
-
-guardX = secondguard:getAbsCoorX()
-guardY = secondguard:getAbsCoorY()
-guardZ = secondguard:getAbsCoorZ()
-
-if dist( guardX,guardY,guardZ, 2.861493, 29, -1705.131958) < 60 then
-return true
-end
-
-return false
-
-end
-
-time = 2
-function tick(timestep)
---io.write("Secondguard called \n")
- 
-observePrisoner()
-observeGuard()
-observePlayer()
-
-if not allOk then
-cellReached = goToCell(timestep)
-end
-
---do talking
-if cellReached then
-time = time - timestep
-end
-
-
-if time < 0 then
-
-if cellReached and not guidePositionReached then
-guidePositionReached = goToGuidePosition(timestep)
-end
-
-if guidePositionReached and not hangarReached then
-hangarReached = goToHangar(timestep)
-end
-
-if hangarReached then
-return true
-end
-
-
-end
-
-
-return false
-end
Index: ta/trunk/scripts/secondprisoner.lua
===================================================================
--- /data/trunk/scripts/secondprisoner.lua	(revision 4447)
+++ 	(revision )
@@ -1,39 +1,0 @@
--- 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")
-thisscript:addObject("FPSPlayer", "Player")
-
--- Initialises the random number generator
-randinit = false
-function randInit()
-
-if not randinit then
-math.randomseed(os.clock())
-randinit = true
-end
-
-end
-
-
-function scream()
-
-end
-
-function tick(timestep)
-
---io.write("Secondprisoner called \n")
-randInit()
-randNumber = 10 * math.random()
-
-if randNumber > 8 then
-scream()
-end
-
-return false
-end
Index: ta/trunk/scripts/spaceship_flight.lua
===================================================================
--- /data/trunk/scripts/spaceship_flight.lua	(revision 4447)
+++ 	(revision )
@@ -1,71 +1,0 @@
--- 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()
-
-  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
-
-  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/scripts/spacestation/spaceship_tower.lua
===================================================================
--- /data/trunk/scripts/spacestation/spaceship_tower.lua	(revision 4448)
+++ /data/trunk/scripts/spacestation/spaceship_tower.lua	(revision 4448)
@@ -0,0 +1,161 @@
+ -- Create the trigger
+trigger = ScriptTrigger()
+trigger:setName("maintrigger")
+trigger:setScript("spaceship_tower.lua")
+trigger:setFunction("tick")
+trigger:setActiveOnCreation(true)
+
+-- Get objects from orxonox
+thisscript:addObject("FPSPlayer", "Player")
+thisscript:addObject("GenericNPC", "pedestrianOne")
+thisscript:addObject("GenericNPC", "hangarguyOne")
+
+
+-- pedestrian
+pedestrian = { }
+--{
+ function pedestrian:tick(timestep)
+  if pedestrianOne:finalGoalReached() then
+
+    pedestrianOne:walkTo(516.458313, -352, -80.734474)
+    pedestrianOne:walkTo(512.872253, -352, -116.005737)
+    pedestrianOne:walkTo(499.799866, -352, -159.124832)
+    pedestrianOne:walkTo(475.927399, -352, -210.216354)
+    pedestrianOne:walkTo(448.311920, -352, -265.528564)
+    pedestrianOne:walkTo(414.508118, -352, -323.333405)
+    pedestrianOne:walkTo(370.584290, -352, -385.605530)
+    pedestrianOne:walkTo(343.100464, -352, -415.069794)
+    pedestrianOne:walkTo(264.569794, -352, -476.752869)
+    pedestrianOne:walkTo(210.117767, -352, -506.892090)
+    pedestrianOne:walkTo(164.443237, -352, -522.833435)
+    pedestrianOne:walkTo(104.187263, -352, -532.872925)
+    pedestrianOne:walkTo(2.165657, -352, -541.539734)
+    pedestrianOne:walkTo(-83.860703, -352, -536.539429)
+    pedestrianOne:walkTo(-190.057220, -352, -505.938080)
+    pedestrianOne:walkTo(-304.299713, -352, -443.351471)
+    pedestrianOne:walkTo(-386.765076, -352, -389.817383)
+    pedestrianOne:walkTo(-450.359467, -352, -317.446564)
+    pedestrianOne:walkTo(-496.030060, -352, -220.342926)
+    pedestrianOne:walkTo(-519.588379, -352, -123.082298)
+    pedestrianOne:walkTo(-532.314880, -352, -23.615164)
+    pedestrianOne:walkTo(-532.617371, -352, 45.020267)
+    pedestrianOne:walkTo(-523.393188, -352, 122.215889)
+    pedestrianOne:walkTo(-514.028748, -352, 161.396454)
+    pedestrianOne:walkTo(-494.465302, -352, 209.894760)
+    pedestrianOne:walkTo(-442.015442, -352, 297.304840)
+    pedestrianOne:walkTo(-390.615448, -352, 374.627777)
+    pedestrianOne:walkTo(-319.119080, -352, 442.413940)
+    pedestrianOne:walkTo(-217.457092, -352, 494.077393)
+    pedestrianOne:walkTo(-151.378113, -352, 521.028198)
+    pedestrianOne:walkTo(-65.499962, -352, 534.818909)
+    pedestrianOne:walkTo(-12.994286, -352, 543.250610)
+    pedestrianOne:walkTo(43.301056, -352, 545.434570)
+    pedestrianOne:walkTo(111.077263, -352, 542.904480)
+    pedestrianOne:walkTo(159.826782, -352, 531.741943)
+    pedestrianOne:walkTo(218.487457, -352, 509.065948)
+    pedestrianOne:walkTo(276.665436, -352, 477.931427)
+    pedestrianOne:walkTo(332.371368, -352, 443.890839)
+    pedestrianOne:walkTo(378.867981, -352, 401.978882)
+    pedestrianOne:walkTo(415.942627, -352, 345.542542)
+    pedestrianOne:walkTo(453.910004, -352, 273.056732)
+    pedestrianOne:walkTo(488.833588, -352, 204.519592)
+    pedestrianOne:walkTo(512.676575, -352, 145.735123)
+    pedestrianOne:walkTo(525.567139, -352, 66.236511)
+
+  end
+
+ end
+
+--}
+
+
+
+-- hangarguy
+hangarguy = { }
+--{
+
+ hangarguy.routeProgramed = false
+
+ function hangarguy:tick(timestep)
+  if not hangarguy.routeProgramed then
+
+hangarguyOne:walkTo( 4.520885, 35, -715.864136)
+hangarguyOne:walkTo( 4.436781, 35, -710.607483)
+hangarguyOne:walkTo( 4.271256, 35, -700.261902)
+hangarguyOne:walkTo( 4.108314, 35, -690.077698)
+hangarguyOne:walkTo( 2.860425, 35, -612.082458)
+hangarguyOne:walkTo( 2.336200, 35, -579.317566)
+hangarguyOne:walkTo( 19.468971, 35, -558.118713)
+hangarguyOne:walkTo( 58.664307, 35, -541.788879)
+hangarguyOne:walkTo( 102.207947, 35, -538.448669)
+hangarguyOne:walkTo( 148.613098, 35, -525.434814)
+hangarguyOne:walkTo( 194.356705, 35, -510.325592)
+hangarguyOne:walkTo( 241.033600, 35, -493.087036)
+hangarguyOne:walkTo( 280.100891, 35, -476.127960)
+hangarguyOne:walkTo( 317.930084, 35, -459.305878)
+hangarguyOne:walkTo( 352.476410, 35, -435.666595)
+hangarguyOne:walkTo( 372.327820, 35, -421.279785)
+hangarguyOne:walkTo( 399.971436, 35, -395.954559)
+hangarguyOne:walkTo( 416.877686, 35, -362.181549)
+hangarguyOne:walkTo( 432.721222, 35, -311.302490)
+hangarguyOne:walkTo( 469.218750, 35, -233.788040)
+hangarguyOne:walkTo( 487.923004, 35, -200.841125)
+hangarguyOne:walkTo( 506.862518, 35, -162.215515)
+hangarguyOne:walkTo( 529.612061, 35, -115.549751)
+hangarguyOne:walkTo( 542.065125, 35, -88.352898)
+hangarguyOne:walkTo( 558.192444, 35, -39.543404)
+hangarguyOne:walkTo( 559.105713, 35, -34.795399)
+hangarguyOne:walkTo( 563.437378, 35, -31.207838)
+hangarguyOne:walkTo( 575.247192, 35, -21.994106)
+hangarguyOne:walkTo( 590.928040, 35, -15.268648)
+hangarguyOne:walkTo( 660.693298, 35, -4.461691)
+hangarguyOne:walkTo( 666.650879, 35, -2.223409)
+hangarguyOne:walkTo( 668.187927, 35, 4.955472)
+hangarguyOne:walkTo( 671.830505, 35, 21.968117)
+hangarguyOne:walkTo( 675.100159, 35, 37.731144)
+hangarguyOne:walkTo( 677.764221, 35, 53.632107)
+hangarguyOne:walkTo( 677.170837, 35, 62.944923)
+hangarguyOne:walkTo( 675.125671, 35, 81.444199)
+hangarguyOne:walkTo( 674.070251, 35, 97.964783)
+hangarguyOne:walkTo( 674.865112, 35, 112.956894)
+hangarguyOne:walkTo( 683.106750, 35, 123.733559)
+hangarguyOne:walkTo( 697.092224, 35, 130.347214)
+hangarguyOne:walkTo( 711.597778, 35, 134.194839)
+hangarguyOne:walkTo( 731.452209, 35, 133.556061)
+hangarguyOne:walkTo( 744.283691, 35, 127.194984)
+hangarguyOne:walkTo( 754.862183, 35, 113.226959)
+hangarguyOne:walkTo( 759.921082, 35, 101.175034)
+hangarguyOne:walkTo( 765.828674, 35, 86.496742)
+hangarguyOne:walkTo( 772.430176, 35, 70.094063)
+hangarguyOne:walkTo( 778.920776, 35, 53.967388)
+hangarguyOne:walkTo( 786.386292, 35, 36.463428)
+hangarguyOne:walkTo( 806.520142, 35, 25.996820)
+hangarguyOne:walkTo( 867.622192, 35, 17.105639)
+hangarguyOne:walkTo( 897.198181, 35, 13.109496)
+hangarguyOne:walkTo( 929.129517, 35, 9.825047)
+hangarguyOne:walkTo( 987.034302, 35, 6.972207)
+hangarguyOne:walkTo( 1040.090698, 35, 5.634526)
+hangarguyOne:walkTo( 1095.084595, 35, 6.542047)
+hangarguyOne:walkTo( 1137.440552, 35, 8.371919)
+hangarguyOne:walkTo( 1180.903564, 35, 11.816477)
+
+    hangarguy.routeProgramed = true
+
+  end
+
+ end
+
+--}
+
+
+
+-- THE tick function
+
+function tick(timestep)
+--io.write("Towerscript called \n")
+
+pedestrian:tick(timestep)
+hangarguy:tick(timestep)
+
+return false
+end
Index: /data/trunk/scripts/spacestation/switchtohangar.lua
===================================================================
--- /data/trunk/scripts/spacestation/switchtohangar.lua	(revision 4448)
+++ /data/trunk/scripts/spacestation/switchtohangar.lua	(revision 4448)
@@ -0,0 +1,21 @@
+ -- Create the trigger
+trigger = ScriptTrigger()
+trigger:setScript("switchtohangar.lua")
+trigger:setFunction("tick")
+trigger:setAbsCoor(-5.601662, 35, -1264.822632)
+trigger:setTarget("Player")
+trigger:setRadius(200)
+trigger:setTriggerRemains(false)
+trigger:setDebugDraw(true)
+
+
+-- Add Objects
+thisscript:addObject("GameWorld", "Spaceship_Tower")
+
+function tick(timestep)
+
+if Spaceship_Tower:setNextStoryName( "Ambush_at_Uranus" ) then
+Spaceship_Tower:stop()
+end
+return true
+end
Index: ta/trunk/scripts/testflight.lua
===================================================================
--- /data/trunk/scripts/testflight.lua	(revision 4447)
+++ 	(revision )
@@ -1,19 +1,0 @@
--- Create the trigger
-trigger = ScriptTrigger()
-trigger:setName("testflighttrigger")
-trigger:setScript("testflight.lua")
-trigger:setFunction("tick")
-trigger:setActiveOnCreation(true)
-
--- Add Objects
-thisscript:addObject("GameWorld", "Testlevel")
-
--- Global Variables
-horizontalmode = false
-
-function tick(timestep)
-  if not horizontalmode then
-    --Testlevel:setPlaymode("Horizontal")
-  end
-end
-
Index: /data/trunk/scripts/testlevel/testflight.lua
===================================================================
--- /data/trunk/scripts/testlevel/testflight.lua	(revision 4448)
+++ /data/trunk/scripts/testlevel/testflight.lua	(revision 4448)
@@ -0,0 +1,19 @@
+-- Create the trigger
+trigger = ScriptTrigger()
+trigger:setName("testflighttrigger")
+trigger:setScript("testflight.lua")
+trigger:setFunction("tick")
+trigger:setActiveOnCreation(true)
+
+-- Add Objects
+thisscript:addObject("GameWorld", "Testlevel")
+
+-- Global Variables
+horizontalmode = false
+
+function tick(timestep)
+  if not horizontalmode then
+    --Testlevel:setPlaymode("Horizontal")
+  end
+end
+
Index: ta/trunk/scripts/thestranger.lua
===================================================================
--- /data/trunk/scripts/thestranger.lua	(revision 4447)
+++ 	(revision )
@@ -1,36 +1,0 @@
--- Global Variables
-panic = false             -- True if thestranger panics.
-walkingRouteOne = false   -- True if thestranger is walking route one
-
-
-function togglePanic(timestep)
-panic = not panic
-return false
-end
-
-
-function walkRouteOne()
-
-
-end
-
-function flee()
-
-
-end
-
-
-function tick(timestep)
-
-if not walkingRouteOne then
-walkRouteOne()
-routeOneTriggered = true
-end
-
-if panic then
-flee(timestep)
-end
-
-
-return false
-end
Index: /data/trunk/worlds/DefaultCampaign.oxc
===================================================================
--- /data/trunk/worlds/DefaultCampaign.oxc	(revision 4447)
+++ /data/trunk/worlds/DefaultCampaign.oxc	(revision 4448)
@@ -91,6 +91,14 @@
    </SinglePlayerWorld>
 
+<SinglePlayerWorld>
+      <identifier>10</identifier>
+      <nextid>0</nextid>
+      <name>Tower</name>
+      <path>worlds/sp_level_spacestation1.oxw</path>
+      <menu-entry>1</menu-entry>
+   </SinglePlayerWorld>
+
     <MultiPlayerWorld>
-      <identifier>10</identifier>
+      <identifier>200</identifier>
       <nextid>0</nextid>
       <path>worlds/mp_level_arena.oxw</path>
Index: /data/trunk/worlds/desert.oxw
===================================================================
--- /data/trunk/worlds/desert.oxw	(revision 4447)
+++ /data/trunk/worlds/desert.oxw	(revision 4448)
@@ -17,5 +17,5 @@
 
     <Script>
-     <file>movechopper.lua</file>
+     <file>desert/movechopper.lua</file>
      <object>Helicopter, helo</object>
     </Script>
Index: /data/trunk/worlds/sp_level_ambush_at_uranus.oxw
===================================================================
--- /data/trunk/worlds/sp_level_ambush_at_uranus.oxw	(revision 4447)
+++ /data/trunk/worlds/sp_level_ambush_at_uranus.oxw	(revision 4448)
@@ -18,33 +18,33 @@
 
     <Script>
-     <file>guard.lua</file>
-    </Script>
-
-    <Script>
-     <file>secondguard.lua</file>
-    </Script>
-
-    <Script>
-     <file>prisoner.lua</file>
-    </Script>
-
-    <Script>
-     <file>secondprisoner.lua</file>
-    </Script>
-
-    <Script>
-     <file>falldown.lua</file>
-    </Script>
-
-    <Script>
-     <file>floorguy.lua</file>
-    </Script>
-
-    <Script>
-     <file>hangar.lua</file>
-    </Script>
-
-    <Script>
-     <file>spaceship_flight.lua</file>
+     <file>ambush_at_uranus/guard.lua</file>
+    </Script>
+
+    <Script>
+     <file>ambush_at_uranus/secondguard.lua</file>
+    </Script>
+
+    <Script>
+     <file>ambush_at_uranus/prisoner.lua</file>
+    </Script>
+
+    <Script>
+     <file>ambush_at_uranus/secondprisoner.lua</file>
+    </Script>
+
+    <Script>
+     <file>ambush_at_uranus/falldown.lua</file>
+    </Script>
+
+    <Script>
+     <file>ambush_at_uranus/floorguy.lua</file>
+    </Script>
+
+    <Script>
+     <file>ambush_at_uranus/hangar.lua</file>
+    </Script>
+
+    <Script>
+     <file>ambush_at_uranus/spaceship_flight.lua</file>
     </Script>
 
