Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4202 for data/trunk/scripts


Ignore:
Timestamp:
Jul 17, 2006, 9:32:01 AM (18 years ago)
Author:
bensch
Message:

merged the data back from scripting

Location:
data/trunk/scripts
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • data/trunk/scripts/attractor.lua

    r4161 r4202  
    33thisscript:registerClass("ScriptTrigger")
    44
     5-- Create the trigger
    56trigger = ScriptTrigger()
    67trigger:setScript("attractor.lua")
  • data/trunk/scripts/falldown.lua

    r4178 r4202  
     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/trunk/scripts/floorguy.lua

    r4195 r4202  
     1-- Create the trigger
     2trigger = ScriptTrigger()
     3trigger:setName("floorguytrigger")
     4trigger:setScript("floorguy.lua")
     5trigger:setFunction("tick")
     6trigger:setAbsCoor(576.753357, 19, 508.746613)
     7trigger:setTarget("Player")
     8trigger:setRadius(100)
     9
    110-- Get objects from orxonox
    211thisscript:addObject("GenericNPC", "floorguy")
     
    2130if time < 0 and time > -0.4 then
    2231flyby:fire(true)
    23 end
    24 
    25 if flybyZ < 600 then
    26 flyby:setAbsCoor(flybyX + dx, flybyY + dy, flybyZ + dz)
    2732else
    2833flyby:fire(false)
    2934end
    3035
     36if flybyZ < 600 then
     37--flyby:setAbsCoor(flybyX + dx, flybyY + dy, flybyZ + dz)
    3138end
    3239
     40end
    3341
    3442function tick(timestep)
  • data/trunk/scripts/guard.lua

    r4161 r4202  
     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/trunk/scripts/hangar.lua

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

    r3991 r4202  
    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/trunk/scripts/prisoner.lua

    r4178 r4202  
     1-- Create the trigger
     2trigger = ScriptTrigger()
     3trigger:setName("prisonertrigger")
     4trigger:setScript("prisoner.lua")
     5trigger:setFunction("tick")
     6trigger:setActiveOnCreation(true)
     7
     8
    19-- Get objects from orxonox
    210thisscript:addObject("GenericNPC", "prisoner")
  • data/trunk/scripts/secondguard.lua

    r4161 r4202  
     1-- Create the trigger
     2trigger = ScriptTrigger()
     3trigger:setName("secondguardtrigger")
     4trigger:setScript("secondguard.lua")
     5trigger:setFunction("tick")
     6trigger:setActiveOnCreation(true)
     7
     8
    19-- Get objects from orxonox
    210thisscript:addObject("GenericNPC", "secondguard")
  • data/trunk/scripts/secondprisoner.lua

    r4080 r4202  
     1-- Create the trigger
     2trigger = ScriptTrigger()
     3trigger:setName("secondprisonertrigger")
     4trigger:setScript("secondprisoner.lua")
     5trigger:setFunction("tick")
     6trigger:setActiveOnCreation(true)
     7
    18-- Get objects from orxonox
    29thisscript:addObject("GenericNPC", "Secondprisoner")
  • data/trunk/scripts/spaceship_flight.lua

    r4147 r4202  
    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
Note: See TracChangeset for help on using the changeset viewer.