Changeset 4100 for data/branches/presentation/scripts/hangar.lua
- Timestamp:
- Jul 4, 2006, 3:22:11 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
data/branches/presentation/scripts/hangar.lua
r4080 r4100 5 5 thisscript:addObject("SpaceShip", "spaceship") 6 6 thisscript:addObject("GenericNPC", "mechanic") 7 thisscript:addObject("GenericNPC", "mechanic2") 7 8 8 9 -- Global Variables … … 40 41 41 42 42 programRoute = true43 mprogramRoute = true 43 44 mheight = 5 44 45 function mechanicMove(timestep) 45 if programRoute then46 if mprogramRoute then 46 47 47 48 mechanic:walkTo( 991.192261, mheight, -1878.394287) … … 112 113 mechanic:walkTo( 1019.079651, mheight, -1878.196777) 113 114 114 programRoute = false115 mprogramRoute = false 115 116 end 116 117 117 118 if mechanic:finalGoalReached() then 118 programRoute = true 119 end 120 121 end 122 119 mprogramRoute = true 120 end 121 122 end 123 124 mtprogramRoute = true 125 mtheight = 5 126 waittime = 0 127 waiting = false 128 function mechanictMove(timestep) 129 if mtprogramRoute then 130 mechanic2:walkTo( 1564.473999, mtheight, -1923.821533) 131 mechanic2:walkTo( 1556.049927, mtheight, -1916.359009) 132 mechanic2:walkTo( 1550.970581, mtheight, -1913.087524) 133 mechanic2:walkTo( 1542.345459, mtheight, -1912.611938) 134 mechanic2:walkTo( 1534.643677, mtheight, -1912.361816) 135 mechanic2:walkTo( 1524.490845, mtheight, -1912.074097) 136 mechanic2:walkTo( 1516.120605, mtheight, -1912.511475) 137 mechanic2:walkTo( 1508.607788, mtheight, -1912.904175) 138 mechanic2:walkTo( 1498.452759, mtheight, -1913.434814) 139 mechanic2:walkTo( 1492.513916, mtheight, -1913.744995) 140 mechanic2:walkTo( 1483.056274, mtheight, -1914.239136) 141 mechanic2:walkTo( 1471.428711, mtheight, -1916.435303) 142 mechanic2:walkTo( 1460.068359, mtheight, -1916.473022) 143 mechanic2:walkTo( 1451.006592, mtheight, -1913.691772) 144 mechanic2:walkTo( 1444.585938, mtheight, -1911.533691) 145 mechanic2:walkTo( 1439.008423, mtheight, -1909.659058) 146 mechanic2:walkTo( 1421.636230, mtheight, -1915.466553) 147 mechanic2:walkTo( 1420.582275, mtheight, -1926.693970) 148 mechanic2:walkTo( 1422.506714, mtheight, -1934.938232) 149 mechanic2:walkTo( 1430.749023, mtheight, -1942.431519) 150 mechanic2:walkTo( 1440.773315, mtheight, -1948.152832) 151 mechanic2:walkTo( 1452.532227, mtheight, -1950.169800) 152 mechanic2:walkTo( 1465.584961, mtheight, -1949.407959) 153 mechanic2:walkTo( 1475.635254, mtheight, -1948.756226) 154 mechanic2:walkTo( 1481.961548, mtheight, -1948.346069) 155 mechanic2:walkTo( 1495.564575, mtheight, -1947.588257) 156 mechanic2:walkTo( 1505.660156, mtheight, -1947.679077) 157 mechanic2:walkTo( 1514.055542, mtheight, -1947.901245) 158 mechanic2:walkTo( 1523.532959, mtheight, -1948.351440) 159 mechanic2:walkTo( 1537.855347, mtheight, -1949.461914) 160 mechanic2:walkTo( 1545.510498, mtheight, -1950.162720) 161 mechanic2:walkTo( 1553.132935, mtheight, -1950.860718) 162 mechanic2:walkTo( 1556.371460, mtheight, -1951.157104) 163 mechanic2:walkTo( 1563.450806, mtheight, -1951.804932) 164 mechanic2:walkTo( 1572.594116, mtheight, -1952.320679) 165 mechanic2:walkTo( 1582.691772, mtheight, -1950.470459) 166 mechanic2:walkTo( 1589.872681, mtheight, -1929.683105) 167 mechanic2:walkTo( 1587.794922, mtheight, -1922.749756) 168 mechanic2:walkTo( 1582.800171, mtheight, -1917.671021) 169 mechanic2:walkTo( 1573.449951, mtheight, -1915.750854) 170 mechanic2:walkTo( 1564.055908, mtheight, -1914.986328) 171 mtprogramRoute = false 172 end 173 174 mechanic2X = mechanic2:getAbsCoorX() 175 mechanic2Y = mechanic2:getAbsCoorY() 176 mechanic2Z = mechanic2:getAbsCoorZ() 177 178 if dist(mechanic2X,mechanic2Y,mechanic2Z,1435.444824, mtheight, -1916.463013) < 10 and not waiting then 179 mechanic2:stop() 180 waittime = 5 181 --io.write("mechanic2 stoped \n") 182 waiting = true 183 end 184 185 if waittime >= 0 and waiting then 186 waittime = waittime - timestep 187 --io.write(waittime,"\n") 188 if waittime < 0 then 189 --io.write("mechanic2 finished waiting\n") 190 mechanic2:resume() 191 end 192 end 193 194 if dist(mechanic2X,mechanic2Y,mechanic2Z,1564.473999, mtheight, -1923.821533) < 10 and waiting then 195 waiting = false 196 end 197 198 199 if mechanic2:finalGoalReached() then 200 mtprogramRoute = true 201 end 202 203 end 123 204 124 205 … … 156 237 if not spaceShipReleased then 157 238 --spaceshipclaw:playAnimation(1,1) 158 io.write("release spaceship\n")239 --io.write("release spaceship\n") 159 240 spaceShipReleased = true 160 241 playerEnteredSpaceShip = true … … 226 307 observePlayer() 227 308 mechanicMove(timestep) 309 mechanictMove(timestep) 228 310 229 311 if playerReachedTrigger and not spaceshipLaunchReady then
Note: See TracChangeset
for help on using the changeset viewer.