Changeset 4080 for data/trunk/scripts/guard.lua
- Timestamp:
- Jul 4, 2006, 12:55:44 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
data/trunk/scripts/guard.lua
r4064 r4080 1 -- Get objects from orxonox 2 thisscript:addObject("GenericNPC","guard") 3 thisscript:addObject("FPSPlayer", "Player") 4 1 5 -- Global Variables 2 6 walkingRouteOne = true -- True if thestranger is walking route one … … 4 8 playerInLock = false 5 9 hangarReached = false 6 7 height = 29 10 guardStopped = false 11 12 height = 34 8 13 9 14 -- Returns the distance between (x1,x2,x3) and (y1,y2,y3) … … 14 19 15 20 function observePlayer() 21 22 guardX = guard:getAbsCoorX() 23 guardY = guard:getAbsCoorY() 24 guardZ = guard:getAbsCoorZ() 25 16 26 playerX = Player:getAbsCoorX() 17 27 playerY = Player:getAbsCoorY() 18 28 playerZ = Player:getAbsCoorZ() 19 29 20 if dist( playerX,playerY,playerZ,167.361526,29,483.163818 ) < 60 then 30 31 distance = dist( guardX,guardY,guardZ,playerX, playerY, playerZ) 32 33 if distance > 250 and hangarRouteProgrammed and not guardStopped then 34 guard:stop() 35 guardStopped = true 36 end 37 38 if distance < 250 and hangarRouteProgrammed and guardStopped then 39 guard:resume() 40 guardStopped = false 41 end 42 43 if dist( playerX,playerY,playerZ,167.361526,29,483.163818 ) < 200 then 21 44 playerInLock = true 22 45 end … … 84 107 85 108 if not exitRouteProgrammed then 86 guard:walkTo( 162.096558, height, 274.944366)87 guard:walkTo( 161.519516, height, 286.673370)88 guard:walkTo( 161.098618, height, 295.228699)89 guard:walkTo( 160.568466, height, 306.004486)90 guard: walkTo( 160.151169, height, 314.486572)91 guard: walkTo( 159.416641, height, 324.925232)109 --guard:runTo( 162.096558, height, 274.944366) 110 --guard:runTo( 161.519516, height, 286.673370) 111 --guard:runTo( 161.098618, height, 295.228699) 112 --guard:runTo( 160.568466, height, 306.004486) 113 guard:runTo( 160.151169, height, 314.486572) 114 guard:runTo( 159.416641, height, 324.925232) 92 115 guard:walkTo( 158.700073, height, 335.108154) 93 116 guard:walkTo( 157.943298, height, 345.862610) … … 123 146 124 147 if not hangarRouteProgrammed and playerInLock then 125 guard:walkTo( 138.422943, height, 504.832733) 126 guard:walkTo( 188.685089, height, 509.034851) 127 guard:walkTo( 259.451904, height, 515.326111) 128 guard:walkTo( 351.655762, height, 519.210571) 129 guard:walkTo( 495.821381, height, 517.551392) 130 guard:walkTo( 650.267029, height, 516.826843) 131 guard:walkTo( 752.277100, height, 506.265289) 132 guard:walkTo( 780.652405, height, 397.283752) 133 guard:walkTo( 780.212830, height, 317.386017) 134 guard:walkTo( 778.699158, height, 241.875305) 135 guard:walkTo( 776.305542, height, 120.869957) 136 guard:walkTo( 774.626343, height, 26.204597) 137 guard:walkTo( 773.148804, height, -30.654911) 138 guard:walkTo( 771.164978, height, -106.990250) 139 guard:walkTo( 756.719971, height, -197.656296) 140 guard:walkTo( 730.690796, height, -269.808075) 141 guard:walkTo( 702.250854, height, -341.732147) 142 guard:walkTo( 681.786011, height, -393.487030) 143 guard:walkTo( 664.005981, height, -441.609131) 144 guard:walkTo( 655.612671, height, -523.194153) 145 guard:walkTo( 664.289978, height, -585.003540) 146 guard:walkTo( 670.221069, height, -645.366333) 147 guard:walkTo( 674.347290, height, -704.953674) 148 guard:walkTo( 677.495605, height, -750.421082) 149 guard:walkTo( 680.699280, height, -796.687073) 150 guard:walkTo( 686.407043, height, -879.117859) 151 guard:walkTo( 692.573364, height, -952.031555) 152 guard:walkTo( 701.940552, height, -1025.037964) 153 guard:walkTo( 710.218628, height, -1086.598389) 154 guard:walkTo( 719.834900, height, -1142.248779) 155 guard:walkTo( 731.087158, height, -1198.201538) 156 guard:walkTo( 745.157715, height, -1258.461182) 157 guard:walkTo( 753.189331, height, -1290.539551) 158 guard:walkTo( 763.940369, height, -1347.249268) 159 guard:walkTo( 768.509949, height, -1377.040039) 160 guard:walkTo( 770.845215, height, -1408.751953) 161 guard:walkTo( 770.785583, height, -1435.573608) 162 guard:walkTo( 765.031799, height, -1462.657593) 163 guard:walkTo( 753.982727, height, -1483.425415) 164 guard:walkTo( 735.194580, height, -1500.978394) 165 guard:walkTo( 707.312500, height, -1514.814575) 166 guard:walkTo( 672.638550, height, -1522.803589) 167 guard:walkTo( 560.158936, height, -1530.277344) 168 guard:walkTo( 500.429626, height, -1532.241577) 169 guard:walkTo( 371.231262, height, -1535.953613) 170 guard:walkTo( 204.211609, height, -1539.026611) 171 guard:walkTo( 104.032593, height, -1546.350220) 172 guard:walkTo( 45.058315, height, -1550.720337) 173 guard:walkTo( 1.504358, height, -1574.713745) 174 guard:walkTo( -20.050890, height, -1627.849854) 175 guard:walkTo( -28.036245, height, -1674.240479) 176 guard:walkTo( -29.157598, height, -1702.924316) 177 guard:walkTo( -29.760004, height, -1730.014526) 178 guard:walkTo( -29.538343, height, -1759.887329) 179 guard:walkTo( -21.584003, height, -1790.162842) 180 guard:walkTo( -8.572795, height, -1823.067871) 181 guard:walkTo( 13.254844, height, -1861.705688) 148 149 guard:walkTo( 133.354797, height, 504.669128) 150 guard:walkTo( 147.490158, height, 507.034393) 151 guard:walkTo( 157.640610, height, 508.901001) 152 guard:walkTo( 168.830688, height, 510.958710) 153 guard:walkTo( 185.020630, height, 512.736206) 154 guard:walkTo( 201.232452, height, 513.413818) 155 guard:walkTo( 265.666138, height, 513.736023) 156 guard:walkTo( 362.377960, height, 515.575806) 157 guard:walkTo( 426.176392, height, 515.666748) 158 guard:walkTo( 500.031677, height, 515.197266) 159 guard:walkTo( 551.294250, height, 514.430237) 160 guard:walkTo( 604.974731, height, 515.106323) 161 guard:walkTo( 651.117920, height, 516.026550) 162 guard:walkTo( 664.581909, height, 516.295227) 163 guard:walkTo( 683.122803, height, 516.665100) 164 guard:walkTo( 694.547485, height, 516.892944) 165 guard:walkTo( 704.408569, height, 517.089539) 166 guard:walkTo( 714.413208, height, 517.289185) 167 guard:walkTo( 739.045288, height, 515.581970) 168 guard:walkTo( 763.904541, height, 497.281738) 169 guard:walkTo( 767.672791, height, 481.974457) 170 guard:walkTo( 769.436951, height, 468.704559) 171 guard:walkTo( 770.490967, height, 453.283386) 172 guard:walkTo( 771.185303, height, 435.960114) 173 guard:walkTo( 771.952820, height, 379.502045) 174 guard:walkTo( 771.938293, height, 310.049042) 175 guard:walkTo( 772.514526, height, 231.579498) 176 guard:walkTo( 773.601074, height, 135.177933) 177 guard:walkTo( 773.790771, height, 50.675163) 178 guard:walkTo( 773.316162, height, -36.961666) 179 guard:walkTo( 772.885986, height, -116.407944) 180 guard:walkTo( 772.841309, height, -124.651726) 181 guard:walkTo( 772.491333, height, -137.742279) 182 guard:walkTo( 770.644775, height, -153.245926) 183 guard:walkTo( 768.774414, height, -163.767120) 184 guard:walkTo( 766.336426, height, -174.224228) 185 guard:walkTo( 762.794128, height, -187.312271) 186 guard:walkTo( 733.548279, height, -274.004791) 187 guard:walkTo( 713.113647, height, -329.657959) 188 guard:walkTo( 694.801819, height, -379.530243) 189 guard:walkTo( 681.276062, height, -422.047028) 190 guard:walkTo( 672.579102, height, -458.540985) 191 guard:walkTo( 670.843384, height, -465.824615) 192 guard:walkTo( 669.948364, height, -480.910645) 193 guard:walkTo( 669.361511, height, -493.648529) 194 guard:walkTo( 669.686829, height, -501.598572) 195 guard:walkTo( 674.055664, height, -582.077637) 196 guard:walkTo( 676.046387, height, -630.403809) 197 guard:walkTo( 677.839050, height, -674.209534) 198 guard:walkTo( 680.754944, height, -765.965515) 199 guard:walkTo( 681.034180, height, -803.351135) 200 guard:walkTo( 680.088806, height, -844.069031) 201 guard:walkTo( 677.801514, height, -899.952148) 202 guard:walkTo( 675.205627, height, -950.496460) 203 guard:walkTo( 672.847778, height, -996.413574) 204 guard:walkTo( 676.204041, height, -1043.556274) 205 guard:walkTo( 691.304382, height, -1088.596558) 206 guard:walkTo( 705.101318, height, -1128.320312) 207 guard:walkTo( 720.476013, height, -1164.364380) 208 guard:walkTo( 729.216797, height, -1183.948364) 209 guard:walkTo( 740.145203, height, -1212.598267) 210 guard:walkTo( 746.547363, height, -1238.340576) 211 guard:walkTo( 756.866211, height, -1280.605347) 212 guard:walkTo( 763.380554, height, -1314.622314) 213 guard:walkTo( 768.731506, height, -1347.977539) 214 guard:walkTo( 772.446655, height, -1381.641479) 215 guard:walkTo( 772.721069, height, -1421.184937) 216 guard:walkTo( 772.414734, height, -1457.349121) 217 guard:walkTo( 772.803284, height, -1489.560913) 218 182 219 hangarRouteProgrammed = true 183 220 end
Note: See TracChangeset
for help on using the changeset viewer.