Changeset 4202 for data/trunk/scripts
- Timestamp:
- Jul 17, 2006, 9:32:01 AM (18 years ago)
- Location:
- data/trunk/scripts
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
data/trunk/scripts/attractor.lua
r4161 r4202 3 3 thisscript:registerClass("ScriptTrigger") 4 4 5 -- Create the trigger 5 6 trigger = ScriptTrigger() 6 7 trigger:setScript("attractor.lua") -
data/trunk/scripts/falldown.lua
r4178 r4202 1 -- Create the trigger 2 trigger = ScriptTrigger() 3 trigger:setName("falldowntrigger") 4 trigger:setScript("falldown.lua") 5 trigger:setFunction("tick") 6 trigger:setAbsCoor(670.307190, 0, -410.386810) 7 trigger:setTarget("Player") 8 trigger:setRadius(100) 9 10 1 11 -- Get objects from orxonox 2 12 thisscript:addObject("TestEntity", "fallingguy") … … 102 112 function tick(timestep) 103 113 flee(timestep) 104 --RandTime() 105 106 --if randTime > 0 then 107 --randTime = randTime - timestep 108 --else 114 RandTime() 115 if randTime > 0 then 116 randTime = randTime - timestep 117 else 109 118 fallDown(timestep) 110 --end119 end 111 120 112 121 return eventFinished -
data/trunk/scripts/floorguy.lua
r4195 r4202 1 -- Create the trigger 2 trigger = ScriptTrigger() 3 trigger:setName("floorguytrigger") 4 trigger:setScript("floorguy.lua") 5 trigger:setFunction("tick") 6 trigger:setAbsCoor(576.753357, 19, 508.746613) 7 trigger:setTarget("Player") 8 trigger:setRadius(100) 9 1 10 -- Get objects from orxonox 2 11 thisscript:addObject("GenericNPC", "floorguy") … … 21 30 if time < 0 and time > -0.4 then 22 31 flyby:fire(true) 23 end24 25 if flybyZ < 600 then26 flyby:setAbsCoor(flybyX + dx, flybyY + dy, flybyZ + dz)27 32 else 28 33 flyby:fire(false) 29 34 end 30 35 36 if flybyZ < 600 then 37 --flyby:setAbsCoor(flybyX + dx, flybyY + dy, flybyZ + dz) 31 38 end 32 39 40 end 33 41 34 42 function tick(timestep) -
data/trunk/scripts/guard.lua
r4161 r4202 1 -- Create the trigger 2 trigger = ScriptTrigger() 3 trigger:setName("guardtrigger") 4 trigger:setScript("guard.lua") 5 trigger:setFunction("tick") 6 trigger:setActiveOnCreation(true) 7 1 8 -- Get objects from orxonox 2 9 thisscript:addObject("GenericNPC","guard") -
data/trunk/scripts/hangar.lua
r4151 r4202 1 -- Create the trigger 2 trigger = ScriptTrigger() 3 trigger:setName("hangartrigger") 4 trigger:setScript("hangar.lua") 5 trigger:setFunction("tick") 6 trigger:setAbsCoor(678.946838, -11.959779, -920.512634) 7 trigger:setTarget("Player") 8 trigger:setRadius(100) 9 10 11 1 12 -- Get objects from orxonox 2 13 thisscript:addObject("Claw", "spaceshipclaw") -
data/trunk/scripts/lua_extra_functions
r3991 r4202 15 15 -- Returns the distance between (x1,x2,x3) and (y1,y2,y3) 16 16 function dist( x1,x2,x3, y1,y2,y3 ) 17 18 17 return math.sqrt( (x1-y1)^2 + (x2-y2)^2 + (x3-y3)^2 ) 19 20 18 end -
data/trunk/scripts/prisoner.lua
r4178 r4202 1 -- Create the trigger 2 trigger = ScriptTrigger() 3 trigger:setName("prisonertrigger") 4 trigger:setScript("prisoner.lua") 5 trigger:setFunction("tick") 6 trigger:setActiveOnCreation(true) 7 8 1 9 -- Get objects from orxonox 2 10 thisscript:addObject("GenericNPC", "prisoner") -
data/trunk/scripts/secondguard.lua
r4161 r4202 1 -- Create the trigger 2 trigger = ScriptTrigger() 3 trigger:setName("secondguardtrigger") 4 trigger:setScript("secondguard.lua") 5 trigger:setFunction("tick") 6 trigger:setActiveOnCreation(true) 7 8 1 9 -- Get objects from orxonox 2 10 thisscript:addObject("GenericNPC", "secondguard") -
data/trunk/scripts/secondprisoner.lua
r4080 r4202 1 -- Create the trigger 2 trigger = ScriptTrigger() 3 trigger:setName("secondprisonertrigger") 4 trigger:setScript("secondprisoner.lua") 5 trigger:setFunction("tick") 6 trigger:setActiveOnCreation(true) 7 1 8 -- Get objects from orxonox 2 9 thisscript:addObject("GenericNPC", "Secondprisoner") -
data/trunk/scripts/spaceship_flight.lua
r4147 r4202 1 -- Global Variables 1 -- Create the trigger 2 trigger = ScriptTrigger() 3 trigger:setName("spaceship_flight_trigger") 4 trigger:setScript("spaceship_flight.lua") 5 trigger:setFunction("tick") 6 trigger:setAbsCoor(2500, 0, -1695) 7 trigger:setTarget("SPACE_CRAFT") 8 trigger:setRadius(150) 9 10 -- Add Objects 2 11 thisscript:addObject("GameWorld", "Ambush_at_Uranus") 3 12 thisscript:addObject("Spacecraft2D", "SPACE_CRAFT") 13 thisscript:addObject("Gate", "Hypergate") 14 thisscript:addObject("SpaceShip", "TerranCruizer") 15 -- Global Variables 16 horizontalmode = false 17 gateReached = false 18 terrancriuseratgate = false 4 19 5 20 21 function dist( x1,x2,x3, y1,y2,y3 ) 22 return math.sqrt( (x1-y1)^2 + (x2-y2)^2 + (x3-y3)^2 ) 23 end 24 25 26 function observeSpaceCraft() 27 SPACE_CRAFTX = SPACE_CRAFT:getAbsCoorX() 28 SPACE_CRAFTY = SPACE_CRAFT:getAbsCoorY() 29 SPACE_CRAFTZ = SPACE_CRAFT:getAbsCoorZ() 30 31 distance = dist(SPACE_CRAFTX,SPACE_CRAFTY,SPACE_CRAFTZ,6053.186035, -2.306574, -1704.989624) 32 33 if distance < 100 then 34 Hypergate:destroy() 35 end 36 37 end 6 38 7 39 function tick(timestep) 40 observeSpaceCraft() 8 41 9 Ambush_at_Uranus:setPlaymode("Horizontal") 42 if not horizontalmode then 43 --Ambush_at_Uranus:setPlaymode("Horizontal") 10 44 Ambush_at_Uranus:setSoundtrack("sound/music/00-luke_grey_-_hypermode.ogg") 11 45 SPACE_CRAFT:setAirFriction(3.0) 46 horizontalmode = true 47 end 12 48 13 return true 49 if not terrancriuseratgate then 50 dx = 70 * timestep 51 dy = 0 * timestep 52 dz = 0 * timestep 53 54 TerranCruizerX = TerranCruizer:getAbsCoorX() 55 TerranCruizerY = TerranCruizer:getAbsCoorY() 56 TerranCruizerZ = TerranCruizer:getAbsCoorZ() 57 58 distance = dist(TerranCruizerX,TerranCruizerY,TerranCruizerZ,6053.186035, -2.306574, -1704.989624) 59 60 if distance < 100 then 61 TerranCruizer:hide() 62 dx = 5000 63 terrancriuseratgate = true 14 64 end 65 66 TerranCruizer:setAbsCoor(TerranCruizerX + dx, TerranCruizerY + dy, TerranCruizerZ + dz) 67 68 end 69 70 return false 71 end
Note: See TracChangeset
for help on using the changeset viewer.