Changeset 4199
- Timestamp:
- Jul 6, 2006, 5:33:18 PM (18 years ago)
- Location:
- data/branches/scripting
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
data/branches/scripting/scripts/falldown.lua
r4178 r4199 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/branches/scripting/scripts/floorguy.lua
r4195 r4199 1 trigger = ScriptTrigger() 2 trigger:setName("floorguytrigger") 3 trigger:setScript("floorguy.lua") 4 trigger:setFunction("tick") 5 trigger:setAbsCoor(576.753357, 19, 508.746613) 6 trigger:setTarget("Player") 7 trigger:setRadius(100) 8 1 9 -- Get objects from orxonox 2 10 thisscript:addObject("GenericNPC", "floorguy") … … 21 29 if time < 0 and time > -0.4 then 22 30 flyby:fire(true) 23 end24 25 if flybyZ < 600 then26 flyby:setAbsCoor(flybyX + dx, flybyY + dy, flybyZ + dz)27 31 else 28 32 flyby:fire(false) 29 33 end 30 34 35 if flybyZ < 600 then 36 --flyby:setAbsCoor(flybyX + dx, flybyY + dy, flybyZ + dz) 31 37 end 32 38 39 end 33 40 34 41 function tick(timestep) -
data/branches/scripting/scripts/guard.lua
r4161 r4199 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/branches/scripting/scripts/hangar.lua
r4151 r4199 1 trigger = ScriptTrigger() 2 trigger:setName("hangartrigger") 3 trigger:setScript("hangar.lua") 4 trigger:setFunction("tick") 5 trigger:setAbsCoor(678.946838, -11.959779, -920.512634) 6 trigger:setTarget("Player") 7 trigger:setRadius(100) 8 9 10 1 11 -- Get objects from orxonox 2 12 thisscript:addObject("Claw", "spaceshipclaw") -
data/branches/scripting/scripts/lua_extra_functions
r3991 r4199 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/branches/scripting/scripts/prisoner.lua
r4178 r4199 1 trigger = ScriptTrigger() 2 trigger:setName("prisonertrigger") 3 trigger:setScript("prisoner.lua") 4 trigger:setFunction("tick") 5 trigger:setActiveOnCreation(true) 6 7 1 8 -- Get objects from orxonox 2 9 thisscript:addObject("GenericNPC", "prisoner") -
data/branches/scripting/scripts/secondguard.lua
r4161 r4199 1 trigger = ScriptTrigger() 2 trigger:setName("secondguardtrigger") 3 trigger:setScript("secondguard.lua") 4 trigger:setFunction("tick") 5 trigger:setActiveOnCreation(true) 6 7 1 8 -- Get objects from orxonox 2 9 thisscript:addObject("GenericNPC", "secondguard") -
data/branches/scripting/scripts/secondprisoner.lua
r4080 r4199 1 trigger = ScriptTrigger() 2 trigger:setName("secondprisonertrigger") 3 trigger:setScript("secondprisoner.lua") 4 trigger:setFunction("tick") 5 trigger:setActiveOnCreation(true) 6 1 7 -- Get objects from orxonox 2 8 thisscript:addObject("GenericNPC", "Secondprisoner") -
data/branches/scripting/scripts/spaceship_flight.lua
r4147 r4199 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 -
data/branches/scripting/worlds/sp_level_ambush_at_uranus.oxw
r4194 r4199 49 49 </Script> 50 50 51 <Script>52 <file>cruiser.lua</file>53 </Script>54 55 51 </Scripts> 56 52 57 53 <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>145 54 146 55 </ScriptTriggers> … … 284 193 285 194 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 --> 286 202 287 203 <SpaceShip> 288 204 <name>flyby</name> 289 205 <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> 291 207 <abs-dir> 1.5,0,1,0 </abs-dir> 292 208 </SpaceShip> … … 413 329 <model>models/ships/terran_cruizer.obj</model> 414 330 <enter-radius>500</enter-radius> 415 <abs-coor>5200, -300, -1700</abs-coor>331 <abs-coor>5200, 0, -1700</abs-coor> 416 332 </SpaceShip> 417 333 418 334 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> 424 341 </Gate> 425 342
Note: See TracChangeset
for help on using the changeset viewer.