- Timestamp:
- Jul 3, 2006, 9:10:39 PM (18 years ago)
- Location:
- data/branches/single_player_map
- Files:
-
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
data/branches/single_player_map/scripts/floorguy.lua
r4066 r4070 4 4 5 5 programRoute = true 6 height = 106 height = -10 7 7 8 8 function tick(timestep) -
data/branches/single_player_map/scripts/guard.lua
r4067 r4070 10 10 guardStopped = false 11 11 12 height = 2912 height = 34 13 13 14 14 -- Returns the distance between (x1,x2,x3) and (y1,y2,y3) … … 31 31 distance = dist( guardX,guardY,guardZ,playerX, playerY, playerZ) 32 32 33 --io.write(distance, " \n") 34 35 if dist( guardX,guardY,guardZ,playerX, playerY, playerZ) > 150 and hangarRouteProgrammed and not guardStopped then 36 io.write("guard stopped\n") 33 if distance > 250 and hangarRouteProgrammed and not guardStopped then 37 34 guard:stop() 38 35 guardStopped = true 39 36 end 40 37 41 if dist( guardX,guardY,guardZ,playerX, playerY, playerZ) < 150 and hangarRouteProgrammed and guardStopped then 42 io.write("guard resumed\n") 38 if distance < 250 and hangarRouteProgrammed and guardStopped then 43 39 guard:resume() 44 40 guardStopped = false 45 41 end 46 42 47 if dist( playerX,playerY,playerZ,167.361526,29,483.163818 ) < 60 then43 if dist( playerX,playerY,playerZ,167.361526,29,483.163818 ) < 200 then 48 44 playerInLock = true 49 45 end … … 150 146 151 147 if not hangarRouteProgrammed and playerInLock then 152 guard:walkTo( 120.981117, height, 503.008972) 148 153 149 guard:walkTo( 133.354797, height, 504.669128) 154 150 guard:walkTo( 147.490158, height, 507.034393) -
data/branches/single_player_map/scripts/hangar.lua
r4065 r4070 4 4 thisscript:addObject("FPSPlayer", "Player") 5 5 thisscript:addObject("SpaceShip", "spaceship") 6 thisscript:addObject(" SpaceShip", "spaceship2")6 thisscript:addObject("GenericNPC", "mechanic") 7 7 8 8 -- Global Variables … … 24 24 function observePlayer() 25 25 26 playerEnteredSpaceShip = spaceship:hasPlayer()26 --playerEnteredSpaceShip = spaceship:hasPlayer() 27 27 28 28 playerX = Player:getAbsCoorX() … … 30 30 playerZ = Player:getAbsCoorZ() 31 31 32 if dist( playerX,playerY,playerZ, 167.361526,29,483.163818 ) < 60 then32 if dist( playerX,playerY,playerZ,678.946838, -11.959779, -920.512634 ) < 200 then 33 33 playerReachedTrigger = true 34 34 end 35 35 36 36 end 37 38 39 40 41 42 programRoute = true 43 mheight = 5 44 function mechanicMove(timestep) 45 if programRoute then 46 47 mechanic:walkTo( 991.192261, mheight, -1878.394287) 48 mechanic:walkTo( 976.976685, mheight, -1879.182129) 49 mechanic:walkTo( 963.752625, mheight, -1880.202881) 50 mechanic:walkTo( 948.094543, mheight, -1880.980713) 51 mechanic:walkTo( 931.008606, mheight, -1880.974854) 52 mechanic:walkTo( 917.888428, mheight, -1880.832764) 53 mechanic:walkTo( 901.552368, mheight, -1880.655762) 54 mechanic:walkTo( 886.475220, mheight, -1880.522949) 55 mechanic:walkTo( 872.041504, mheight, -1880.545410) 56 mechanic:walkTo( 851.380249, mheight, -1880.577637) 57 mechanic:walkTo( 840.637512, mheight, -1880.594238) 58 mechanic:walkTo( 828.564941, mheight, -1880.489868) 59 mechanic:walkTo( 811.580322, mheight, -1880.085205) 60 mechanic:walkTo( 801.953003, mheight, -1880.036377) 61 mechanic:walkTo( 784.801086, mheight, -1880.280762) 62 mechanic:walkTo( 774.514343, mheight, -1880.380005) 63 mechanic:walkTo( 762.351746, mheight, -1880.248779) 64 mechanic:walkTo( 750.737549, mheight, -1880.123413) 65 mechanic:walkTo( 739.186890, mheight, -1879.999023) 66 mechanic:walkTo( 728.210022, mheight, -1879.880371) 67 mechanic:walkTo( 717.243835, mheight, -1879.761719) 68 mechanic:walkTo( 708.253235, mheight, -1879.649048) 69 mechanic:walkTo( 695.825867, mheight, -1877.611938) 70 mechanic:walkTo( 687.077820, mheight, -1869.800659) 71 mechanic:walkTo( 683.886963, mheight, -1859.888062) 72 mechanic:walkTo( 685.589905, mheight, -1844.102051) 73 mechanic:walkTo( 686.333069, mheight, -1837.212524) 74 mechanic:walkTo( 687.256042, mheight, -1828.656860) 75 mechanic:walkTo( 688.759583, mheight, -1820.024048) 76 mechanic:walkTo( 690.621216, mheight, -1809.834595) 77 mechanic:walkTo( 692.045593, mheight, -1803.566772) 78 mechanic:walkTo( 695.021851, mheight, -1795.320923) 79 mechanic:walkTo( 703.956360, mheight, -1789.028931) 80 mechanic:walkTo( 711.400574, mheight, -1785.378418) 81 mechanic:walkTo( 720.236267, mheight, -1782.750977) 82 mechanic:walkTo( 741.346130, mheight, -1786.131836) 83 mechanic:walkTo( 744.505798, mheight, -1788.214111) 84 mechanic:walkTo( 753.788513, mheight, -1796.320557) 85 mechanic:walkTo( 760.480408, mheight, -1804.107788) 86 mechanic:walkTo( 765.918274, mheight, -1811.952393) 87 mechanic:walkTo( 772.114990, mheight, -1823.565674) 88 mechanic:walkTo( 776.130737, mheight, -1830.713989) 89 mechanic:walkTo( 781.833313, mheight, -1836.770996) 90 mechanic:walkTo( 796.051880, mheight, -1843.499512) 91 mechanic:walkTo( 805.178101, mheight, -1844.844116) 92 mechanic:walkTo( 816.733154, mheight, -1846.198608) 93 mechanic:walkTo( 830.296326, mheight, -1844.374146) 94 mechanic:walkTo( 841.234680, mheight, -1841.184814) 95 mechanic:walkTo( 853.356201, mheight, -1837.650391) 96 mechanic:walkTo( 866.242981, mheight, -1833.892944) 97 mechanic:walkTo( 877.006836, mheight, -1830.820923) 98 mechanic:walkTo( 889.236816, mheight, -1828.092773) 99 mechanic:walkTo( 897.856689, mheight, -1826.204346) 100 mechanic:walkTo( 909.685486, mheight, -1823.613037) 101 mechanic:walkTo( 922.058777, mheight, -1819.907227) 102 mechanic:walkTo( 933.861328, mheight, -1814.044800) 103 mechanic:walkTo( 943.290588, mheight, -1809.960205) 104 mechanic:walkTo( 952.188293, mheight, -1806.317261) 105 mechanic:walkTo( 985.450745, mheight, -1800.297729) 106 mechanic:walkTo( 1000.339722, mheight, -1800.916626) 107 mechanic:walkTo( 1013.447937, mheight, -1802.642090) 108 mechanic:walkTo( 1022.703430, mheight, -1808.694946) 109 mechanic:walkTo( 1030.242554, mheight, -1821.859253) 110 mechanic:walkTo( 1030.063354, mheight, -1839.935547) 111 mechanic:walkTo( 1025.804932, mheight, -1864.135986) 112 mechanic:walkTo( 1019.079651, mheight, -1878.196777) 113 114 programRoute = false 115 end 116 117 if mechanic:finalGoalReached() then 118 programRoute = true 119 end 120 121 end 122 123 124 125 126 127 128 37 129 38 130 … … 42 134 43 135 if not positionReached then 44 dx = 1 * timestep136 dx = 10 * timestep 45 137 dy = 0 * timestep 46 dz = 1* timestep138 dz = 0* timestep 47 139 end 48 140 49 141 if not spaceShipReleased and positionReached then 50 142 dx = 0 * timestep 51 dy = -1* timestep143 dy = 10 * timestep 52 144 dz = 0 * timestep 53 145 end … … 63 155 64 156 if not spaceShipReleased then 65 spaceshipclaw:playAnimation(1,1) 157 --spaceshipclaw:playAnimation(1,1) 158 io.write("release spaceship\n") 66 159 spaceShipReleased = true 67 end 68 69 if clawY > 100 then 160 playerEnteredSpaceShip = true 161 end 162 163 --if clawY > 100 then 70 164 spaceshipLaunchReady = true 71 end165 --end 72 166 73 167 end … … 75 169 76 170 -- set new coordinates 77 clawX = claw:getAbsCoorX() 78 clawY = claw:getAbsCoorY() 79 clawZ = claw:getAbsCoorZ() 80 81 claw:setAbsCoor(clawX + dx, clawY + dy, clawZ + dz) 82 83 84 85 if dist( clawX,clawY,clawZ,167.361526,29,483.163818 ) < 60 then 171 --clawX = claw:getAbsCoorX() 172 --clawY = claw:getAbsCoorY() 173 --clawZ = claw:getAbsCoorZ() 174 175 --claw:setAbsCoor(clawX + dx, clawY + dy, clawZ + dz) 176 spaceshipX = spaceship:getAbsCoorX() 177 spaceshipY = spaceship:getAbsCoorY() 178 spaceshipZ = spaceship:getAbsCoorZ() 179 180 spaceship:setAbsCoor(spaceshipX + dx, spaceshipY + dy, spaceshipZ + dz) 181 182 183 184 --if dist( clawX,clawY,clawZ,1020.025024, -11.959781, -1721.614380 ) < 60 then 185 if dist( spaceshipX,spaceshipY,spaceshipZ,1020.025024, -11.959781, -1721.614380 ) < 60 then 86 186 positionReached = true 87 187 end 88 188 89 189 90 if dist( clawX,clawY,clawZ,167.361526,29,483.163818 ) < 60 then 190 --if dist( clawX,clawY,clawZ,167.361526,29,483.163818 ) < 60 then 191 if spaceshipY > 10 then 91 192 spaceshipOnPad = true 92 193 end 93 194 94 195 95 end --observePlayer196 end 96 197 97 198 hoverPosReached = false … … 103 204 dz = 0 * timestep 104 205 else 105 dx = 1* timestep206 dx = 200 * timestep 106 207 dy = 0 * timestep 107 dz = 1* timestep208 dz = 0 * timestep 108 209 end 109 210 … … 114 215 spaceship:setAbsCoor(spaceshipX + dx, spaceshipY + dy, spaceshipZ + dz) 115 216 116 if spaceshipY > 50then217 if spaceshipY > 15 then 117 218 hoverPosReached = true 118 219 end … … 122 223 123 224 function tick(timestep) 124 --io.write("Spaceship called \n") 225 125 226 observePlayer() 126 127 if playerReachedTrigger then 128 --moveToLaunchSite(timestep) 227 mechanicMove(timestep) 228 229 if playerReachedTrigger and not spaceshipLaunchReady then 230 moveToLaunchSite(timestep) 129 231 end 130 232 131 233 if spaceshipLaunchReady then 132 --launchSpaceShip(timestep)234 launchSpaceShip(timestep) 133 235 end 134 236 -
data/branches/single_player_map/scripts/prisoner.lua
r4068 r4070 17 17 18 18 randTime = 0 19 height = 2919 height = 34 20 20 21 21 … … 47 47 guardZ = guard:getAbsCoorZ() 48 48 49 50 if dist( playerX,playerY,playerZ,161.76,49,358.87 ) < 60 then 49 distance = dist( guardX,guardY,guardZ,playerX, playerY, playerZ) 50 51 if dist( playerX,playerY,playerZ,161.76,49,358.87 ) < 100 then 51 52 playerInLock = true 52 53 end 53 54 54 55 55 if dist ( guardX,guardY,guardZ,playerX, playerY, playerZ) > 150 and hangarProgrammed then56 if distance > 250 and hangarRouteProgrammed and not guardStopped then 56 57 prisoner:stop() 57 58 guardStopped = true 58 59 end 59 60 60 if dist ( guardX,guardY,guardZ,playerX, playerY, playerZ) < 150 and hangarProgrammed and guardStopped then61 if distance < 250 and hangarRouteProgrammed and guardStopped then 61 62 prisoner:resume() 62 63 guardStopped = false … … 129 130 prisoner:walkTo( 153.191757, height, 253.635788) 130 131 prisoner:walkTo( 153.191757, height, 253.635788) 132 prisoner:walkTo( 151.838257, height, 257.185974) 133 prisoner:walkTo( 153.967865, height, 270.535095) 134 prisoner:walkTo( 156.288605, height, 284.582123) 135 prisoner:walkTo( 158.034988, height, 300.072937) 136 prisoner:walkTo( 158.817184, height, 311.973724) 137 prisoner:walkTo( 159.794891, height, 326.848816) 138 prisoner:walkTo( 160.789093, height, 342.474060) 139 prisoner:walkTo( 161.391815, height, 357.817505) 140 prisoner:walkTo( 162.055618, height, 374.715668) 141 prisoner:walkTo( 161.595901, height, 389.146759) 142 prisoner:walkTo( 160.607056, height, 407.092896) 143 prisoner:walkTo( 160.508041, height, 416.996307) 144 131 145 exitProgrammed = true 132 146 end … … 147 161 148 162 if not hangarRouteProgrammed and playerInLock then 149 prisoner:walkTo( 153.801224, height, 253.259750)150 prisoner:walkTo( 156.047333, height, 263.016998)151 prisoner:walkTo( 158.592575, height, 275.126709)152 prisoner:walkTo( 160.208252, height, 284.592896)153 prisoner:walkTo( 161.436462, height, 293.934601)154 prisoner:walkTo( 162.154053, height, 299.829407)155 prisoner:walkTo( 162.288696, height, 307.149750)156 prisoner:walkTo( 161.846405, height, 314.288727)157 prisoner:walkTo( 161.481949, height, 320.171295)158 prisoner:walkTo( 161.149612, height, 331.675751)159 prisoner:walkTo( 160.959152, height, 344.682129)160 prisoner:walkTo( 161.191635, height, 359.230835)161 prisoner:walkTo( 161.436386, height, 364.404175)162 prisoner:walkTo( 161.829483, height, 372.712799)163 prisoner:walkTo( 162.251343, height, 382.889465)164 prisoner:walkTo( 162.375793, height, 391.746979)165 prisoner:walkTo( 162.433640, height, 399.580994)166 prisoner:walkTo( 162.492249, height, 407.515991)167 163 prisoner:walkTo( 162.624390, height, 425.402435) 168 164 prisoner:walkTo( 162.666931, height, 431.160980) -
data/branches/single_player_map/scripts/secondguard.lua
r4068 r4070 13 13 guardStopped = false 14 14 15 height = 8015 height = 90 16 16 17 17 -- Returns the distance between (x1,x2,x3) and (y1,y2,y3) … … 42 42 playerZ = Player:getAbsCoorZ() 43 43 44 if dist( guardX,guardY,guardZ,playerX, playerY, playerZ) > 150 and hangarProgrammed then 44 distance = dist( guardX,guardY,guardZ,playerX, playerY, playerZ) 45 46 if distance > 250 and hangarProgrammed and not guardStopped then 45 47 secondguard:stop() 46 48 guardStopped = true 47 49 end 48 50 49 if dist ( guardX,guardY,guardZ,playerX, playerY, playerZ) < 150 and hangarProgrammed and guardStopped then50 --secondguard:continue()51 if distance < 250 and hangarProgrammed and guardStopped then 52 secondguard:resume() 51 53 guardStopped = false 52 54 end … … 134 136 135 137 if not guideProgrammed then 136 secondguard:walkTo( -104.757011, height, 171.200729)137 138 secondguard:walkTo( -100.266739, height, 171.345627) 138 139 secondguard:walkTo( -91.152046, height, 171.639709) -
data/branches/single_player_map/worlds/sp_level_ambush_at_jupiter.oxw
r4066 r4070 42 42 43 43 <Script> 44 <file> spaceship.lua</file>44 <file>hangar.lua</file> 45 45 </Script> 46 46 … … 96 96 97 97 <ScriptTrigger> 98 <name> spaceshiptrigger</name>99 <file> spaceship.lua</file>100 <function>tick</function> 101 <abs-coor> -84, 19, 77</abs-coor>98 <name>hangartrigger</name> 99 <file>hangar.lua</file> 100 <function>tick</function> 101 <abs-coor>678.946838, -11.959779, -920.512634</abs-coor> 102 102 <radius>100</radius> 103 103 <worldentity>Player</worldentity> … … 134 134 <GenericNPC> 135 135 <name>guard</name> 136 <model>models/creatures/ doom_guy.md2, 10</model>137 <md2texture> doom_guy.png</md2texture>138 <abs-coor>275.33, 29, 241.26</abs-coor>136 <model>models/creatures/male.md2, 10</model> 137 <md2texture>male_viper.pcx</md2texture> 138 <abs-coor>275.33, 34, 241.26</abs-coor> 139 139 <abs-dir>-3.1, 0, 1, 0</abs-dir> 140 140 </GenericNPC> … … 142 142 <GenericNPC> 143 143 <name>secondguard</name> 144 <model>models/creatures/ doom_guy.md2, 10</model>145 <md2texture> doom_guy.png</md2texture>146 <abs-coor>440, 80, 180</abs-coor>144 <model>models/creatures/male.md2, 10</model> 145 <md2texture>male_freakmagnet.pcx</md2texture> 146 <abs-coor>440, 90, 180</abs-coor> 147 147 <abs-dir>-3.1, 0, 1, 0</abs-dir> 148 148 </GenericNPC> … … 151 151 <GenericNPC> 152 152 <name>prisoner</name> 153 <model>models/creatures/ doom_guy.md2, 10</model>154 <md2texture> doom_guy.png</md2texture>155 <abs-coor>-69, 29, 74</abs-coor>153 <model>models/creatures/male.md2, 10</model> 154 <md2texture>male_albat.pcx</md2texture> 155 <abs-coor>-69,34, 74</abs-coor> 156 156 <abs-dir>-1.55, 0, 1, 0</abs-dir> 157 157 </GenericNPC> … … 159 159 <GenericNPC> 160 160 <name>Secondprisoner</name> 161 <model>models/creatures/ doom_guy.md2, 10</model>162 <md2texture> doom_guy.png</md2texture>163 <abs-coor>2 2, 29,121</abs-coor>161 <model>models/creatures/male.md2, 10</model> 162 <md2texture>male_fiend.pcx</md2texture> 163 <abs-coor>20, 34,110</abs-coor> 164 164 <abs-dir>-1.55, 0, 1, 0</abs-dir> 165 165 </GenericNPC> … … 167 167 <GenericNPC> 168 168 <name>statist</name> 169 <model>models/creatures/ doom_guy.md2, 10</model>170 <md2texture> doom_guy.png</md2texture>171 <abs-coor>-58, 29, 496</abs-coor>169 <model>models/creatures/male.md2, 10</model> 170 <md2texture>male_sarge.pcx</md2texture> 171 <abs-coor>-58, 34, 496</abs-coor> 172 172 <abs-dir>0, 0, 1, 0</abs-dir> 173 173 </GenericNPC> … … 175 175 <GenericNPC> 176 176 <name>statist2</name> 177 <model>models/creatures/ doom_guy.md2, 10</model>178 <md2texture> doom_guy.png</md2texture>179 <abs-coor>-65, 29, 528</abs-coor>177 <model>models/creatures/male.md2, 10</model> 178 <md2texture>male_sarge.pcx</md2texture> 179 <abs-coor>-65, 34, 528</abs-coor> 180 180 <abs-dir>0, 0, 1, 0</abs-dir> 181 181 </GenericNPC> … … 183 183 <GenericNPC> 184 184 <name>floorguy</name> 185 <model>models/creatures/doom_guy.md2, 10</model> 186 <md2texture>doom_guy.png</md2texture> 187 <abs-coor>800.634338, 29, -340.454163</abs-coor> 188 <abs-dir>0, 0, 1, 0</abs-dir> 189 </GenericNPC> 190 185 <model>models/creatures/male.md2, 10</model> 186 <md2texture>male_sarge.pcx</md2texture> 187 <abs-coor>800.634338, -10, -340.454163</abs-coor> 188 <abs-dir>0, 0, 1, 0</abs-dir> 189 </GenericNPC> 190 191 <GenericNPC> 192 <name>mechanic</name> 193 <model>models/creatures/male.md2, 10</model> 194 <md2texture>male_navy2.pcx</md2texture> 195 <abs-coor>991.192261, 5, -1878.394287</abs-coor> 196 <abs-dir>0, 0, 1, 0</abs-dir> 197 </GenericNPC> 191 198 192 199 <TestEntity> … … 209 216 <name>repair station 01</name> 210 217 <scale>80.0</scale> 211 <abs-coor> 20.139891, 10, -1861.332275</abs-coor>218 <abs-coor>814.349670, -21.959781, -1695.255981</abs-coor> 212 219 </RepairStation> 213 220 … … 220 227 </FPSPlayer> 221 228 229 222 230 <SpaceShip> 223 231 <name>spaceship</name> 224 <model>models/ships/reap_#.obj</model> 225 <abs-coor>-11.863, -30.102, 83.226</abs-coor> 232 <model>models/ships/fighter.obj,20</model> 233 <abs-coor>624.164124, 0.004610, -1721.440796</abs-coor> 234 </SpaceShip> 235 236 <SpaceShip> 237 <name>spaceship1</name> 238 <model>models/ships/reap_#.obj,20</model> 239 <abs-coor>1160.289307, -10.959778, -1874.250732</abs-coor> 226 240 <abs-dir> -1.5,0,1,0 </abs-dir> 227 241 </SpaceShip> 228 242 243 <SpaceShip> 244 <name>spaceship2</name> 245 <model>models/ships/mantawing.obj,20</model> 246 <abs-coor>1373.289307, -10.959778, -1874.250732</abs-coor> 247 <abs-dir> -1.5,0,1,0 </abs-dir> 248 </SpaceShip> 249 250 251 <SpaceShip> 252 <name>spaceship3</name> 253 <model>models/ships/powerdrifter.obj,15</model> 254 <abs-coor>811.904358, -11.959779, -1698.305786</abs-coor> 255 </SpaceShip> 229 256 230 257
Note: See TracChangeset
for help on using the changeset viewer.