Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4070 for data/branches


Ignore:
Timestamp:
Jul 3, 2006, 9:10:39 PM (18 years ago)
Author:
snellen
Message:

continued implementation

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  
    44
    55programRoute = true
    6 height = 10
     6height = -10
    77
    88function tick(timestep)
  • data/branches/single_player_map/scripts/guard.lua

    r4067 r4070  
    1010guardStopped = false
    1111
    12 height = 29
     12height = 34
    1313
    1414-- Returns the distance between (x1,x2,x3) and (y1,y2,y3)
     
    3131distance = dist( guardX,guardY,guardZ,playerX, playerY, playerZ)
    3232
    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")
     33if distance > 250 and hangarRouteProgrammed and not guardStopped then
    3734 guard:stop()
    3835 guardStopped = true
    3936end
    4037
    41 if dist( guardX,guardY,guardZ,playerX, playerY, playerZ) < 150 and hangarRouteProgrammed and guardStopped then
    42 io.write("guard resumed\n")
     38if distance < 250 and hangarRouteProgrammed and guardStopped then
    4339 guard:resume()
    4440 guardStopped = false
    4541end
    4642
    47 if dist( playerX,playerY,playerZ,167.361526,29,483.163818 ) < 60 then
     43if dist( playerX,playerY,playerZ,167.361526,29,483.163818 ) < 200 then
    4844playerInLock = true
    4945end
     
    150146
    151147if not hangarRouteProgrammed and playerInLock then
    152 guard:walkTo( 120.981117, height, 503.008972)
     148
    153149guard:walkTo( 133.354797, height, 504.669128)
    154150guard:walkTo( 147.490158, height, 507.034393)
  • data/branches/single_player_map/scripts/hangar.lua

    r4065 r4070  
    44thisscript:addObject("FPSPlayer", "Player")
    55thisscript:addObject("SpaceShip", "spaceship")
    6 thisscript:addObject("SpaceShip", "spaceship2")
     6thisscript:addObject("GenericNPC", "mechanic")
    77
    88-- Global Variables
     
    2424function observePlayer()
    2525
    26 playerEnteredSpaceShip = spaceship:hasPlayer()
     26--playerEnteredSpaceShip = spaceship:hasPlayer()
    2727
    2828playerX = Player:getAbsCoorX()
     
    3030playerZ = Player:getAbsCoorZ()
    3131
    32 if dist( playerX,playerY,playerZ,167.361526,29,483.163818 ) < 60 then
     32if dist( playerX,playerY,playerZ,678.946838, -11.959779, -920.512634 ) < 200 then
    3333playerReachedTrigger = true
    3434end
    3535
    3636end
     37
     38
     39
     40
     41
     42programRoute = true
     43mheight = 5
     44function mechanicMove(timestep)
     45if programRoute then
     46
     47mechanic:walkTo( 991.192261, mheight, -1878.394287)
     48mechanic:walkTo( 976.976685, mheight, -1879.182129)
     49mechanic:walkTo( 963.752625, mheight, -1880.202881)
     50mechanic:walkTo( 948.094543, mheight, -1880.980713)
     51mechanic:walkTo( 931.008606, mheight, -1880.974854)
     52mechanic:walkTo( 917.888428, mheight, -1880.832764)
     53mechanic:walkTo( 901.552368, mheight, -1880.655762)
     54mechanic:walkTo( 886.475220, mheight, -1880.522949)
     55mechanic:walkTo( 872.041504, mheight, -1880.545410)
     56mechanic:walkTo( 851.380249, mheight, -1880.577637)
     57mechanic:walkTo( 840.637512, mheight, -1880.594238)
     58mechanic:walkTo( 828.564941, mheight, -1880.489868)
     59mechanic:walkTo( 811.580322, mheight, -1880.085205)
     60mechanic:walkTo( 801.953003, mheight, -1880.036377)
     61mechanic:walkTo( 784.801086, mheight, -1880.280762)
     62mechanic:walkTo( 774.514343, mheight, -1880.380005)
     63mechanic:walkTo( 762.351746, mheight, -1880.248779)
     64mechanic:walkTo( 750.737549, mheight, -1880.123413)
     65mechanic:walkTo( 739.186890, mheight, -1879.999023)
     66mechanic:walkTo( 728.210022, mheight, -1879.880371)
     67mechanic:walkTo( 717.243835, mheight, -1879.761719)
     68mechanic:walkTo( 708.253235, mheight, -1879.649048)
     69mechanic:walkTo( 695.825867, mheight, -1877.611938)
     70mechanic:walkTo( 687.077820, mheight, -1869.800659)
     71mechanic:walkTo( 683.886963, mheight, -1859.888062)
     72mechanic:walkTo( 685.589905, mheight, -1844.102051)
     73mechanic:walkTo( 686.333069, mheight, -1837.212524)
     74mechanic:walkTo( 687.256042, mheight, -1828.656860)
     75mechanic:walkTo( 688.759583, mheight, -1820.024048)
     76mechanic:walkTo( 690.621216, mheight, -1809.834595)
     77mechanic:walkTo( 692.045593, mheight, -1803.566772)
     78mechanic:walkTo( 695.021851, mheight, -1795.320923)
     79mechanic:walkTo( 703.956360, mheight, -1789.028931)
     80mechanic:walkTo( 711.400574, mheight, -1785.378418)
     81mechanic:walkTo( 720.236267, mheight, -1782.750977)
     82mechanic:walkTo( 741.346130, mheight, -1786.131836)
     83mechanic:walkTo( 744.505798, mheight, -1788.214111)
     84mechanic:walkTo( 753.788513, mheight, -1796.320557)
     85mechanic:walkTo( 760.480408, mheight, -1804.107788)
     86mechanic:walkTo( 765.918274, mheight, -1811.952393)
     87mechanic:walkTo( 772.114990, mheight, -1823.565674)
     88mechanic:walkTo( 776.130737, mheight, -1830.713989)
     89mechanic:walkTo( 781.833313, mheight, -1836.770996)
     90mechanic:walkTo( 796.051880, mheight, -1843.499512)
     91mechanic:walkTo( 805.178101, mheight, -1844.844116)
     92mechanic:walkTo( 816.733154, mheight, -1846.198608)
     93mechanic:walkTo( 830.296326, mheight, -1844.374146)
     94mechanic:walkTo( 841.234680, mheight, -1841.184814)
     95mechanic:walkTo( 853.356201, mheight, -1837.650391)
     96mechanic:walkTo( 866.242981, mheight, -1833.892944)
     97mechanic:walkTo( 877.006836, mheight, -1830.820923)
     98mechanic:walkTo( 889.236816, mheight, -1828.092773)
     99mechanic:walkTo( 897.856689, mheight, -1826.204346)
     100mechanic:walkTo( 909.685486, mheight, -1823.613037)
     101mechanic:walkTo( 922.058777, mheight, -1819.907227)
     102mechanic:walkTo( 933.861328, mheight, -1814.044800)
     103mechanic:walkTo( 943.290588, mheight, -1809.960205)
     104mechanic:walkTo( 952.188293, mheight, -1806.317261)
     105mechanic:walkTo( 985.450745, mheight, -1800.297729)
     106mechanic:walkTo( 1000.339722, mheight, -1800.916626)
     107mechanic:walkTo( 1013.447937, mheight, -1802.642090)
     108mechanic:walkTo( 1022.703430, mheight, -1808.694946)
     109mechanic:walkTo( 1030.242554, mheight, -1821.859253)
     110mechanic:walkTo( 1030.063354, mheight, -1839.935547)
     111mechanic:walkTo( 1025.804932, mheight, -1864.135986)
     112mechanic:walkTo( 1019.079651, mheight, -1878.196777)
     113
     114programRoute = false
     115end
     116
     117if mechanic:finalGoalReached() then
     118programRoute = true
     119end
     120
     121end
     122
     123
     124
     125
     126
     127
     128
    37129
    38130
     
    42134
    43135if not positionReached then
    44 dx = 1 * timestep
     136dx = 10 * timestep
    45137dy = 0 * timestep
    46 dz = 1* timestep
     138dz = 0* timestep
    47139end
    48140
    49141if not spaceShipReleased and positionReached then
    50142dx = 0 * timestep
    51 dy = -1 * timestep
     143dy = 10 * timestep
    52144dz = 0 * timestep
    53145end
     
    63155
    64156if not spaceShipReleased then
    65 spaceshipclaw:playAnimation(1,1)
     157--spaceshipclaw:playAnimation(1,1)
     158io.write("release spaceship\n")
    66159spaceShipReleased = true
    67 end
    68 
    69 if clawY > 100 then
     160playerEnteredSpaceShip = true
     161end
     162
     163--if clawY > 100 then
    70164spaceshipLaunchReady = true
    71 end
     165--end
    72166
    73167end
     
    75169
    76170-- 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)
     176spaceshipX = spaceship:getAbsCoorX()
     177spaceshipY = spaceship:getAbsCoorY()
     178spaceshipZ = spaceship:getAbsCoorZ()
     179
     180spaceship:setAbsCoor(spaceshipX + dx, spaceshipY + dy, spaceshipZ + dz)
     181
     182
     183
     184--if dist( clawX,clawY,clawZ,1020.025024, -11.959781, -1721.614380 ) < 60 then
     185if dist( spaceshipX,spaceshipY,spaceshipZ,1020.025024, -11.959781, -1721.614380 ) < 60 then
    86186positionReached = true
    87187end
    88188
    89189
    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
     191if  spaceshipY > 10 then
    91192spaceshipOnPad = true
    92193end
    93194
    94195
    95 end  --observePlayer
     196end
    96197
    97198hoverPosReached = false
     
    103204dz = 0 * timestep
    104205else
    105 dx = 1 * timestep
     206dx = 200 * timestep
    106207dy = 0 * timestep
    107 dz = 1 * timestep
     208dz = 0 * timestep
    108209end
    109210
     
    114215spaceship:setAbsCoor(spaceshipX + dx, spaceshipY + dy, spaceshipZ + dz)
    115216
    116 if spaceshipY > 50 then
     217if spaceshipY > 15 then
    117218hoverPosReached = true
    118219end
     
    122223
    123224function tick(timestep)
    124 --io.write("Spaceship called \n")
     225
    125226observePlayer()
    126 
    127 if playerReachedTrigger then
    128 --moveToLaunchSite(timestep)
     227mechanicMove(timestep)
     228
     229if playerReachedTrigger and not spaceshipLaunchReady then
     230moveToLaunchSite(timestep)
    129231end
    130232
    131233if spaceshipLaunchReady then
    132 --launchSpaceShip(timestep)
     234launchSpaceShip(timestep)
    133235end
    134236
  • data/branches/single_player_map/scripts/prisoner.lua

    r4068 r4070  
    1717
    1818randTime = 0
    19 height = 29
     19height = 34
    2020
    2121
     
    4747guardZ = guard:getAbsCoorZ()
    4848
    49 
    50 if dist( playerX,playerY,playerZ,161.76,49,358.87 ) < 60 then
     49distance = dist( guardX,guardY,guardZ,playerX, playerY, playerZ)
     50
     51if dist( playerX,playerY,playerZ,161.76,49,358.87 ) < 100 then
    5152playerInLock = true
    5253end
    5354
    5455
    55 if dist( guardX,guardY,guardZ,playerX, playerY, playerZ) > 150 and hangarProgrammed then
     56if distance > 250 and hangarRouteProgrammed and not guardStopped then
    5657 prisoner:stop()
    5758 guardStopped = true
    5859end
    5960
    60 if dist( guardX,guardY,guardZ,playerX, playerY, playerZ) < 150 and hangarProgrammed and guardStopped then
     61if distance < 250 and hangarRouteProgrammed and guardStopped then
    6162 prisoner:resume()
    6263 guardStopped = false
     
    129130prisoner:walkTo( 153.191757, height, 253.635788)
    130131prisoner:walkTo( 153.191757, height, 253.635788)
     132prisoner:walkTo( 151.838257, height, 257.185974)
     133prisoner:walkTo( 153.967865, height, 270.535095)
     134prisoner:walkTo( 156.288605, height, 284.582123)
     135prisoner:walkTo( 158.034988, height, 300.072937)
     136prisoner:walkTo( 158.817184, height, 311.973724)
     137prisoner:walkTo( 159.794891, height, 326.848816)
     138prisoner:walkTo( 160.789093, height, 342.474060)
     139prisoner:walkTo( 161.391815, height, 357.817505)
     140prisoner:walkTo( 162.055618, height, 374.715668)
     141prisoner:walkTo( 161.595901, height, 389.146759)
     142prisoner:walkTo( 160.607056, height, 407.092896)
     143prisoner:walkTo( 160.508041, height, 416.996307)
     144
    131145   exitProgrammed = true
    132146  end
     
    147161
    148162if 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)
    167163prisoner:walkTo( 162.624390, height, 425.402435)
    168164prisoner:walkTo( 162.666931, height, 431.160980)
  • data/branches/single_player_map/scripts/secondguard.lua

    r4068 r4070  
    1313guardStopped = false
    1414
    15 height = 80
     15height = 90
    1616
    1717-- Returns the distance between (x1,x2,x3) and (y1,y2,y3)
     
    4242playerZ = Player:getAbsCoorZ()
    4343
    44 if dist( guardX,guardY,guardZ,playerX, playerY, playerZ) > 150 and hangarProgrammed then
     44distance = dist( guardX,guardY,guardZ,playerX, playerY, playerZ)
     45
     46if distance > 250 and hangarProgrammed and not guardStopped then
    4547 secondguard:stop()
    4648 guardStopped = true
    4749end
    4850
    49 if dist( guardX,guardY,guardZ,playerX, playerY, playerZ) < 150 and hangarProgrammed and guardStopped then
    50  --secondguard:continue()
     51if distance < 250 and hangarProgrammed and guardStopped then
     52 secondguard:resume()
    5153 guardStopped = false
    5254end
     
    134136
    135137if not guideProgrammed then
    136 secondguard:walkTo( -104.757011, height, 171.200729)
    137138secondguard:walkTo( -100.266739, height, 171.345627)
    138139secondguard:walkTo( -91.152046, height, 171.639709)
  • data/branches/single_player_map/worlds/sp_level_ambush_at_jupiter.oxw

    r4066 r4070  
    4242
    4343    <Script>
    44      <file>spaceship.lua</file>
     44     <file>hangar.lua</file>
    4545    </Script>
    4646   
     
    9696
    9797    <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>
    102102     <radius>100</radius>
    103103     <worldentity>Player</worldentity>
     
    134134    <GenericNPC>
    135135       <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>
    139139       <abs-dir>-3.1, 0, 1, 0</abs-dir>
    140140    </GenericNPC>
     
    142142    <GenericNPC>
    143143       <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>
    147147       <abs-dir>-3.1, 0, 1, 0</abs-dir>
    148148    </GenericNPC>
     
    151151    <GenericNPC>
    152152       <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>
    156156       <abs-dir>-1.55, 0, 1, 0</abs-dir>
    157157    </GenericNPC>
     
    159159   <GenericNPC>
    160160       <name>Secondprisoner</name>
    161        <model>models/creatures/doom_guy.md2, 10</model>
    162        <md2texture>doom_guy.png</md2texture>
    163        <abs-coor>22, 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>
    164164       <abs-dir>-1.55, 0, 1, 0</abs-dir>
    165165    </GenericNPC>
     
    167167    <GenericNPC>
    168168       <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>
    172172       <abs-dir>0, 0, 1, 0</abs-dir>
    173173    </GenericNPC>
     
    175175    <GenericNPC>
    176176       <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>
    180180       <abs-dir>0, 0, 1, 0</abs-dir>
    181181    </GenericNPC>
     
    183183    <GenericNPC>
    184184       <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>
    191198
    192199   <TestEntity>
     
    209216       <name>repair station 01</name>
    210217       <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>
    212219    </RepairStation>
    213220
     
    220227    </FPSPlayer>
    221228
     229
    222230    <SpaceShip>
    223231      <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>
    226240      <abs-dir> -1.5,0,1,0 </abs-dir>
    227241    </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>
    229256
    230257
Note: See TracChangeset for help on using the changeset viewer.