[4561] | 1 | -- Main trigger |
---|
[4765] | 2 | trigger = TickTrigger() -- Create the trigger |
---|
[4555] | 3 | trigger:setScript("cutscene.lua") -- Tell the trigger which script to call |
---|
| 4 | trigger:setFunction("tick") -- Tell the trigger which scriptfunction to call |
---|
[4765] | 5 | |
---|
[4561] | 6 | |
---|
[4582] | 7 | |
---|
| 8 | -- Cameraswitchzero |
---|
[4765] | 9 | triggerZero = SpaceTrigger() |
---|
[4582] | 10 | triggerZero:setScript("cutscene.lua") |
---|
| 11 | triggerZero:setFunction("switchCamToBomber") |
---|
| 12 | triggerZero:setAbsCoor(37 , 0 , -200) |
---|
| 13 | triggerZero:setTarget("CameraOne") |
---|
| 14 | triggerZero:setRadius(10) |
---|
[4603] | 15 | --triggerZero:setDebugDraw(true) |
---|
[4582] | 16 | |
---|
| 17 | |
---|
[4561] | 18 | -- Cameraswitchone |
---|
[4765] | 19 | triggerOne = SpaceTrigger() |
---|
[4561] | 20 | triggerOne:setScript("cutscene.lua") |
---|
| 21 | triggerOne:setFunction("switchCamTargetToEarth") |
---|
[4587] | 22 | triggerOne:setAbsCoor(5 , 0 , -140) |
---|
[4561] | 23 | triggerOne:setTarget("CameraOne") |
---|
[4563] | 24 | triggerOne:setRadius(10) |
---|
[4603] | 25 | --triggerOne:setDebugDraw(true) |
---|
[4561] | 26 | |
---|
| 27 | |
---|
| 28 | -- Cameraswitchtwo |
---|
[4765] | 29 | triggerTwo = SpaceTrigger() |
---|
[4561] | 30 | triggerTwo:setScript("cutscene.lua") |
---|
| 31 | triggerTwo:setFunction("switchCamToSpaceship") |
---|
[4593] | 32 | triggerTwo:setAbsCoor(0, 0 , -25) |
---|
[4563] | 33 | triggerTwo:setTarget("CameraOne") |
---|
| 34 | triggerTwo:setRadius(5) |
---|
[4603] | 35 | --triggerTwo:setDebugDraw(true) |
---|
[4561] | 36 | |
---|
| 37 | -- Cameraswitchthree |
---|
[4765] | 38 | triggerThree = SpaceTrigger() |
---|
[4561] | 39 | triggerThree:setScript("cutscene.lua") |
---|
| 40 | triggerThree:setFunction("switchCamToStation") |
---|
[4593] | 41 | triggerThree:setAbsCoor(-125, 0 , -25) |
---|
[4563] | 42 | triggerThree:setTarget("CameraOne") |
---|
| 43 | triggerThree:setRadius(5) |
---|
[4603] | 44 | --triggerThree:setDebugDraw(true) |
---|
[4561] | 45 | |
---|
[4655] | 46 | |
---|
| 47 | -- startScenery |
---|
[4765] | 48 | triggerFour = SpaceTrigger() |
---|
[4655] | 49 | triggerFour:setScript("cutscene.lua") |
---|
| 50 | triggerFour:setFunction("startSceneryOne") |
---|
| 51 | triggerFour:setAbsCoor(125,0,-245) |
---|
| 52 | triggerFour:setTarget("CameraOne") |
---|
| 53 | triggerFour:setRadius(5) |
---|
[4659] | 54 | --triggerFour:setDebugDraw(true) |
---|
[4655] | 55 | |
---|
[4765] | 56 | -- Scroller |
---|
| 57 | triggerScr = TimeTrigger() |
---|
| 58 | triggerScr:setScript("cutscene.lua") |
---|
| 59 | triggerScr:setFunction("startScrolling") |
---|
| 60 | triggerScr:setDelay(10) |
---|
[4655] | 61 | |
---|
[4765] | 62 | |
---|
[4555] | 63 | -- Get objects from orxonox |
---|
| 64 | thisscript:addObject("CameraMan", "cameraManager") |
---|
[4655] | 65 | thisscript:addObject("NPC", "shutleOne") |
---|
| 66 | thisscript:addObject("NPC", "bomberOne") |
---|
| 67 | thisscript:addObject("NPC", "fighterOne") |
---|
| 68 | thisscript:addObject("NPC", "bomberTwo") |
---|
| 69 | thisscript:addObject("NPC", "fighterTwo") |
---|
| 70 | thisscript:addObject("NPC", "pirateOne") |
---|
| 71 | thisscript:addObject("NPC", "pirateTwo") |
---|
[4597] | 72 | thisscript:addObject("NPC", "fighterThree") |
---|
[4655] | 73 | thisscript:addObject("NPC", "bomberThree") |
---|
| 74 | thisscript:addObject("NPC", "bomberFour") |
---|
[4569] | 75 | thisscript:addObjectAsName("GameWorld", "Cut Scene", "gameWorld") |
---|
[4605] | 76 | thisscript:addObjectAsName("ScrollingScreen", "Credits Scroller","scrollingScreen") |
---|
[4555] | 77 | |
---|
[4569] | 78 | |
---|
[4561] | 79 | -- Global Variables |
---|
[4555] | 80 | time = 0 |
---|
[4570] | 81 | fadeout = false |
---|
[4568] | 82 | bInit = 0 |
---|
| 83 | bInit2 = 0 |
---|
[4655] | 84 | sceneryOneStopped = false |
---|
| 85 | sceneryOneRunning = false |
---|
| 86 | stationReached = false |
---|
[4555] | 87 | |
---|
[4561] | 88 | -- Switch cam functions |
---|
| 89 | function switchCamTargetToEarth(timestep) |
---|
| 90 | cameraManager:changeCurrTarget("Planet", "Earth") |
---|
| 91 | return true |
---|
| 92 | end |
---|
| 93 | |
---|
| 94 | function switchCamToSpaceship(timestep) |
---|
[4760] | 95 | cameraManager:attachCurrCamera( "NPC", "shutleOne") |
---|
[4561] | 96 | return true |
---|
| 97 | end |
---|
| 98 | |
---|
| 99 | function switchCamToStation(timestep) |
---|
[4760] | 100 | cameraManager:attachCurrCamera("Building", "zhara") |
---|
[4570] | 101 | stationReached = true |
---|
| 102 | time = 0 |
---|
[4563] | 103 | --cameraManager:detachCurrCamera() |
---|
[4561] | 104 | return true |
---|
| 105 | end |
---|
| 106 | |
---|
[4582] | 107 | function switchCamToBomber(timestep) |
---|
| 108 | cameraManager:changeCurrTarget( "NPC", "fighterTwo") |
---|
| 109 | return true |
---|
| 110 | end |
---|
[4561] | 111 | |
---|
[4655] | 112 | -- Start |
---|
| 113 | function startSceneryOne(timestep) |
---|
[4582] | 114 | |
---|
[4655] | 115 | --shutleOne:unhide() |
---|
| 116 | --bomberOne:unhide() |
---|
| 117 | --fighterOne:unhide() |
---|
| 118 | --bomberTwo:unhide() |
---|
| 119 | --fighterTwo:unhide() |
---|
| 120 | --pirateOne:unhide()) |
---|
| 121 | --pirateTwo:unhide() |
---|
| 122 | --fighterThree:unhide() |
---|
| 123 | --bomberThree:unhide() |
---|
| 124 | |
---|
| 125 | shutleOne:pause(false) |
---|
| 126 | bomberOne:pause(false) |
---|
| 127 | fighterOne:pause(false) |
---|
| 128 | bomberTwo:pause(false) |
---|
| 129 | fighterTwo:pause(false) |
---|
| 130 | pirateOne:pause(false) |
---|
| 131 | pirateTwo:pause(false) |
---|
| 132 | fighterThree:pause(false) |
---|
| 133 | bomberThree:pause(false) |
---|
| 134 | bomberFour:pause(false) |
---|
| 135 | |
---|
| 136 | sceneryOneRunning = true |
---|
| 137 | time = 0 |
---|
| 138 | |
---|
| 139 | return true |
---|
| 140 | |
---|
| 141 | end |
---|
| 142 | |
---|
| 143 | -- Stop |
---|
| 144 | function stopSceneryOne(timestep) |
---|
| 145 | |
---|
| 146 | --shutleOne:hide() |
---|
| 147 | --bomberOne:hide() |
---|
| 148 | --fighterOne:hide() |
---|
| 149 | --bomberTwo:hide() |
---|
| 150 | --fighterTwo:hide() |
---|
| 151 | --pirateOne:hide()) |
---|
| 152 | --pirateTwo:hide() |
---|
| 153 | --fighterThree:hide() |
---|
| 154 | --bomberThree:hide() |
---|
| 155 | |
---|
| 156 | shutleOne:pause(true) |
---|
| 157 | bomberOne:pause(true) |
---|
| 158 | fighterOne:pause(true) |
---|
| 159 | bomberTwo:pause(true) |
---|
| 160 | fighterTwo:pause(true) |
---|
| 161 | pirateOne:pause(true) |
---|
| 162 | pirateTwo:pause(true) |
---|
| 163 | fighterThree:pause(true) |
---|
| 164 | bomberThree:pause(true) |
---|
[4765] | 165 | bomberFour:pause(true) |
---|
[4655] | 166 | |
---|
| 167 | return true |
---|
| 168 | |
---|
| 169 | end |
---|
| 170 | |
---|
[4765] | 171 | -- Start the scrolling screen |
---|
| 172 | function startScrolling(timestep) |
---|
| 173 | scrollingScreen:start() |
---|
| 174 | return true |
---|
| 175 | end |
---|
[4655] | 176 | |
---|
[4555] | 177 | -- THE tick function |
---|
| 178 | |
---|
| 179 | function tick(timestep) |
---|
| 180 | time = time + timestep |
---|
[4765] | 181 | triggerScr:start() |
---|
[4563] | 182 | |
---|
[4655] | 183 | if not sceneryOneStopped then |
---|
| 184 | sceneryOneStopped = stopSceneryOne(timestep) |
---|
| 185 | end |
---|
[4570] | 186 | |
---|
[4568] | 187 | if bInit == 0 then |
---|
| 188 | cameraManager:initFadeBlack() |
---|
[4570] | 189 | gameWorld:showText("Earth Solar System"); |
---|
[4568] | 190 | bInit = 1 |
---|
| 191 | end |
---|
| 192 | |
---|
[4570] | 193 | if time > 2 and bInit2 == 0 then |
---|
[4568] | 194 | cameraManager:toggleFade() |
---|
| 195 | bInit2 = 1 |
---|
| 196 | end |
---|
| 197 | |
---|
[4605] | 198 | |
---|
[4606] | 199 | |
---|
[4655] | 200 | if time > 8 and time < 8.5 and sceneryOneRunning then |
---|
[4605] | 201 | fighterThree:fire() |
---|
[4597] | 202 | end |
---|
| 203 | |
---|
[4563] | 204 | if not cameraSwitched then |
---|
[4561] | 205 | cameraManager:setCam("CameraOne") |
---|
[4582] | 206 | cameraManager:jumpCurrCam(125,0,-245) |
---|
[4760] | 207 | --cameraManager:attachCurrCamera("NPC", "transporterOne") |
---|
[4671] | 208 | cameraManager:changeCurrTarget("Building", "zhara") |
---|
[4555] | 209 | cameraSwitched = true |
---|
[4563] | 210 | end |
---|
[4555] | 211 | |
---|
[4570] | 212 | if time > 4 and stationReached and not fadeout then |
---|
| 213 | cameraManager:toggleFade() |
---|
| 214 | fadeout = true |
---|
[4555] | 215 | end |
---|
| 216 | |
---|
[4570] | 217 | if time > 6 and stationReached then |
---|
| 218 | gameWorld:setNextStoryName( "Space Station 1" ) |
---|
| 219 | gameWorld:stop() |
---|
| 220 | return true |
---|
| 221 | end |
---|
| 222 | |
---|
[4555] | 223 | return false |
---|
| 224 | end |
---|