Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3951 for data/branches


Ignore:
Timestamp:
Jun 29, 2006, 6:47:23 PM (18 years ago)
Author:
snellen
Message:

added some npcs

Location:
data/branches/single_player_map
Files:
3 edited

Legend:

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

    r3947 r3951  
    77-- Returns the distance between (x1,x2,x3) and (y1,y2,y3)
    88function dist( x1,x2,x3, y1,y2,y3 )
    9 
    109return math.sqrt( (x1-y1)^2 + (x2-y2)^2 + (x3-y3)^2 )
    11 
    1210end
    1311
    14 function stopWalkRouteOne(timestep)
    15 walkRouteOne = false
    16 return true
    17 end
    1812
    1913function observePlayer()
     
    3226
    3327if not routeOneProgrammed then
    34 io.write("Guard called \n")
    35 guard:walkTo(-154.592667, 80.000000, 231.381805)
     28--io.write("Guard called \n")
     29guard:walkTo(-132, 29, 238.381805)
     30guard:walkTo(-138.41, 29, 275.25)
     31guard:walkTo(-143.70, 29, 275.35)
     32guard:walkTo(-149.10, 29, 226.66)
     33guard:walkTo(-149.10, 29, 196.83)
     34guard:walkTo(-145.82, 29, 189.74)
     35guard:walkTo(-138.48, 29, 184.28)
     36guard:walkTo(35.48, 29, 191.28)
     37guard:runTo(102, 29, 203.28)
     38guard:runTo(164, 29, 245.28)
     39
    3640routeOneProgrammed = true
    3741end
    3842
     43if guard:finalGoalReached() then
     44return false
    3945end
    4046
     47return true
     48end
     49
     50
     51exitRouteProgrammed = false
    4152function goToExitPosition(timestep)
     53
     54if not exitRouteProgrammed then
     55guard:walkTo(-132, 29, 238.381805)
     56guard:walkTo(-138.41, 29, 275.25)
     57guard:walkTo(-143.70, 29, 275.35)
     58guard:walkTo(-149.10, 29, 226.66)
     59guard:walkTo(-149.10, 29, 196.83)
     60guard:walkTo(-145.82, 29, 189.74)
     61guard:walkTo(-138.48, 29, 184.28)
     62guard:walkTo(35.48, 29, 191.28)
     63guard:runTo(102, 29, 203.28)
     64guard:runTo(164, 29, 245.28)
     65
     66exitRouteProgrammed = true
     67end
     68
     69if guard:finalGoalReached() and playerInLock then
     70return true
     71end
    4272
    4373return false
     
    4575
    4676
     77hangarRouteProgrammed = false
    4778function goToHangar(timestep)
     79
     80if not hangarRouteProgrammed  then
     81guard:walkTo(-132, 29, 238.381805)
     82guard:walkTo(-138.41, 29, 275.25)
     83guard:walkTo(-143.70, 29, 275.35)
     84guard:walkTo(-149.10, 29, 226.66)
     85guard:walkTo(-149.10, 29, 196.83)
     86guard:walkTo(-145.82, 29, 189.74)
     87guard:walkTo(-138.48, 29, 184.28)
     88guard:walkTo(35.48, 29, 191.28)
     89guard:runTo(102, 29, 203.28)
     90guard:runTo(164, 29, 245.28)
     91
     92hangarRouteProgrammed  = true
     93end
     94
     95if guard:finalGoalReached() then
     96return true
     97end
    4898
    4999return false
     
    61111
    62112if walkingRouteOne then
    63 walkRouteOne(timestep)
     113walkingRouteOne = walkRouteOne(timestep)
    64114end
    65115
  • data/branches/single_player_map/scripts/secondguard.lua

    r3946 r3951  
    11-- Global Variables
    22allOk = true
    3 standing = false
     3cellReached = false
    44guidePositionReached = false
    55prisonerReachedLock = false
     
    1515
    1616
    17 function alert(timestep)
     17function observeGuard()
     18guardX = guard:getAbsCoorX()
     19guardY = guard:getAbsCoorY()
     20guardZ = guard:getAbsCoorZ()
     21
     22if dist( guardX,guardY,guardZ,161.76,49,358.87 ) < 60 then
    1823allOk = false
    19 return true
     24end
     25
    2026end
    2127
    2228function observePrisoner()
    2329
    24 --prisonerX = Prisoner:getAbsCoorX()
    25 --prisonerY = Prisoner:getAbsCoorY()
    26 --prisonerZ = Prisoner:getAbsCoorZ()
     30prisonerX = Prisoner:getAbsCoorX()
     31prisonerY = Prisoner:getAbsCoorY()
     32prisonerZ = Prisoner:getAbsCoorZ()
     33
     34if dist( prisonerX,prisonerY,prisonerZ,161.76,49,358.87 ) < 60 then
     35prisonerReachedLock = true
     36end
    2737
    2838end
    2939
    30 function standUp(timestep)
     40
     41function goToCell(timestep)
    3142
    3243return false
     
    4960
    5061if not allOk then
    51 standing = standUp(timestep)
     62cellReached = goToCell(timestep)
    5263end
    5364
    54 if standing and not guidePositionReached then
     65if cellReached and not guidePositionReached then
    5566guidePositionReached = goToGuidePosition(timestep)
    5667end
    57 
    5868
    5969if guidePositionReached and prisonerReachedLock then
  • data/branches/single_player_map/worlds/sp_level_ambush_at_jupiter.oxw

    r3947 r3951  
    120120    </ScriptTrigger>
    121121
    122 
    123122   </ScriptTriggers>
    124123
     
    154153    </GenericNPC>
    155154   
     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
    156172    <GenericNPC>
    157173       <name>statist</name>
Note: See TracChangeset for help on using the changeset viewer.