Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 4, 2006, 3:22:11 PM (18 years ago)
Author:
snellen
Message:

continued working

File:
1 edited

Legend:

Unmodified
Added
Removed
  • data/branches/presentation/scripts/hangar.lua

    r4080 r4100  
    55thisscript:addObject("SpaceShip", "spaceship")
    66thisscript:addObject("GenericNPC", "mechanic")
     7thisscript:addObject("GenericNPC", "mechanic2")
    78
    89-- Global Variables
     
    4041
    4142
    42 programRoute = true
     43mprogramRoute = true
    4344mheight = 5
    4445function mechanicMove(timestep)
    45 if programRoute then
     46if mprogramRoute then
    4647
    4748mechanic:walkTo( 991.192261, mheight, -1878.394287)
     
    112113mechanic:walkTo( 1019.079651, mheight, -1878.196777)
    113114
    114 programRoute = false
     115mprogramRoute = false
    115116end
    116117
    117118if mechanic:finalGoalReached() then
    118 programRoute = true
    119 end
    120 
    121 end
    122 
     119mprogramRoute = true
     120end
     121
     122end
     123
     124mtprogramRoute = true
     125mtheight = 5
     126waittime = 0
     127waiting = false
     128function mechanictMove(timestep)
     129if mtprogramRoute then
     130mechanic2:walkTo( 1564.473999, mtheight, -1923.821533)
     131mechanic2:walkTo( 1556.049927, mtheight, -1916.359009)
     132mechanic2:walkTo( 1550.970581, mtheight, -1913.087524)
     133mechanic2:walkTo( 1542.345459, mtheight, -1912.611938)
     134mechanic2:walkTo( 1534.643677, mtheight, -1912.361816)
     135mechanic2:walkTo( 1524.490845, mtheight, -1912.074097)
     136mechanic2:walkTo( 1516.120605, mtheight, -1912.511475)
     137mechanic2:walkTo( 1508.607788, mtheight, -1912.904175)
     138mechanic2:walkTo( 1498.452759, mtheight, -1913.434814)
     139mechanic2:walkTo( 1492.513916, mtheight, -1913.744995)
     140mechanic2:walkTo( 1483.056274, mtheight, -1914.239136)
     141mechanic2:walkTo( 1471.428711, mtheight, -1916.435303)
     142mechanic2:walkTo( 1460.068359, mtheight, -1916.473022)
     143mechanic2:walkTo( 1451.006592, mtheight, -1913.691772)
     144mechanic2:walkTo( 1444.585938, mtheight, -1911.533691)
     145mechanic2:walkTo( 1439.008423, mtheight, -1909.659058)
     146mechanic2:walkTo( 1421.636230, mtheight, -1915.466553)
     147mechanic2:walkTo( 1420.582275, mtheight, -1926.693970)
     148mechanic2:walkTo( 1422.506714, mtheight, -1934.938232)
     149mechanic2:walkTo( 1430.749023, mtheight, -1942.431519)
     150mechanic2:walkTo( 1440.773315, mtheight, -1948.152832)
     151mechanic2:walkTo( 1452.532227, mtheight, -1950.169800)
     152mechanic2:walkTo( 1465.584961, mtheight, -1949.407959)
     153mechanic2:walkTo( 1475.635254, mtheight, -1948.756226)
     154mechanic2:walkTo( 1481.961548, mtheight, -1948.346069)
     155mechanic2:walkTo( 1495.564575, mtheight, -1947.588257)
     156mechanic2:walkTo( 1505.660156, mtheight, -1947.679077)
     157mechanic2:walkTo( 1514.055542, mtheight, -1947.901245)
     158mechanic2:walkTo( 1523.532959, mtheight, -1948.351440)
     159mechanic2:walkTo( 1537.855347, mtheight, -1949.461914)
     160mechanic2:walkTo( 1545.510498, mtheight, -1950.162720)
     161mechanic2:walkTo( 1553.132935, mtheight, -1950.860718)
     162mechanic2:walkTo( 1556.371460, mtheight, -1951.157104)
     163mechanic2:walkTo( 1563.450806, mtheight, -1951.804932)
     164mechanic2:walkTo( 1572.594116, mtheight, -1952.320679)
     165mechanic2:walkTo( 1582.691772, mtheight, -1950.470459)
     166mechanic2:walkTo( 1589.872681, mtheight, -1929.683105)
     167mechanic2:walkTo( 1587.794922, mtheight, -1922.749756)
     168mechanic2:walkTo( 1582.800171, mtheight, -1917.671021)
     169mechanic2:walkTo( 1573.449951, mtheight, -1915.750854)
     170mechanic2:walkTo( 1564.055908, mtheight, -1914.986328)
     171mtprogramRoute = false
     172end
     173
     174mechanic2X = mechanic2:getAbsCoorX()
     175mechanic2Y = mechanic2:getAbsCoorY()
     176mechanic2Z = mechanic2:getAbsCoorZ()
     177
     178if dist(mechanic2X,mechanic2Y,mechanic2Z,1435.444824, mtheight, -1916.463013) < 10 and not waiting then
     179mechanic2:stop()
     180waittime = 5
     181--io.write("mechanic2 stoped \n")
     182waiting = true
     183end
     184
     185if waittime >= 0 and waiting then
     186waittime = waittime - timestep
     187--io.write(waittime,"\n")
     188if waittime < 0 then
     189--io.write("mechanic2 finished waiting\n")
     190mechanic2:resume()
     191end
     192end
     193
     194if dist(mechanic2X,mechanic2Y,mechanic2Z,1564.473999, mtheight, -1923.821533) < 10 and waiting then
     195waiting = false
     196end
     197
     198
     199if mechanic2:finalGoalReached() then
     200mtprogramRoute = true
     201end
     202
     203end
    123204
    124205
     
    156237if not spaceShipReleased then
    157238--spaceshipclaw:playAnimation(1,1)
    158 io.write("release spaceship\n")
     239--io.write("release spaceship\n")
    159240spaceShipReleased = true
    160241playerEnteredSpaceShip = true
     
    226307observePlayer()
    227308mechanicMove(timestep)
     309mechanictMove(timestep)
    228310
    229311if playerReachedTrigger and not spaceshipLaunchReady then
Note: See TracChangeset for help on using the changeset viewer.