Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 30, 2006, 5:29:32 PM (18 years ago)
Author:
snellen
Message:

scripts updated

Location:
data/branches/single_player_map
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • data/branches/single_player_map/scripts/guard.lua

    r3964 r3965  
    1818playerZ = Player:getAbsCoorZ()
    1919
    20 if dist( playerX,playerY,playerZ,161.76,49,358.87 ) < 60 then
     20if dist( playerX,playerY,playerZ,167.361526,29,483.163818 ) < 60 then
    2121playerInLock = true
    2222end
     
    6060guard:walkTo( -137.526047, height, 192.228226)
    6161guard:walkTo( -103.046753, height, 182.510071)
    62 guard:walkTo( -14.992087, height, 181.910767)
    63 guard:walkTo( 46.347664, height, 181.493317)
    64 guard:walkTo( 86.343376, height, 181.221130)
    65 guard:walkTo( 124.465179, height, 194.251617)
    66 guard:walkTo( 136.548996, height, 219.682953)
    67 guard:walkTo( 145.162140, height, 244.268982)
    68 guard:walkTo( 149.328720, height, 256.993256)
    69 guard:walkTo( 162.649582, height, 268.181732)
     62guard:runTo( -14.992087, height, 181.910767)
     63guard:runTo( 46.347664, height, 181.493317)
     64guard:runTo( 86.343376, height, 181.221130)
     65guard:runTo( 124.465179, height, 194.251617)
     66guard:runTo( 136.548996, height, 219.682953)
     67guard:runTo( 145.162140, height, 244.268982)
     68guard:runTo( 149.328720, height, 256.993256)
     69guard:runTo( 162.649582, height, 268.181732)
    7070
    7171routeOneProgrammed = true
  • data/branches/single_player_map/scripts/prisoner.lua

    r3964 r3965  
    1919
    2020function observeGuard()
    21 guardX = guard:getAbsCoorX()
    22 guardY = guard:getAbsCoorY()
    23 guardZ = guard:getAbsCoorZ()
    24 
    25 if dist( guardX,guardY,guardZ, 198.427155, 29, 243.656113 ) < 60 then
     21guardX = secondguard:getAbsCoorX()
     22guardY = secondguard:getAbsCoorY()
     23guardZ = secondguard:getAbsCoorZ()
     24
     25if dist( guardX,guardY,guardZ, 43.406876, 29, 179.517303) < 60 then
    2626cellDoorOpened = true
    2727end
     
    4040end
    4141
     42
     43
    4244walkProgrammed = false
    4345exitProgrammed = false
    4446function walkInCell(timestep)
     47
    4548
    4649if not walkProgrammed then
     
    7174
    7275if prisoner:finalGoalReached() and not cellDoorOpened then
    73    walkProgrammed = false
    74   end
     76 walkProgrammed = false
     77end
     78
    7579
    7680if cellDoorOpened then
     
    109113  end
    110114
    111  end
    112 
    113 return false
    114 
    115 end
    116 
    117 
    118 return false
    119 
    120 end
    121 
    122 
    123 gotoExitProgrammed = false
    124 function goToExit(timestep)
    125 -- do not forget to make him wait until the player triggeres the trip to the hangar
    126 if not gotoExitProgrammed and playerInLock then
    127 
    128 gotoExitProgrammed = true
     115end
     116
     117return false
     118
     119end
     120
     121
     122hangarRouteProgrammed = false
     123function goToHangar(timestep)
     124
     125if not hangarRouteProgrammed and playerInLock then
     126prisoner:walkTo( 149.255554, height, 253.358582)
     127prisoner:walkTo( 155.679886, height, 274.126282)
     128prisoner:walkTo( 157.556641, height, 285.543640)
     129prisoner:walkTo( 159.016068, height, 294.552338)
     130prisoner:walkTo( 160.234924, height, 303.494812)
     131prisoner:walkTo( 161.399475, height, 313.532013)
     132prisoner:walkTo( 162.218994, height, 323.290924)
     133prisoner:walkTo( 162.030823, height, 335.226715)
     134prisoner:walkTo( 161.351410, height, 378.328094)
     135prisoner:walkTo( 161.183487, height, 388.983093)
     136prisoner:walkTo( 160.590225, height, 426.615540)
     137prisoner:walkTo( 160.313049, height, 444.198425)
     138prisoner:walkTo( 160.410721, height, 454.192413)
     139prisoner:walkTo( 161.796692, height, 465.085663)
     140prisoner:walkTo( 163.096069, height, 474.038086)
     141prisoner:walkTo( 165.596329, height, 485.415924)
     142prisoner:walkTo( 167.407303, height, 493.229279)
     143prisoner:walkTo( 169.595749, height, 499.048309)
     144prisoner:walkTo( 173.485214, height, 504.383026)
     145prisoner:walkTo( 182.131546, height, 510.774567)
     146prisoner:walkTo( 187.788422, height, 512.870789)
     147prisoner:walkTo( 196.524994, height, 514.751892)
     148prisoner:walkTo( 205.403473, height, 515.840271)
     149prisoner:walkTo( 205.403473, height, 515.840271)
     150prisoner:walkTo( 220.813049, height, 515.886658)
     151prisoner:walkTo( 392.501221, height, 516.405579)
     152prisoner:walkTo( 441.405975, height, 516.502502)
     153prisoner:walkTo( 513.379517, height, 515.572266)
     154prisoner:walkTo( 586.638611, height, 514.625244)
     155prisoner:walkTo( 651.319214, height, 513.789246)
     156prisoner:walkTo( 680.890869, height, 513.406982)
     157prisoner:walkTo( 701.035828, height, 512.568359)
     158prisoner:walkTo( 716.025879, height, 510.741150)
     159prisoner:walkTo( 723.756042, height, 509.009583)
     160prisoner:walkTo( 733.522095, height, 504.761475)
     161prisoner:walkTo( 738.782104, height, 501.529327)
     162prisoner:walkTo( 744.840637, height, 496.154846)
     163prisoner:walkTo( 750.059875, height, 487.892670)
     164prisoner:walkTo( 753.419373, height, 477.053894)
     165prisoner:walkTo( 754.661743, height, 470.759735)
     166prisoner:walkTo( 765.877319, height, 397.575897)
     167prisoner:walkTo( 768.522522, height, 360.462250)
     168prisoner:walkTo( 769.531250, height, 326.195801)
     169prisoner:walkTo( 770.420532, height, 286.531830)
     170prisoner:walkTo( 769.840393, height, 238.220535)
     171prisoner:walkTo( 771.094543, height, 172.138474)
     172prisoner:walkTo( 772.765137, height, 94.427673)
     173prisoner:walkTo( 771.779175, height, 62.094421)
     174prisoner:walkTo( 771.069336, height, 35.182930)
     175prisoner:walkTo( 769.679199, height, 4.657598)
     176prisoner:walkTo( 768.049377, height, -23.208313)
     177prisoner:walkTo( 766.691711, height, -54.609066)
     178prisoner:walkTo( 765.022156, height, -85.732277)
     179prisoner:walkTo( 763.538635, height, -110.417847)
     180prisoner:walkTo( 761.547485, height, -143.547577)
     181prisoner:walkTo( 760.982483, height, -147.543091)
     182prisoner:walkTo( 756.619934, height, -163.474457)
     183prisoner:walkTo( 751.651611, height, -180.926727)
     184prisoner:walkTo( 739.842041, height, -216.826782)
     185prisoner:walkTo( 716.715149, height, -294.878693)
     186prisoner:walkTo( 698.400146, height, -365.404541)
     187prisoner:walkTo( 692.199890, height, -396.395386)
     188prisoner:walkTo( 685.157593, height, -437.489929)
     189prisoner:walkTo( 678.175537, height, -475.680817)
     190prisoner:walkTo( 674.907837, height, -505.428314)
     191prisoner:walkTo( 674.588501, height, -531.477478)
     192prisoner:walkTo( 674.703308, height, -550.883789)
     193prisoner:walkTo( 675.315063, height, -567.361206)
     194prisoner:walkTo( 676.178345, height, -583.178772)
     195prisoner:walkTo( 678.579407, height, -638.655518)
     196prisoner:walkTo( 689.508118, height, -884.296448)
     197prisoner:walkTo( 690.749084, height, -917.750366)
     198prisoner:walkTo( 691.617676, height, -933.357056)
     199prisoner:walkTo( 696.260742, height, -972.685669)
     200prisoner:walkTo( 698.526550, height, -990.077209)
     201prisoner:walkTo( 705.576599, height, -1033.587646)
     202prisoner:walkTo( 719.388611, height, -1111.123657)
     203prisoner:walkTo( 724.847229, height, -1137.902832)
     204prisoner:walkTo( 729.118652, height, -1159.426514)
     205prisoner:walkTo( 733.152161, height, -1179.577393)
     206prisoner:walkTo( 737.474365, height, -1200.200684)
     207prisoner:walkTo( 740.808777, height, -1216.996216)
     208prisoner:walkTo( 748.261108, height, -1252.447021)
     209prisoner:walkTo( 748.648682, height, -1254.182983)
     210prisoner:walkTo( 752.690430, height, -1272.386719)
     211prisoner:walkTo( 755.726562, height, -1286.795532)
     212prisoner:walkTo( 758.134705, height, -1302.620117)
     213prisoner:walkTo( 759.900879, height, -1317.258911)
     214prisoner:walkTo( 760.405212, height, -1357.575195)
     215prisoner:walkTo( 760.203979, height, -1396.744385)
     216prisoner:walkTo( 759.262085, height, -1433.674316)
     217prisoner:walkTo( 758.916016, height, -1447.247437)
     218prisoner:walkTo( 757.844910, height, -1474.596558)
     219prisoner:walkTo( 756.331238, height, -1484.150269)
     220prisoner:walkTo( 754.152283, height, -1491.574585)
     221prisoner:walkTo( 750.549561, height, -1497.667236)
     222prisoner:walkTo( 741.115356, height, -1509.581177)
     223prisoner:walkTo( 733.292236, height, -1516.592407)
     224prisoner:walkTo( 724.755798, height, -1522.380615)
     225prisoner:walkTo( 712.188721, height, -1528.557495)
     226prisoner:walkTo( 707.279907, height, -1530.261841)
     227prisoner:walkTo( 698.749390, height, -1532.002563)
     228prisoner:walkTo( 681.891785, height, -1532.067871)
     229prisoner:walkTo( 625.072388, height, -1531.572266)
     230prisoner:walkTo( 501.572601, height, -1533.919922)
     231prisoner:walkTo( 237.189667, height, -1538.984985)
     232prisoner:walkTo( 146.071304, height, -1540.965820)
     233prisoner:walkTo( 88.186996, height, -1549.110962)
     234prisoner:walkTo( 85.715096, height, -1549.537842)
     235prisoner:walkTo( 66.997787, height, -1552.770264)
     236prisoner:walkTo( 52.632504, height, -1555.359009)
     237prisoner:walkTo( 38.350941, height, -1560.845459)
     238prisoner:walkTo( 26.315248, height, -1568.211060)
     239prisoner:walkTo( 15.210221, height, -1580.474121)
     240prisoner:walkTo( 6.527347, height, -1594.483398)
     241prisoner:walkTo( 3.175952, height, -1610.220093)
     242
     243hangarRouteProgrammed = true
     244end
     245
     246thisX = prisoner:getAbsCoorX()
     247thisY = prisoner:getAbsCoorY()
     248thisZ = prisoner:getAbsCoorZ()
     249
     250if dist( thisX,thisY,thisZ, 3.175952, 29, -1610.220093) < 60 then
     251return true
     252end
     253
     254
     255return false
     256
     257end
     258
     259spaceshipRouteProgrammed = false
     260function goToSpaceship(timestep)
     261
     262if not spaceshipRouteProgrammed then
     263
     264
     265spaceshipRouteProgrammed = true
    129266end
    130267
     
    134271
    135272return false
    136 end
    137 
    138 hangarRouteProgrammed = false
    139 function goToHangar(timestep)
    140 
    141 if not hangarRouteProgrammed then
    142 
    143 hangarRouteProgrammed = true
    144 end
    145 
    146 if prisoner:finalGoalReached() then
    147    return true
    148 end
    149 
    150 return false
    151 
    152 end
    153 
    154 spaceshipRouteProgrammed = false
    155 function goToSpaceship(timestep)
    156 
    157 if not spaceshipRouteProgrammed then
    158 
    159 
    160 spaceshipRouteProgrammed = true
    161 end
    162 
    163 if prisoner:finalGoalReached() then
    164    return true
    165 end
    166 
    167 return false
    168273
    169274end
     
    183288
    184289
    185 if not cellDoorOpend then
     290if not walkinCellFinished then
    186291walkinCellFinished = walkInCell(timestep)
    187292end
    188293
    189 if walkinCellFinished and not exitReached then
    190 exitReached = goToExit(timestep)
    191 end
    192 
    193 if exitReached and not hangarReached then
     294
     295if walkinCellFinished and not hangarReached then
    194296hangarReached = goToHangar(timestep)
    195297end
  • data/branches/single_player_map/scripts/secondguard.lua

    r3964 r3965  
    1919guardZ = guard:getAbsCoorZ()
    2020
    21 if dist( guardX,guardY,guardZ,35.48, 29, 191.28 ) < 60 then
     21if dist( guardX,guardY,guardZ,35.48, 29, 191.28 ) < 30 then
    2222allOk = false
    2323end
     
    3232
    3333if dist( prisonerX,prisonerY,prisonerZ,162.757919,49,363.489349 ) < 60 then
    34 io.write("Prisonner reached lock \n")
    35 --prisonerReachedLock = true
     34--io.write("Prisonner reached lock \n")
     35prisonerReachedLock = true
    3636end
    3737
     
    283283end
    284284
    285 if secondguard:finalGoalReached() then
     285guardX = secondguard:getAbsCoorX()
     286guardY = secondguard:getAbsCoorY()
     287guardZ = secondguard:getAbsCoorZ()
     288
     289if dist( guardX,guardY,guardZ, 2.861493, 29, -1705.131958) < 60 then
    286290return true
    287291end
     
    291295end
    292296
     297time = 2
    293298function tick(timestep)
    294299--io.write("Secondguard called \n")
     
    301306end
    302307
     308--do talking
     309if cellReached then
     310time = time - timestep
     311end
     312
     313
     314if time < 0 then
     315
    303316if cellReached and not guidePositionReached then
    304317guidePositionReached = goToGuidePosition(timestep)
     
    313326end
    314327
     328
     329end
     330
     331
    315332return false
    316333end
  • data/branches/single_player_map/worlds/sp_level_ambush_at_jupiter.oxw

    r3964 r3965  
    3535     <object>GenericNPC, prisoner</object>
    3636     <object>FPSPlayer, Player</object>
    37      <object>GenericNPC, guard</object>
     37     <object>GenericNPC, secondguard</object>
    3838    </Script>
    3939
     
    4747     <file>falldown.lua</file>
    4848     <object>GenericNPC, Fallingguy </object>
     49     <object>FPSPlayer, Player</object>
     50    </Script>
     51
     52    <Script>
     53     <file>floorguy.lua</file>
     54     <object>GenericNPC, floorguy </object>
    4955     <object>FPSPlayer, Player</object>
    5056    </Script>
     
    115121     <name>spaceshiptrigger</name>
    116122     <file>spaceship.lua</file>
     123     <function>tick</function>
     124     <abs-coor>-84, 19, 77</abs-coor>
     125     <radius>100</radius>
     126     <worldentity>Player</worldentity>
     127     <debugdraw>true</debugdraw>
     128    </ScriptTrigger>
     129
     130
     131<ScriptTrigger>
     132     <name>floorguytrigger</name>
     133     <file>floorguy.lua</file>
    117134     <function>tick</function>
    118135     <abs-coor>-84, 19, 77</abs-coor>
     
    185202       <md2texture>doom_guy.png</md2texture>
    186203       <abs-coor>-65, 29, 528</abs-coor>
     204       <abs-dir>0, 0, 1, 0</abs-dir>
     205    </GenericNPC>
     206
     207    <GenericNPC>
     208       <name>floorguy</name>
     209       <model>models/creatures/doom_guy.md2, 10</model>
     210       <md2texture>doom_guy.png</md2texture>
     211       <abs-coor>800.634338, 29, -340.454163</abs-coor>
    187212       <abs-dir>0, 0, 1, 0</abs-dir>
    188213    </GenericNPC>
Note: See TracChangeset for help on using the changeset viewer.