1 | <LevelInfo |
---|
2 | name = "CampaignHS15 1" |
---|
3 | description = "Protect the transporter!" |
---|
4 | tags = "mission" |
---|
5 | screenshot = "missionOne.png" |
---|
6 | /> |
---|
7 | |
---|
8 | <?lua |
---|
9 | include("stats.oxo") |
---|
10 | include("HUDTemplates3.oxo") |
---|
11 | include("templates/lodInformation.oxt") |
---|
12 | ?> |
---|
13 | |
---|
14 | <?lua |
---|
15 | include("templates/spaceshipAssff2.oxt") |
---|
16 | include("templates/spaceshipPirate.oxt") |
---|
17 | include("templates/spaceshipEscort.oxt") |
---|
18 | include("templates/spaceshipRing.oxt") |
---|
19 | include("templates/spaceshipSwallow.oxt") |
---|
20 | include("templates/spaceshipTransporter.oxt") |
---|
21 | ?> |
---|
22 | |
---|
23 | <Level gametype = "Mission"> |
---|
24 | <templates> |
---|
25 | <Template link="lodtemplate_default" /> |
---|
26 | </templates> |
---|
27 | |
---|
28 | <?lua include("includes/notifications.oxi") ?> |
---|
29 | |
---|
30 | <NotificationQueueCEGUI |
---|
31 | name="narrative" |
---|
32 | targets="simpleNotification" |
---|
33 | size=3 |
---|
34 | displayTime=3.9 |
---|
35 | position="0.15, 0, 0.1, 0" |
---|
36 | fontSize="23" |
---|
37 | fontColor="0.3, 1, 0.2, 0.8" |
---|
38 | alignment="HorzCentred" |
---|
39 | displaySize="0.7, 0, 0, 0" |
---|
40 | /> |
---|
41 | |
---|
42 | <!-- GLOBAL LUA VARIABLES --> |
---|
43 | <?lua |
---|
44 | waves = 3 |
---|
45 | enemies = 5 |
---|
46 | ?> |
---|
47 | |
---|
48 | <Scene |
---|
49 | ambientlight = "0.8, 0.8, 0.8" |
---|
50 | skybox = "Orxonox/Starbox" |
---|
51 | > |
---|
52 | |
---|
53 | <SpawnPoint name="playerSpawn" team=1 position="0,-50,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff2 /> |
---|
54 | |
---|
55 | <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" /> |
---|
56 | |
---|
57 | <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> |
---|
58 | |
---|
59 | <!--QUEST DEFINITIONS--> |
---|
60 | |
---|
61 | <GlobalQuest id="quest1"> |
---|
62 | <QuestDescription title="Reach the Station A!" description="" failMessage="" completeMessage="" /> |
---|
63 | <hints> |
---|
64 | <QuestHint id="quest1hint1" /> |
---|
65 | </hints> |
---|
66 | <complete-effects> |
---|
67 | <!-- Quest 2 not made as of yet |
---|
68 | <AddQuest questId="quest2" /> |
---|
69 | <AddQuest questId="quest2.1" /> |
---|
70 | <AddQuest questId="quest2.2" /> |
---|
71 | <AddQuest questId="quest2.3" /> |
---|
72 | --> |
---|
73 | <AddQuest questId="quest3" /> |
---|
74 | </complete-effects> |
---|
75 | </GlobalQuest> |
---|
76 | |
---|
77 | <GlobalQuest id="quest2"> |
---|
78 | <QuestDescription title="Prepare to fight the Wave" description="" failMessage="" completeMessage="" /> |
---|
79 | <hints> |
---|
80 | </hints> |
---|
81 | <subquests> |
---|
82 | <GlobalQuest id="quest2.1"> |
---|
83 | <QuestDescription title="Get a better Spaceship" description="" failMessage="" completeMessage="" /> |
---|
84 | </GlobalQuest> |
---|
85 | <GlobalQuest id="quest2.2"> |
---|
86 | <QuestDescription title="Get some Pickups" description="" failMessage="" completeMessage="" /> |
---|
87 | </GlobalQuest> |
---|
88 | <GlobalQuest id="quest2.3"> |
---|
89 | <QuestDescription title="Meet your Unit" description="" failMessage="" completeMessage="" /> |
---|
90 | </GlobalQuest> |
---|
91 | </subquests> |
---|
92 | <complete-effects> |
---|
93 | <AddQuest questId="quest3" /> |
---|
94 | </complete-effects> |
---|
95 | </GlobalQuest> |
---|
96 | |
---|
97 | <GlobalQuest id="quest3"> |
---|
98 | <QuestDescription title="Fight the first Wave" description="" failMessage="" completeMessage="" /> |
---|
99 | <hints> |
---|
100 | </hints> |
---|
101 | <complete-effects> |
---|
102 | <AddQuest questId="quest4" /> |
---|
103 | <AddQuest questId="quest4.1" /> |
---|
104 | <AddQuest questId="quest4.2" /> |
---|
105 | </complete-effects> |
---|
106 | </GlobalQuest> |
---|
107 | |
---|
108 | <GlobalQuest id="quest4"> |
---|
109 | <QuestDescription title="Prepare for the next Wave" description="" failMessage="" completeMessage="" /> |
---|
110 | <hints> |
---|
111 | </hints> |
---|
112 | <subquests> |
---|
113 | <GlobalQuest id="quest4.1"> |
---|
114 | <QuestDescription title="Get to the Defense Station" description="" failMessage="" completeMessage="" /> |
---|
115 | </GlobalQuest> |
---|
116 | <GlobalQuest id="quest4.2"> |
---|
117 | <QuestDescription title="Find the turret" description="" failMessage="" completeMessage="" /> |
---|
118 | </GlobalQuest> |
---|
119 | </subquests> |
---|
120 | <complete-effects> |
---|
121 | <AddQuest questId="quest5" /> |
---|
122 | </complete-effects> |
---|
123 | </GlobalQuest> |
---|
124 | |
---|
125 | <GlobalQuest id="quest5"> |
---|
126 | <QuestDescription title="Fight the Hord!" description="" failMessage="" completeMessage="" /> |
---|
127 | <hints> |
---|
128 | </hints> |
---|
129 | <complete-effects> |
---|
130 | <AddQuest questId="quest6" /> |
---|
131 | <AddQuest questId="quest6.1" /> |
---|
132 | <AddQuest questId="quest6.2" /> |
---|
133 | </complete-effects> |
---|
134 | </GlobalQuest> |
---|
135 | |
---|
136 | <GlobalQuest id="quest6"> |
---|
137 | <QuestDescription title="Get back to the Transporter" description="" failMessage="" completeMessage="" /> |
---|
138 | <hints> |
---|
139 | </hints> |
---|
140 | <subquests> |
---|
141 | <GlobalQuest id="quest6.1"> |
---|
142 | <QuestDescription title="Collect the local Pickups" description="" failMessage="" completeMessage="" /> |
---|
143 | </GlobalQuest> |
---|
144 | <GlobalQuest id="quest6.2"> |
---|
145 | <QuestDescription title="Use Portal to the Transporter" description="" failMessage="" completeMessage="" /> |
---|
146 | </GlobalQuest> |
---|
147 | </subquests> |
---|
148 | <complete-effects> |
---|
149 | <AddQuest questId="quest7" /> |
---|
150 | </complete-effects> |
---|
151 | </GlobalQuest> |
---|
152 | |
---|
153 | <GlobalQuest id="quest7"> |
---|
154 | <QuestDescription title="Fight the final Wave" description="" failMessage="" completeMessage="" /> |
---|
155 | <hints> |
---|
156 | </hints> |
---|
157 | <subquests> |
---|
158 | </subquests> |
---|
159 | </GlobalQuest> |
---|
160 | |
---|
161 | <!--EVENTS AND TRIGGERS |
---|
162 | Usable events and triggers: |
---|
163 | _spawntrigger |
---|
164 | _reachedA |
---|
165 | _wave<k> |
---|
166 | _killedEnemy<k>.<i> |
---|
167 | _waveClear<k> |
---|
168 | --> |
---|
169 | |
---|
170 | <EventMultiTrigger name="spawntrigger"> |
---|
171 | <events> |
---|
172 | <trigger> |
---|
173 | <EventListener event="playerSpawn" /> |
---|
174 | </trigger> |
---|
175 | </events> |
---|
176 | </EventMultiTrigger> |
---|
177 | |
---|
178 | <DistanceTrigger name="reachedA" position="2494,-1667,0" distance=200 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true /> |
---|
179 | |
---|
180 | <EventMultiTrigger name="wave1" activations="1" stayactive="true" > |
---|
181 | <events> |
---|
182 | <trigger> |
---|
183 | <EventListener event="reachedA" /> |
---|
184 | </trigger> |
---|
185 | </events> |
---|
186 | </EventMultiTrigger> |
---|
187 | |
---|
188 | <!-- Recursive helper function for the end-of-wave events. F*ck the event system, seriously. --> |
---|
189 | <?lua |
---|
190 | function enemyTriggerRecursor(i, k) |
---|
191 | if i > 0 then |
---|
192 | return [[ |
---|
193 | <EventTrigger name=killedEnemy]] .. k .. [[.]] .. i .. [[ activations=1 stayactive=true delay=0.1> |
---|
194 | <events> |
---|
195 | <trigger> |
---|
196 | <EventListener event=attackers]] .. k .. [[ /> |
---|
197 | </trigger> |
---|
198 | </events> |
---|
199 | ]] .. enemyTriggerRecursor(i-1, k) .. [[ |
---|
200 | </EventTrigger> |
---|
201 | ]] |
---|
202 | else return "" |
---|
203 | end |
---|
204 | end |
---|
205 | ?> |
---|
206 | <!-- Actual recursive Event(s) for the respective waves. --> |
---|
207 | <?lua |
---|
208 | for k = 1, waves, 1 |
---|
209 | do |
---|
210 | print(enemyTriggerRecursor(enemies,k)) |
---|
211 | ?> |
---|
212 | <EventMultiTrigger name="waveClear<?lua print(k) ?>" delay=4.0> |
---|
213 | <events> |
---|
214 | <trigger> |
---|
215 | <EventListener event="killedEnemy<?lua print(k .. [[.]] .. enemies) ?>" /> |
---|
216 | </trigger> |
---|
217 | </events> |
---|
218 | </EventMultiTrigger> |
---|
219 | <?lua end ?> |
---|
220 | |
---|
221 | <!-- This trigger needs fixing, as endMission can only be called by a Pawn Distance Trigger. Herpaderp --> |
---|
222 | <EventMultiTrigger name="missionFailed" target="Pawn" stayActive="true" delay=1.5> |
---|
223 | <events> |
---|
224 | <trigger> |
---|
225 | <EventListener event="transporter" /> |
---|
226 | </trigger> |
---|
227 | </events> |
---|
228 | </EventMultiTrigger> |
---|
229 | |
---|
230 | <Script code="Mission endMission fail" onLoad="false" times="1"> |
---|
231 | <events> |
---|
232 | <trigger> |
---|
233 | <EventListener event="missionFailed" /> |
---|
234 | </trigger> |
---|
235 | </events> |
---|
236 | </Script> |
---|
237 | |
---|
238 | <!--QUEST EFFECT BEACONS --> |
---|
239 | |
---|
240 | <QuestEffectBeacon times=1> |
---|
241 | <effects> |
---|
242 | <AddQuest questId="quest1" /> |
---|
243 | </effects> |
---|
244 | <events> |
---|
245 | <execute> |
---|
246 | <EventListener event="spawntrigger" /> |
---|
247 | </execute> |
---|
248 | </events> |
---|
249 | </QuestEffectBeacon> |
---|
250 | |
---|
251 | <QuestEffectBeacon times=1> |
---|
252 | <effects> |
---|
253 | <CompleteQuest questId="quest1" /> |
---|
254 | </effects> |
---|
255 | <events> |
---|
256 | <execute> |
---|
257 | <EventListener event="reachedA" /> |
---|
258 | </execute> |
---|
259 | </events> |
---|
260 | </QuestEffectBeacon> |
---|
261 | |
---|
262 | <QuestEffectBeacon times=1> |
---|
263 | <effects> |
---|
264 | <CompleteQuest questId="quest3" /> |
---|
265 | </effects> |
---|
266 | <events> |
---|
267 | <execute> |
---|
268 | <EventListener event="waveClear1" /> |
---|
269 | </execute> |
---|
270 | </events> |
---|
271 | </QuestEffectBeacon> |
---|
272 | |
---|
273 | <!--NOTIFICATIONS --> |
---|
274 | |
---|
275 | <SimpleNotification broadcast="true" message="Welcome, Commander. Please report at Station A"> |
---|
276 | <events> |
---|
277 | <trigger> |
---|
278 | <EventListener event="spawntrigger" /> |
---|
279 | </trigger> |
---|
280 | </events> |
---|
281 | </SimpleNotification> |
---|
282 | |
---|
283 | <SimpleNotification broadcast="true" message="An enemy wave is approaching the shuttle!"> |
---|
284 | <events> |
---|
285 | <trigger> |
---|
286 | <EventListener event="wave1" /> |
---|
287 | <EventListener event="wave2" /> |
---|
288 | <EventListener event="wave3" /> |
---|
289 | </trigger> |
---|
290 | </events> |
---|
291 | </SimpleNotification> |
---|
292 | |
---|
293 | <SimpleNotification broadcast="true" message="yippie ki yay motherf*cker!"> |
---|
294 | <events> |
---|
295 | <trigger> |
---|
296 | <EventListener event="attackers1" /> |
---|
297 | <EventListener event="attackers2" /> |
---|
298 | <EventListener event="attackers3" /> |
---|
299 | </trigger> |
---|
300 | </events> |
---|
301 | </SimpleNotification> |
---|
302 | |
---|
303 | <SimpleNotification broadcast="true" message="Phew, that was close! Well done, Commmander."> |
---|
304 | <events> |
---|
305 | <trigger> |
---|
306 | <EventListener event="waveClear1" /> |
---|
307 | <EventListener event="waveClear2" /> |
---|
308 | <EventListener event="waveClear3" /> |
---|
309 | </trigger> |
---|
310 | </events> |
---|
311 | </SimpleNotification> |
---|
312 | |
---|
313 | <SimpleNotification broadcast="true" message="It's over... we failed. Retreat!"> |
---|
314 | <events> |
---|
315 | <trigger> |
---|
316 | <EventListener event="missionFailed" /> |
---|
317 | </trigger> |
---|
318 | </events> |
---|
319 | </SimpleNotification> |
---|
320 | |
---|
321 | <!--STRUCTURE --> |
---|
322 | |
---|
323 | <!-- (Temporary) Template for stations. Used to define common features of all Stations. --> |
---|
324 | <Template name="station"> |
---|
325 | <Pawn mass=10000 collisionType=dynamic friction=0.01> |
---|
326 | <attached> |
---|
327 | <Model mesh="HydroHarvester.mesh" position="0,0,0" scale=50 /> |
---|
328 | </attached> |
---|
329 | <collisionShapes> |
---|
330 | <BoxCollisionShape position="-560,0,0" halfExtents="115,100,245" /><!-- Three lower boxes --> |
---|
331 | <BoxCollisionShape position="290,0,-480" halfExtents="115,100,245" yaw=-120 /> |
---|
332 | <BoxCollisionShape position="290,0,480" halfExtents="115,100,245" yaw=-240 /> |
---|
333 | <BoxCollisionShape position="-280,0,0" halfExtents="163,50,50" /><!-- Three lower connections --> |
---|
334 | <BoxCollisionShape position="140,0,-240" halfExtents="163,50,50" yaw=-120 /> |
---|
335 | <BoxCollisionShape position="140,0,240" halfExtents="163,50,50" yaw=-240 /> |
---|
336 | <BoxCollisionShape position="0,530,0" halfExtents="172,52,298" /><!-- Upper Tower --> |
---|
337 | <BoxCollisionShape position="0,530,0" halfExtents="172,52,298" yaw=-120 /> |
---|
338 | <BoxCollisionShape position="0,530,0" halfExtents="172,52,298" yaw=-240 /> |
---|
339 | <BoxCollisionShape position="0,400,0" halfExtents="43,110,26" yaw=-30 /><!-- Middle one--> |
---|
340 | <BoxCollisionShape position="-200,100,0" halfExtents="26,50,43" /><!--Three lower legs --> |
---|
341 | <BoxCollisionShape position="100,100,-173" halfExtents="43,50,26" yaw=-30 /> |
---|
342 | <BoxCollisionShape position="100,100,-173" halfExtents="43,50,26" yaw=30 /> |
---|
343 | <BoxCollisionShape position="-100,264,0" halfExtents="26,105,43" roll=-49 /><!--Three upper legs --> |
---|
344 | <BoxCollisionShape position="50,264,-87" halfExtents="26,105,43" roll=-49 yaw=-120 /> |
---|
345 | <BoxCollisionShape position="50,264,87" halfExtents="26,105,43" roll=-49 yaw=-240 /> |
---|
346 | </collisionShapes> |
---|
347 | </Pawn> |
---|
348 | </Template> |
---|
349 | |
---|
350 | <!-- A, Coordinates are approx. (cos(29pi/16), sin(29pi/16), 0)*3000 --> |
---|
351 | <Pawn name="statA" radarname="Station A" position="5000,-3000,0" direction="0,1,0" initialhealth=1000 maxhealth=1000> |
---|
352 | <templates> |
---|
353 | <Template link="station" /> |
---|
354 | </templates> |
---|
355 | </Pawn> |
---|
356 | |
---|
357 | <!-- B, Coordinates are approx. (-cos(29pi/16), sin(29pi/16), 0)*3000 --> |
---|
358 | <Pawn name="statB" radarname="Station B" position="-5000,-3000,0" direction="0,1,0" initialhealth=1000 maxhealth=1000> |
---|
359 | <templates> |
---|
360 | <Template link="station" /> |
---|
361 | </templates> |
---|
362 | </Pawn> |
---|
363 | |
---|
364 | <!-- C --> |
---|
365 | <Pawn name="statC" radarname="Station C" position="0,-2000,0" direction="0,1,0" initialhealth=1000 maxhealth=1000> |
---|
366 | <templates> |
---|
367 | <Template link="station" /> |
---|
368 | </templates> |
---|
369 | </Pawn> |
---|
370 | |
---|
371 | <!--ELEMENTS --> |
---|
372 | |
---|
373 | <!-- Enemies. Outer loop defines waves, inner loop defines enemies in every wave. --> |
---|
374 | <?lua |
---|
375 | for k = 1, waves, 1 |
---|
376 | do |
---|
377 | ?> |
---|
378 | <?lua |
---|
379 | for i = 1, enemies, 1 |
---|
380 | do |
---|
381 | x = math.cos(math.pi/8*(i+1))*1500 |
---|
382 | y = math.sin(math.pi/8*(i+1))*1500 |
---|
383 | ?> |
---|
384 | <SpaceShip visible=false active=flase name="attackers<?lua print(k)?>" radarname="Attacker" position="<?lua print(x)?>,<?lua print(y)?>,<?lua print(math.pow(-1,i)*250) ?>" lookat="0,0,0" team=2> |
---|
385 | <templates> |
---|
386 | <Template link="spaceshippirate" /> |
---|
387 | </templates> |
---|
388 | <events> |
---|
389 | <visibility> |
---|
390 | <EventListener event="wave<?lua print(k)?>" /> |
---|
391 | </visibility> |
---|
392 | <activity> |
---|
393 | <EventListener event="wave<?lua print(k)?>" /> |
---|
394 | </activity> |
---|
395 | </events> |
---|
396 | <attached> |
---|
397 | <DistanceTriggerBeacon name="NPC" /> |
---|
398 | </attached> |
---|
399 | <controller> |
---|
400 | <WaypointPatrolController name="attackController" alertnessradius=50 team=1 active=false> |
---|
401 | <waypoints> |
---|
402 | <Attacher target="transporter" deletewithparent=false /> |
---|
403 | </waypoints> |
---|
404 | <events> |
---|
405 | <activity> |
---|
406 | <EventListener event="wave<?lua print(k)?>" /> |
---|
407 | </activity> |
---|
408 | </events> |
---|
409 | </WaypointPatrolController> |
---|
410 | </controller> |
---|
411 | </SpaceShip> |
---|
412 | <?lua end ?> |
---|
413 | <?lua end ?> |
---|
414 | |
---|
415 | <!-- Transporter, starting Point is near A, end Point near B, the circle parameters for the waypoints are: Center = (0, -887, 0), r = 2613 --> |
---|
416 | <SpaceShip position="2450, -1667, 0" lookat="-2494, -1667, 0" team=1 name="transporter" radarname="Shuttle"> |
---|
417 | <templates> |
---|
418 | <Template link="spaceshipTransporter" /> |
---|
419 | </templates> |
---|
420 | <attached> |
---|
421 | <DistanceTriggerBeacon name="NPC" /> |
---|
422 | </attached> |
---|
423 | <controller> |
---|
424 | <WaypointController accuracy=10> |
---|
425 | <waypoints> |
---|
426 | <!-- A to B --> |
---|
427 | <?lua |
---|
428 | max = 5 |
---|
429 | for i = 1, max, 1 |
---|
430 | do |
---|
431 | x = math.cos(math.pi*(i+1)/8)*2613 |
---|
432 | y = -math.sin(math.pi*(i+1)/8)*2613-887 |
---|
433 | ?> |
---|
434 | <Billboard position="<?lua print(x) ?>,<?lua print(y) ?>,0" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/> |
---|
435 | <?lua end ?> |
---|
436 | |
---|
437 | <!-- Return Point --> |
---|
438 | <Billboard position="-2450, -1667, 0" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/> |
---|
439 | |
---|
440 | <!-- B to A --> |
---|
441 | <?lua |
---|
442 | max = 5 |
---|
443 | for i = 1, max, 1 |
---|
444 | do |
---|
445 | x = math.cos(math.pi*(max+2-i)/8)*2613 |
---|
446 | y = -math.sin(math.pi*(max+2-i)/8)*2613-887 |
---|
447 | ?> |
---|
448 | <Billboard position="<?lua print(x) ?>,<?lua print(y) ?>,0" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/> |
---|
449 | <?lua end ?> |
---|
450 | |
---|
451 | <!-- Start Point --> |
---|
452 | <Billboard position="2450,-1667,0" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/> |
---|
453 | </waypoints> |
---|
454 | </WaypointController> |
---|
455 | </controller> |
---|
456 | </SpaceShip> |
---|
457 | |
---|
458 | </Scene> |
---|
459 | </Level> |
---|