Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4199


Ignore:
Timestamp:
Jul 6, 2006, 5:33:18 PM (18 years ago)
Author:
snellen
Message:

various updated

Location:
data/branches/scripting
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • data/branches/scripting/scripts/falldown.lua

    r4178 r4199  
     1-- Create the trigger
     2trigger = ScriptTrigger()
     3trigger:setName("falldowntrigger")
     4trigger:setScript("falldown.lua")
     5trigger:setFunction("tick")
     6trigger:setAbsCoor(670.307190, 0, -410.386810)
     7trigger:setTarget("Player")
     8trigger:setRadius(100)
     9
     10
    111-- Get objects from orxonox
    212thisscript:addObject("TestEntity", "fallingguy")
     
    102112function tick(timestep)
    103113 flee(timestep)
    104 --RandTime()
    105 
    106 --if randTime > 0 then
    107 --randTime = randTime - timestep
    108 --else
     114RandTime()
     115if randTime > 0 then
     116randTime = randTime - timestep
     117else
    109118fallDown(timestep)
    110 --end
     119end
    111120
    112121return eventFinished
  • data/branches/scripting/scripts/floorguy.lua

    r4195 r4199  
     1trigger = ScriptTrigger()
     2trigger:setName("floorguytrigger")
     3trigger:setScript("floorguy.lua")
     4trigger:setFunction("tick")
     5trigger:setAbsCoor(576.753357, 19, 508.746613)
     6trigger:setTarget("Player")
     7trigger:setRadius(100)
     8
    19-- Get objects from orxonox
    210thisscript:addObject("GenericNPC", "floorguy")
     
    2129if time < 0 and time > -0.4 then
    2230flyby:fire(true)
    23 end
    24 
    25 if flybyZ < 600 then
    26 flyby:setAbsCoor(flybyX + dx, flybyY + dy, flybyZ + dz)
    2731else
    2832flyby:fire(false)
    2933end
    3034
     35if flybyZ < 600 then
     36--flyby:setAbsCoor(flybyX + dx, flybyY + dy, flybyZ + dz)
    3137end
    3238
     39end
    3340
    3441function tick(timestep)
  • data/branches/scripting/scripts/guard.lua

    r4161 r4199  
     1-- Create the trigger
     2trigger = ScriptTrigger()
     3trigger:setName("guardtrigger")
     4trigger:setScript("guard.lua")
     5trigger:setFunction("tick")
     6trigger:setActiveOnCreation(true)
     7
    18-- Get objects from orxonox
    29thisscript:addObject("GenericNPC","guard")
  • data/branches/scripting/scripts/hangar.lua

    r4151 r4199  
     1trigger = ScriptTrigger()
     2trigger:setName("hangartrigger")
     3trigger:setScript("hangar.lua")
     4trigger:setFunction("tick")
     5trigger:setAbsCoor(678.946838, -11.959779, -920.512634)
     6trigger:setTarget("Player")
     7trigger:setRadius(100)
     8
     9
     10
    111-- Get objects from orxonox
    212thisscript:addObject("Claw", "spaceshipclaw")
  • data/branches/scripting/scripts/lua_extra_functions

    r3991 r4199  
    1515-- Returns the distance between (x1,x2,x3) and (y1,y2,y3)
    1616function dist( x1,x2,x3, y1,y2,y3 )
    17 
    1817return math.sqrt( (x1-y1)^2 + (x2-y2)^2 + (x3-y3)^2 )
    19 
    2018end
  • data/branches/scripting/scripts/prisoner.lua

    r4178 r4199  
     1trigger = ScriptTrigger()
     2trigger:setName("prisonertrigger")
     3trigger:setScript("prisoner.lua")
     4trigger:setFunction("tick")
     5trigger:setActiveOnCreation(true)
     6
     7
    18-- Get objects from orxonox
    29thisscript:addObject("GenericNPC", "prisoner")
  • data/branches/scripting/scripts/secondguard.lua

    r4161 r4199  
     1trigger = ScriptTrigger()
     2trigger:setName("secondguardtrigger")
     3trigger:setScript("secondguard.lua")
     4trigger:setFunction("tick")
     5trigger:setActiveOnCreation(true)
     6
     7
    18-- Get objects from orxonox
    29thisscript:addObject("GenericNPC", "secondguard")
  • data/branches/scripting/scripts/secondprisoner.lua

    r4080 r4199  
     1trigger = ScriptTrigger()
     2trigger:setName("secondprisonertrigger")
     3trigger:setScript("secondprisoner.lua")
     4trigger:setFunction("tick")
     5trigger:setActiveOnCreation(true)
     6
    17-- Get objects from orxonox
    28thisscript:addObject("GenericNPC", "Secondprisoner")
  • data/branches/scripting/scripts/spaceship_flight.lua

    r4147 r4199  
    1 -- Global Variables
     1-- Create the trigger
     2trigger = ScriptTrigger()
     3trigger:setName("spaceship_flight_trigger")
     4trigger:setScript("spaceship_flight.lua")
     5trigger:setFunction("tick")
     6trigger:setAbsCoor(2500, 0, -1695)
     7trigger:setTarget("SPACE_CRAFT")
     8trigger:setRadius(150)
     9
     10-- Add Objects
    211thisscript:addObject("GameWorld", "Ambush_at_Uranus")
    312thisscript:addObject("Spacecraft2D", "SPACE_CRAFT")
     13thisscript:addObject("Gate", "Hypergate")
     14thisscript:addObject("SpaceShip", "TerranCruizer")
     15-- Global Variables
     16horizontalmode = false
     17gateReached = false
     18terrancriuseratgate = false
    419
    520
     21function dist( x1,x2,x3, y1,y2,y3 )
     22return math.sqrt( (x1-y1)^2 + (x2-y2)^2 + (x3-y3)^2 )
     23end
     24
     25
     26function observeSpaceCraft()
     27SPACE_CRAFTX = SPACE_CRAFT:getAbsCoorX()
     28SPACE_CRAFTY = SPACE_CRAFT:getAbsCoorY()
     29SPACE_CRAFTZ = SPACE_CRAFT:getAbsCoorZ()
     30
     31distance = dist(SPACE_CRAFTX,SPACE_CRAFTY,SPACE_CRAFTZ,6053.186035, -2.306574, -1704.989624)
     32
     33if distance < 100 then
     34Hypergate:destroy()
     35end
     36
     37end
    638
    739function tick(timestep)
     40observeSpaceCraft()
    841
    9  Ambush_at_Uranus:setPlaymode("Horizontal")
     42if not horizontalmode then
     43 --Ambush_at_Uranus:setPlaymode("Horizontal")
    1044 Ambush_at_Uranus:setSoundtrack("sound/music/00-luke_grey_-_hypermode.ogg")
    1145 SPACE_CRAFT:setAirFriction(3.0)
     46 horizontalmode = true
     47end
    1248
    13  return true
     49if not terrancriuseratgate then
     50dx = 70 * timestep
     51dy = 0 * timestep
     52dz = 0 * timestep
     53
     54TerranCruizerX = TerranCruizer:getAbsCoorX()
     55TerranCruizerY = TerranCruizer:getAbsCoorY()
     56TerranCruizerZ = TerranCruizer:getAbsCoorZ()
     57
     58distance = dist(TerranCruizerX,TerranCruizerY,TerranCruizerZ,6053.186035, -2.306574, -1704.989624)
     59
     60if distance < 100  then
     61TerranCruizer:hide()
     62dx = 5000
     63terrancriuseratgate = true
    1464end
     65
     66TerranCruizer:setAbsCoor(TerranCruizerX + dx, TerranCruizerY + dy, TerranCruizerZ + dz)
     67
     68end
     69
     70 return false
     71end
  • data/branches/scripting/worlds/sp_level_ambush_at_uranus.oxw

    r4194 r4199  
    4949    </Script>
    5050
    51     <Script>
    52      <file>cruiser.lua</file>
    53     </Script>
    54 
    5551   </Scripts>
    5652
    5753   <ScriptTriggers>
    58 
    59     <ScriptTrigger>
    60      <name>falldowntrigger</name>
    61      <file>falldown.lua</file>
    62      <function>tick</function>
    63      <abs-coor>670.307190, 0, -410.386810</abs-coor>
    64      <radius>100</radius>
    65      <worldentity>Player</worldentity>
    66 
    67     </ScriptTrigger>
    68 
    69     <ScriptTrigger>
    70      <name>guardtrigger</name>
    71      <file>guard.lua</file>
    72      <function>tick</function>
    73      <abs-coor>-84, 19, 77</abs-coor>
    74      <radius>100</radius>
    75      <worldentity>Player</worldentity>
    76     </ScriptTrigger>
    77 
    78     <ScriptTrigger>
    79      <name>secondguardtrigger</name>
    80      <file>secondguard.lua</file>
    81      <function>tick</function>
    82      <abs-coor>-84, 19, 77</abs-coor>
    83      <radius>100</radius>
    84      <worldentity>Player</worldentity>
    85     </ScriptTrigger>
    86 
    87     <ScriptTrigger>
    88      <name>prisonertrigger</name>
    89      <file>prisoner.lua</file>
    90      <function>tick</function>
    91      <abs-coor>-84, 19, 77</abs-coor>
    92      <radius>100</radius>
    93      <worldentity>Player</worldentity>
    94     </ScriptTrigger>
    95 
    96    <ScriptTrigger>
    97      <name>secondprisonertrigger</name>
    98      <file>secondprisoner.lua</file>
    99      <function>tick</function>
    100      <abs-coor>-84, 19, 77</abs-coor>
    101      <radius>100</radius>
    102      <worldentity>Player</worldentity>
    103     </ScriptTrigger>
    104 
    105     <ScriptTrigger>
    106      <name>hangartrigger</name>
    107      <file>hangar.lua</file>
    108      <function>tick</function>
    109      <abs-coor>678.946838, -11.959779, -920.512634</abs-coor>
    110      <radius>100</radius>
    111      <worldentity>Player</worldentity>
    112 
    113     </ScriptTrigger>
    114 
    115 
    116     <ScriptTrigger>
    117      <name>floorguytrigger</name>
    118      <file>floorguy.lua</file>
    119      <function>tick</function>
    120      <abs-coor>576.753357, 19, 508.746613</abs-coor>
    121      <radius>100</radius>
    122      <worldentity>Player</worldentity>
    123     </ScriptTrigger>
    124 
    125     <ScriptTrigger>
    126      <name>spaceship_flight_trigger</name>
    127      <file>spaceship_flight.lua</file>
    128      <function>tick</function>
    129      <abs-coor>2500, 0, -1695</abs-coor>
    130      <radius>150</radius>
    131      <worldentity>SPACE_CRAFT</worldentity>
    132    
    133     </ScriptTrigger>
    134 
    135 
    136     <ScriptTrigger>
    137      <name>gatetrigger</name>
    138      <file>cruiser.lua</file>
    139      <function>tick</function>
    140      <abs-coor>2500, 0, -1695</abs-coor>
    141      <radius>150</radius>
    142      <worldentity>TerranCruizer</worldentity>
    143    
    144     </ScriptTrigger>
    14554
    14655   </ScriptTriggers>
     
    284193
    285194
     195  <!--  <SpaceShip>
     196      <name>SPACE_CRAFT</name>
     197      <abs-coor>1600, 0.004610, -1700.0</abs-coor>
     198      <enter-radius>100000</enter-radius>
     199      <model>models/ships/mantawing.obj,20</model>
     200    </SpaceShip>
     201-->
    286202
    287203    <SpaceShip>
    288204      <name>flyby</name>
    289205      <model>models/ships/reap_#.obj,20</model>
    290       <abs-coor>900.753357, 19, 508.746613</abs-coor>
     206      <abs-coor>800, 19, 508.746613</abs-coor>
    291207      <abs-dir> 1.5,0,1,0 </abs-dir>
    292208    </SpaceShip>
     
    413329      <model>models/ships/terran_cruizer.obj</model>
    414330      <enter-radius>500</enter-radius>
    415       <abs-coor>5200, -300, -1700</abs-coor>
     331      <abs-coor>5200, 0, -1700</abs-coor>
    416332   </SpaceShip>
    417333
    418334
    419  <Gate>   <name>Hypergate</name>
    420    <scale>800.0</scale>
    421     <action-radius>8000.0</action-radius>
    422   <abs-coor>6000, 0, -1700</abs-coor>
    423   <abs-dir>1.57, 0, 1, 0</abs-dir>
     335 <Gate>   
     336   <name>Hypergate</name>
     337   <scale>6400.0</scale>
     338   <action-radius>500.0</action-radius>
     339   <abs-coor>6000, 0, -1700</abs-coor>
     340   <abs-dir>1.57, 0, 1, 0</abs-dir>
    424341 </Gate>
    425342
Note: See TracChangeset for help on using the changeset viewer.