1 | -- Create the trigger |
---|
2 | trigger = TickTrigger() |
---|
3 | trigger:setName("maintrigger") |
---|
4 | trigger:setScript("spaceship_hangar.lua") |
---|
5 | trigger:setFunction("tick") |
---|
6 | |
---|
7 | |
---|
8 | triggerZero = SpaceTrigger() |
---|
9 | triggerZero:setScript("spaceship_hangar.lua") |
---|
10 | triggerZero:setFunction("startQuestThree") |
---|
11 | triggerZero:setAbsCoor(3211.242188, 62.026615, -4471.773926) |
---|
12 | triggerZero:setTarget("Player") |
---|
13 | triggerZero:setRadius(140) |
---|
14 | --triggerZero:setDebugDraw(true) |
---|
15 | |
---|
16 | |
---|
17 | |
---|
18 | triggerOne = SpaceTrigger() |
---|
19 | triggerOne:setScript("spaceship_hangar.lua") |
---|
20 | triggerOne:setFunction("startQuestTwo") |
---|
21 | triggerOne:setAbsCoor(3454.067383, 58.026615, -4117.536133) |
---|
22 | triggerOne:setTarget("Player") |
---|
23 | triggerOne:setRadius(140) |
---|
24 | |
---|
25 | |
---|
26 | thisscript:addObjectAsName("GameWorld", "Space Station 1B", "gameWorld") |
---|
27 | thisscript:addObject("QuestGUI", "First_Quest") |
---|
28 | thisscript:addObject("QuestGUI", "Second_Quest") |
---|
29 | thisscript:addObject("QuestGUI", "Third_Quest") |
---|
30 | |
---|
31 | firstQuestShowed = false |
---|
32 | |
---|
33 | function switchToVertical() |
---|
34 | if gameWorld:setNextStoryName( "Mission 1" ) then |
---|
35 | gameWorld:stop() |
---|
36 | end |
---|
37 | |
---|
38 | end |
---|
39 | |
---|
40 | function startQuestTwo(timestep) |
---|
41 | Second_Quest:startGUI() |
---|
42 | return true |
---|
43 | end |
---|
44 | |
---|
45 | function startQuestThree(timestep) |
---|
46 | Third_Quest:startGUI() |
---|
47 | return true |
---|
48 | end |
---|
49 | |
---|
50 | |
---|
51 | |
---|
52 | function tick(timestep) |
---|
53 | |
---|
54 | if not firstQuestShowed then |
---|
55 | First_Quest:startGUI() |
---|
56 | firstQuestShowed = true |
---|
57 | end |
---|
58 | |
---|
59 | if Third_Quest:isActive() then |
---|
60 | switchToVertical() |
---|
61 | end |
---|
62 | |
---|
63 | return false |
---|
64 | end |
---|