Changeset 3951
- Timestamp:
- Jun 29, 2006, 6:47:23 PM (18 years ago)
- Location:
- data/branches/single_player_map
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
data/branches/single_player_map/scripts/guard.lua
r3947 r3951 7 7 -- Returns the distance between (x1,x2,x3) and (y1,y2,y3) 8 8 function dist( x1,x2,x3, y1,y2,y3 ) 9 10 9 return math.sqrt( (x1-y1)^2 + (x2-y2)^2 + (x3-y3)^2 ) 11 12 10 end 13 11 14 function stopWalkRouteOne(timestep)15 walkRouteOne = false16 return true17 end18 12 19 13 function observePlayer() … … 32 26 33 27 if not routeOneProgrammed then 34 io.write("Guard called \n") 35 guard:walkTo(-154.592667, 80.000000, 231.381805) 28 --io.write("Guard called \n") 29 guard:walkTo(-132, 29, 238.381805) 30 guard:walkTo(-138.41, 29, 275.25) 31 guard:walkTo(-143.70, 29, 275.35) 32 guard:walkTo(-149.10, 29, 226.66) 33 guard:walkTo(-149.10, 29, 196.83) 34 guard:walkTo(-145.82, 29, 189.74) 35 guard:walkTo(-138.48, 29, 184.28) 36 guard:walkTo(35.48, 29, 191.28) 37 guard:runTo(102, 29, 203.28) 38 guard:runTo(164, 29, 245.28) 39 36 40 routeOneProgrammed = true 37 41 end 38 42 43 if guard:finalGoalReached() then 44 return false 39 45 end 40 46 47 return true 48 end 49 50 51 exitRouteProgrammed = false 41 52 function goToExitPosition(timestep) 53 54 if not exitRouteProgrammed then 55 guard:walkTo(-132, 29, 238.381805) 56 guard:walkTo(-138.41, 29, 275.25) 57 guard:walkTo(-143.70, 29, 275.35) 58 guard:walkTo(-149.10, 29, 226.66) 59 guard:walkTo(-149.10, 29, 196.83) 60 guard:walkTo(-145.82, 29, 189.74) 61 guard:walkTo(-138.48, 29, 184.28) 62 guard:walkTo(35.48, 29, 191.28) 63 guard:runTo(102, 29, 203.28) 64 guard:runTo(164, 29, 245.28) 65 66 exitRouteProgrammed = true 67 end 68 69 if guard:finalGoalReached() and playerInLock then 70 return true 71 end 42 72 43 73 return false … … 45 75 46 76 77 hangarRouteProgrammed = false 47 78 function goToHangar(timestep) 79 80 if not hangarRouteProgrammed then 81 guard:walkTo(-132, 29, 238.381805) 82 guard:walkTo(-138.41, 29, 275.25) 83 guard:walkTo(-143.70, 29, 275.35) 84 guard:walkTo(-149.10, 29, 226.66) 85 guard:walkTo(-149.10, 29, 196.83) 86 guard:walkTo(-145.82, 29, 189.74) 87 guard:walkTo(-138.48, 29, 184.28) 88 guard:walkTo(35.48, 29, 191.28) 89 guard:runTo(102, 29, 203.28) 90 guard:runTo(164, 29, 245.28) 91 92 hangarRouteProgrammed = true 93 end 94 95 if guard:finalGoalReached() then 96 return true 97 end 48 98 49 99 return false … … 61 111 62 112 if walkingRouteOne then 63 walk RouteOne(timestep)113 walkingRouteOne = walkRouteOne(timestep) 64 114 end 65 115 -
data/branches/single_player_map/scripts/secondguard.lua
r3946 r3951 1 1 -- Global Variables 2 2 allOk = true 3 standing= false3 cellReached = false 4 4 guidePositionReached = false 5 5 prisonerReachedLock = false … … 15 15 16 16 17 function alert(timestep) 17 function observeGuard() 18 guardX = guard:getAbsCoorX() 19 guardY = guard:getAbsCoorY() 20 guardZ = guard:getAbsCoorZ() 21 22 if dist( guardX,guardY,guardZ,161.76,49,358.87 ) < 60 then 18 23 allOk = false 19 return true 24 end 25 20 26 end 21 27 22 28 function observePrisoner() 23 29 24 --prisonerX = Prisoner:getAbsCoorX() 25 --prisonerY = Prisoner:getAbsCoorY() 26 --prisonerZ = Prisoner:getAbsCoorZ() 30 prisonerX = Prisoner:getAbsCoorX() 31 prisonerY = Prisoner:getAbsCoorY() 32 prisonerZ = Prisoner:getAbsCoorZ() 33 34 if dist( prisonerX,prisonerY,prisonerZ,161.76,49,358.87 ) < 60 then 35 prisonerReachedLock = true 36 end 27 37 28 38 end 29 39 30 function standUp(timestep) 40 41 function goToCell(timestep) 31 42 32 43 return false … … 49 60 50 61 if not allOk then 51 standing = standUp(timestep)62 cellReached = goToCell(timestep) 52 63 end 53 64 54 if standingand not guidePositionReached then65 if cellReached and not guidePositionReached then 55 66 guidePositionReached = goToGuidePosition(timestep) 56 67 end 57 58 68 59 69 if guidePositionReached and prisonerReachedLock then -
data/branches/single_player_map/worlds/sp_level_ambush_at_jupiter.oxw
r3947 r3951 120 120 </ScriptTrigger> 121 121 122 123 122 </ScriptTriggers> 124 123 … … 154 153 </GenericNPC> 155 154 155 156 <GenericNPC> 157 <name>Prisoner</name> 158 <model>models/creatures/doom_guy.md2, 10</model> 159 <md2texture>doom_guy.png</md2texture> 160 <abs-coor>-69, 29, 74</abs-coor> 161 <abs-dir>-1.55, 0, 1, 0</abs-dir> 162 </GenericNPC> 163 164 <GenericNPC> 165 <name>Secondprisoner</name> 166 <model>models/creatures/doom_guy.md2, 10</model> 167 <md2texture>doom_guy.png</md2texture> 168 <abs-coor>22, 29,121</abs-coor> 169 <abs-dir>-1.55, 0, 1, 0</abs-dir> 170 </GenericNPC> 171 156 172 <GenericNPC> 157 173 <name>statist</name>
Note: See TracChangeset
for help on using the changeset viewer.