Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/data/levels/shuttleAttack.oxw @ 11103

Last change on this file since 11103 was 11052, checked in by landauf, 9 years ago

merged branch presentationHS15 back to trunk

  • Property svn:eol-style set to native
File size: 42.0 KB
Line 
1<!--TODO: Shuttle and Stations -->
2<LevelInfo
3    name = "Shuttle under Attack"
4    description = "The newly discovered hostile alien species is attacking one of our outset stations, Andromeda! There is no protecting it; you have to escort the escape shuttle to a safer location."
5    tags = "mission"
6    screenshot = "shuttleProtect.png"
7/>
8
9<?lua
10    include("stats.oxo")
11    include("HUDTemplates3.oxo")
12    include("templates/lodInformation.oxt")
13
14    include("templates/spaceshipAssff.oxt")
15    include("templates/spaceshipPirate.oxt")
16    include("templates/spaceshipEscort.oxt")
17    include("templates/spaceshipShuttle.oxt")
18    include("templates/FPS.oxt")
19    include("templates/pickupRepresentationTemplates.oxt")
20?>
21
22<Level gametype = "Mission">
23    <templates>
24        <Template link="lodtemplate_default" />
25    </templates>
26
27    <?lua include("includes/notifications.oxi") ?>
28
29    <NotificationQueueCEGUI
30        name="narrative"
31        targets="simpleNotification"
32        size=3
33        displayTime=3.9
34        position="0.15, 0, 0.1, 0"
35        fontSize="15"
36        fontColor="0.3, 1, 0.2, 0.8"
37        alignment="HorzCentred"
38        displaySize="0.7, 0, 0, 0"
39    />
40
41    <!-- GLOBAL LUA VARIABLES -->
42    <?lua
43        waves = 3
44        enemiesInit = 5
45        enemiesIncrease = 2
46        allies = 3
47
48        --[[ Coordinates in (y,z,x). NOTE: Indexing starts at 1 in lua! Don´t forget to adapt the for loops, too! ]]--
49        cCenter = {0, 0, 0}
50        cSpawn = {-50, 0, 0}
51        cUnit = {-2000, 0, 3000}
52        cA = {-3000, 0, 5000}
53        cB = {-3000, 0, -5000}
54        cC = {-2300, 0, 0}
55        dStation = {1, 0, 0}
56        cNewShip = {-2100, 0, 4100}
57        cFPSGround = {-2300, 800, 0}
58        cFPS = {-2300, 1000, 0}
59        cField1 = {400, 0, 2500}
60        cField2 = {400, 0, -2500}
61        cPlanet1 = {8000, -2000, 15000}
62        cPlanet2 = {-20000, 4000, -1000}
63        rAllies = {3000, -2000}         --[[ To be addressed directly, hence r. Do not permute! ]]--
64
65        --[[ Function to print Coordinates. Quotes not included! ]]--
66        function printC(coord)
67          print(coord[1] .. [[,]] .. coord[2] .. [[,]] .. coord[3])
68        end
69    ?>
70
71    <Scene
72        ambientlight = "0.8, 0.8, 0.8"
73        skybox = "Orxonox/skyBoxMoreNebula"
74        hasPhysics = true
75    >
76
77    <SpawnPoint name="playerSpawn" team=0 position="<?lua printC(cSpawn) ?>" lookat="<?lua printC(cA) ?>" spawnclass=SpaceShip pawndesign=spaceshipescort />
78
79    <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" />
80
81    <Light type=directional position="<?lua printC(cCenter) ?>" 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"/>
82
83    <!--QUEST DEFINITIONS-->
84
85    <GlobalQuest id="quest1">
86        <QuestDescription title="Reach Andromeda Station!" description="You need to get in contact with your base! Word is enemies are preparing to attack our people and goods! Be quick!" failMessage="" completeMessage="" />
87        <hints>
88        </hints>
89        <complete-effects>
90            <AddQuest questId="quest2" />
91            <AddQuest questId="quest2.1" />
92        </complete-effects>
93    </GlobalQuest>
94
95    <GlobalQuest id="quest2">
96        <QuestDescription title="Prepare to fight the Enemy" description="You need to be prepared, mentally and physically! So gather all your strength and forces to destroy those space pirates!" failMessage="" completeMessage="" />
97        <hints>
98        </hints>
99        <subquests>
100            <GlobalQuest id="quest2.1">
101                <QuestDescription title="> Get a better Spaceship" description="Take over the faster, stronger, more secure and overall better spaceship!" failMessage="" completeMessage="" />
102                <complete-effects>
103                    <AddQuest questId="quest2.2" />
104                </complete-effects>
105            </GlobalQuest>
106            <GlobalQuest id="quest2.2">
107                <QuestDescription title="> Meet your Unit" description="Your unit will help you, where ever you go. To victory or to death, they will be loyal to you!" failMessage="" completeMessage="" />
108            </GlobalQuest>
109        </subquests>
110        <complete-effects>
111            <AddQuest questId="quest3" />
112        </complete-effects>
113    </GlobalQuest>
114
115    <GlobalQuest id="quest3">
116        <QuestDescription title="Fight the first Wave" description="Five enemies are approaching you! There main target is the shuttle though, so destroy them - before the destroy the escape shuttle with the valuebals goods (and of course the people aboard)!" failMessage="Oh no! You have to be better, they destroyed the shuttle!" completeMessage="Good Job!" />
117        <hints>
118        </hints>
119        <complete-effects>
120            <AddQuest questId="quest4" />
121            <AddQuest questId="quest4.1" />
122            <AddQuest questId="quest4.2" />
123        </complete-effects>
124    </GlobalQuest>
125
126    <GlobalQuest id="quest4">
127        <QuestDescription title="Prepare for the next Wave" description="This was just a scouting troop from the enemies, they know now how many there are from us and will send a bigger troop next time! Prepare yourself..." failMessage="" completeMessage="" />
128        <hints>
129        </hints>
130        <subquests>
131            <GlobalQuest id="quest4.1">
132                <QuestDescription title="> Get to the Defense Station" description="Fly to the defense station, we will guard your spaceship while you will fight them with the Cannon Suit." failMessage="" completeMessage="" />
133            </GlobalQuest>
134            <GlobalQuest id="quest4.2">
135                <QuestDescription title="> Get into the Cannon Suit!" description="Dock to the defense station, you will be able to contol the Cannon Suit on top of the station, perfect for fighting off a hord of enemies!" failMessage="" completeMessage="" />
136            </GlobalQuest>
137        </subquests>
138        <complete-effects>
139            <AddQuest questId="quest5" />
140        </complete-effects>
141    </GlobalQuest>
142
143    <GlobalQuest id="quest5">
144        <QuestDescription title="Fight the Hord!" description="Destroy the next wave!" failMessage="" completeMessage="" />
145        <hints>
146        </hints>
147        <complete-effects>
148            <AddQuest questId="quest6" />
149            <AddQuest questId="quest6.1" />
150            <AddQuest questId="quest6.2" />
151        </complete-effects>
152    </GlobalQuest>
153
154    <GlobalQuest id="quest6">
155        <QuestDescription title="Get back for the Showdown" description="Undock from the defense station and get into your Spaceship!" failMessage="" completeMessage="" />
156        <hints>
157        </hints>
158        <subquests>
159            <GlobalQuest id="quest6.1">
160                <QuestDescription title="> Collect the local Pickups" description="There is a box with pickups close to the station, you can collect them if you want to, but it is advised to do so. They will support your task in destroying the enemies and make your life easier." failMessage="" completeMessage="" />
161            </GlobalQuest>
162            <GlobalQuest id="quest6.2">
163                <QuestDescription title="> Get back to the Shuttle" description="Fly to the Shuttle!" failMessage="" completeMessage="" />
164            </GlobalQuest>
165        </subquests>
166        <complete-effects>
167            <AddQuest questId="quest7" />
168        </complete-effects>
169    </GlobalQuest>
170
171    <GlobalQuest id="quest7">
172        <QuestDescription title="Fight the final Wave" description="Good gracious, another hord of pirate ships!" failMessage="" completeMessage="" />
173        <hints>
174        </hints>
175        <subquests>
176        </subquests>
177    </GlobalQuest>
178
179    <!--EVENTS AND TRIGGERS
180        Usable events and triggers:
181        _spawntrigger
182        _reachedA
183        _dock<A|B|C>
184        _docked<A>      WIP; see below
185        -joinedUnit
186        _wave<k>
187        _killedEnemy<k>.<i>
188        _waveClear<k>
189    -->
190
191
192
193    <EventMultiTrigger name="spawntrigger" activations=1>
194        <events>
195            <trigger>
196                <EventListener event="playerSpawn" />
197            </trigger>
198        </events>
199    </EventMultiTrigger>
200
201    <DistanceTrigger name="reachedA" position="<?lua printC(cA) ?>" distance=1000 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true />
202
203    <!-- HACK: just waited out 3sec for animation. Cannot link an event to the COMPLETION of a dock. How is this not possible?? -->
204    <EventMultiTrigger name="dockedA" activations="1" stayactive="true" delay=3>
205        <events>
206            <trigger>
207                <EventListener event="dockA" />
208            </trigger>
209        </events>
210    </EventMultiTrigger>
211
212    <DistanceTrigger name="joinedUnit" active=false position="<?lua printC(cUnit) ?>" distance=100 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true>
213        <events>
214            <activity>
215                    <EventListener event="dockedA" />
216            </activity>
217        </events>
218    </DistanceTrigger>
219
220    <EventMultiTrigger name="wave1" activations="1" delay=4>
221        <events>
222            <trigger>
223                <EventListener event="joinedUnit" />
224            </trigger>
225        </events>
226    </EventMultiTrigger>
227
228    <!-- Recursive helper function for the end-of-wave events. F*ck the event system, seriously. -->
229    <?lua
230    function enemyTriggerRecursor(i, k)
231    if i > 0 then
232    return [[
233    <EventTrigger name=killedEnemy]] .. k .. [[.]] .. i .. [[ activations=1 stayactive=true delay=0.1>
234        <events>
235            <trigger>
236                <EventListener event=attackers]] .. k .. [[ />
237            </trigger>
238        </events>
239        ]] .. enemyTriggerRecursor(i-1, k) .. [[
240    </EventTrigger>
241    ]]
242    else return ""
243    end
244    end
245    ?>
246    <!-- Actual recursive Event(s) for the respective waves. -->
247    <?lua
248    enemies = enemiesInit
249    for k = 1, waves, 1
250    do
251    print(enemyTriggerRecursor(enemies,k))
252    ?>
253    <EventMultiTrigger name="waveClear<?lua print(k) ?>" delay=4.0>
254        <events>
255            <trigger>
256                <EventListener event="killedEnemy<?lua print(k .. [[.]] .. enemies) ?>" />
257            </trigger>
258        </events>
259    </EventMultiTrigger>
260    <?lua enemies = enemies + enemiesIncrease ?>
261    <?lua end ?>
262
263    <!-- This controls the ally AI controller so it is only active when active enemies are around! -->
264    <EventDispatcher name="allyControllerDispatcher">
265      <targets>
266        <EventTarget target="allyController" />
267      </targets>
268      <events>
269          <activity>
270              <?lua
271              for k = 1, waves, 1 do
272              ?>
273              <Trigger mode=and>
274                  <EventTrigger>
275                      <events>
276                          <trigger>
277                              <EventListener event="wave<?lua print(k) ?>" />
278                          </trigger>
279                      </events>
280                  </EventTrigger>
281                  <EventTrigger invert=true>
282                      <events>
283                          <trigger>
284                              <EventListener event="waveClear<?lua print(k) ?>" />
285                          </trigger>
286                      </events>
287                  </EventTrigger>
288              </Trigger>
289              <?lua end ?>
290          </activity>
291      </events>
292    </EventDispatcher>
293
294    <DistanceTrigger active=false name="reachedC" position="<?lua printC(cC) ?>" distance=400 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true>
295        <events>
296            <activity>
297                <EventListener event="waveClear1" />
298            </activity>
299        </events>
300    </DistanceTrigger>
301
302    <EventMultiTrigger name="dockedC" activations="1" stayactive="true" delay=3>
303        <events>
304            <trigger>
305                <EventListener event="dockC" />
306            </trigger>
307        </events>
308    </EventMultiTrigger>
309
310    <EventMultiTrigger name="wave2" activations="1" delay=8>
311        <events>
312            <trigger>
313                <EventListener event="dockedC" />
314            </trigger>
315        </events>
316    </EventMultiTrigger>
317
318    <EventMultiTrigger name="readyAfterWave2" activations="1" delay=2 stayactive=true>
319        <events>
320            <trigger>
321                <Trigger mode=and>
322                    <EventTrigger>
323                        <events>
324                            <trigger>
325                                <EventListener event="undockC" />
326                            </trigger>
327                        </events>
328                    </EventTrigger>
329                    <EventTrigger>
330                        <events>
331                            <trigger>
332                                <EventListener event="waveClear2" />
333                            </trigger>
334                        </events>
335                    </EventTrigger>
336                </Trigger>
337            </trigger>
338        </events>
339    </EventMultiTrigger>
340
341    <!-- See the DistanceTrigger attached to the shuttle here! !-->
342
343    <EventMultiTrigger name="wave3" activations="1" delay=12>
344        <events>
345            <trigger>
346                <EventListener event="reachedShuttle" />
347            </trigger>
348        </events>
349    </EventMultiTrigger>
350
351    <DistanceTrigger active=false name="reachedB" position="<?lua printC(cB) ?>" distance=400 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true>
352        <events>
353            <activity>
354                <EventListener event="waveClear3" />
355            </activity>
356        </events>
357    </DistanceTrigger>
358
359    <Script code="Mission endMission true" onLoad="false">
360        <events>
361            <trigger>
362                <EventListener event="reachedB" />
363            </trigger>
364        </events>
365    </Script>
366
367    <EventMultiTrigger name="missionFailed" activations="1" stayactive=true>
368        <events>
369            <trigger>
370                <EventListener event="transporter" />
371            </trigger>
372        </events>
373    </EventMultiTrigger>
374
375    <EventMultiTrigger name="failMissionHelper" delay=4 stayactive=true>
376        <events>
377            <trigger>
378                <EventListener event="missionFailed" />
379            </trigger>
380        </events>
381    </EventMultiTrigger>
382
383    <DistanceTrigger active=false name="failMission" position="<?lua printC(cA) ?>" distance=100 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true>
384        <events>
385            <activity>
386                <EventListener event="failMissionHelper" />
387            </activity>
388        </events>
389    </DistanceTrigger>
390
391    <!--HACK: Ultimately settled on docking A to fail the mission... that makes a whole lot of sense. -->
392
393    <Script code="Mission endMission fail" onLoad="false">
394        <events>
395            <trigger>
396                <EventListener event="failMission" />
397            </trigger>
398        </events>
399    </Script>
400
401    <!--QUEST EFFECT BEACONS -->
402
403    <QuestEffectBeacon times=1>
404        <effects>
405            <AddQuest questId="quest1" />
406        </effects>
407        <events>
408            <execute>
409                <EventListener event="spawntrigger" />
410            </execute>
411        </events>
412    </QuestEffectBeacon>
413
414    <QuestEffectBeacon times=1>
415        <effects>
416            <CompleteQuest questId="quest1" />
417        </effects>
418        <events>
419            <execute>
420                <EventListener event="reachedA" />
421            </execute>
422        </events>
423    </QuestEffectBeacon>
424
425    <QuestEffectBeacon times=1>
426        <effects>
427            <CompleteQuest questId="quest2.1" />
428        </effects>
429        <events>
430            <execute>
431                <EventListener event="dockedA" />
432            </execute>
433        </events>
434    </QuestEffectBeacon>
435
436    <QuestEffectBeacon times=1>
437        <effects>
438            <CompleteQuest questId="quest2.2" />
439            <CompleteQuest questId="quest2" />
440        </effects>
441        <events>
442            <execute>
443                <EventListener event="joinedUnit" />
444            </execute>
445        </events>
446    </QuestEffectBeacon>
447
448    <QuestEffectBeacon times=1>
449        <effects>
450            <CompleteQuest questId="quest3" />
451        </effects>
452        <events>
453            <execute>
454                <EventListener event="waveClear1" />
455            </execute>
456        </events>
457    </QuestEffectBeacon>
458
459    <QuestEffectBeacon times=1>
460        <effects>
461            <CompleteQuest questId="quest4.1" />
462        </effects>
463        <events>
464            <execute>
465                <EventListener event="reachedC" />
466            </execute>
467        </events>
468    </QuestEffectBeacon>
469
470    <QuestEffectBeacon times=1>
471        <effects>
472            <CompleteQuest questId="quest4.2" />
473            <CompleteQuest questId="quest4" />
474        </effects>
475        <events>
476            <execute>
477                <EventListener event="dockedC" />
478            </execute>
479        </events>
480    </QuestEffectBeacon>
481
482    <QuestEffectBeacon times=1>
483        <effects>
484            <CompleteQuest questId="quest5" />
485        </effects>
486        <events>
487            <execute>
488                <EventListener event="waveClear2" />
489            </execute>
490        </events>
491    </QuestEffectBeacon>
492
493    <QuestEffectBeacon times=1>
494        <effects>
495            <CompleteQuest questId="quest6.1" />
496        </effects>
497        <events>
498            <execute>
499                <EventListener event="gotPickups" />
500            </execute>
501        </events>
502    </QuestEffectBeacon>
503
504    <QuestEffectBeacon times=1>
505        <effects>
506            <CompleteQuest questId="quest6.2" />
507            <CompleteQuest questId="quest6" />
508        </effects>
509        <events>
510            <execute>
511                <EventListener event="reachedShuttle" />
512            </execute>
513        </events>
514    </QuestEffectBeacon>
515
516    <QuestEffectBeacon times=1>
517        <effects>
518            <CompleteQuest questId="quest7" />
519        </effects>
520        <events>
521            <execute>
522                <EventListener event="waveClear3" />
523            </execute>
524        </events>
525    </QuestEffectBeacon>
526
527    <!--NOTIFICATIONS -->
528
529    <SimpleNotification broadcast="true" message="Welcome, Commander. Please report at Andromeda Station.">
530        <events>
531            <trigger>
532                <EventTrigger stayactive="true" delay=4 >
533                   <events>
534                      <trigger>
535                         <EventListener event="spawntrigger" />
536                      </trigger>
537                   </events>
538                </EventTrigger>
539            </trigger>
540        </events>
541    </SimpleNotification>
542
543    <SimpleNotification broadcast="true" message="Our enemy is set to attack us very soon.">
544        <events>
545            <trigger>
546                <EventTrigger stayactive="true" delay=8 >
547                   <events>
548                      <trigger>
549                         <EventListener event="spawntrigger" />
550                      </trigger>
551                   </events>
552                </EventTrigger>
553            </trigger>
554        </events>
555    </SimpleNotification>
556
557    <SimpleNotification broadcast="true" message="Please study your mission briefing!">
558        <events>
559            <trigger>
560                <EventTrigger stayactive="true" delay=12 >
561                   <events>
562                      <trigger>
563                         <EventListener event="spawntrigger" />
564                      </trigger>
565                   </events>
566                </EventTrigger>
567            </trigger>
568        </events>
569    </SimpleNotification>
570
571    <SimpleNotification broadcast="true" message="Welcome to Andromeda, Commander.">
572        <events>
573            <trigger>
574                <EventListener event="reachedA" />
575            </trigger>
576        </events>
577    </SimpleNotification>
578
579    <SimpleNotification broadcast="true" message="We've prepared a reinforced Ship for you.">
580        <events>
581            <trigger>
582                <EventTrigger stayactive="true" delay=4 >
583                   <events>
584                      <trigger>
585                         <EventListener event="reachedA" />
586                      </trigger>
587                   </events>
588                </EventTrigger>
589            </trigger>
590        </events>
591    </SimpleNotification>
592
593    <SimpleNotification broadcast="true" message="Now join our defense Team.">
594        <events>
595            <trigger>
596                <EventListener event="dockedA" />
597            </trigger>
598        </events>
599    </SimpleNotification>
600
601    <SimpleNotification broadcast="true" message="Howdy Commander! Ready to kick some alien ass?">
602        <events>
603            <trigger>
604                <EventListener event="joinedUnit" />
605            </trigger>
606        </events>
607    </SimpleNotification>
608
609    <!-- HACK: Somehow only fires a second time if the (notification,event) pairs are separate! WTF -->
610    <?lua
611    for k = 1, waves, 1 do
612    ?>
613    <SimpleNotification broadcast="true" message="An enemy wave is approaching the shuttle!">
614        <events>
615            <trigger>
616                <EventListener event="wave<?lua print(k) ?>" />
617            </trigger>
618        </events>
619    </SimpleNotification>
620    <?lua end ?>
621
622    <SimpleNotification broadcast="true" message="yippie ki yay motherf*cker!">
623        <events>
624            <trigger>
625                <EventListener event="attackers1" />
626                <EventListener event="attackers2" />
627                <EventListener event="attackers3" />
628            </trigger>
629        </events>
630    </SimpleNotification>
631
632    <SimpleNotification broadcast="true" message="Phew, that was close! Well done, Commmander.">
633        <events>
634            <trigger>
635                <EventListener event="waveClear1" />
636            </trigger>
637        </events>
638    </SimpleNotification>
639
640    <SimpleNotification broadcast="true" message="But it's not over yet! Get to the defense station and dock!">
641        <events>
642            <trigger>
643                <EventTrigger stayactive="true" delay=4 >
644                   <events>
645                      <trigger>
646                         <EventListener event="waveClear1" />
647                      </trigger>
648                   </events>
649                </EventTrigger>
650            </trigger>
651        </events>
652    </SimpleNotification>
653
654    <SimpleNotification broadcast="true" message="This is our powerful reinforced cannon suit.">
655        <events>
656            <trigger>
657                <EventListener event="dockedC" />
658            </trigger>
659        </events>
660    </SimpleNotification>
661
662    <SimpleNotification broadcast="true" message="It should deal with those pesky invaders!">
663        <events>
664            <trigger>
665                <EventTrigger stayactive="true" delay=4 >
666                   <events>
667                      <trigger>
668                         <EventListener event="dockedC" />
669                      </trigger>
670                   </events>
671                </EventTrigger>
672            </trigger>
673        </events>
674    </SimpleNotification>
675
676    <SimpleNotification broadcast="true" message="Brilliant work, Commander! now undock again.">
677        <events>
678            <trigger>
679                <EventListener event="waveClear2" />
680            </trigger>
681        </events>
682    </SimpleNotification>
683
684    <SimpleNotification broadcast="true" message="Here's some supplies for you. Shoot that crate!">
685        <events>
686            <trigger>
687                <EventListener event="readyAfterWave2" />
688            </trigger>
689        </events>
690    </SimpleNotification>
691
692    <SimpleNotification broadcast="true" message="Our Intelligence reports one more wave...">
693        <events>
694            <trigger>
695                <EventListener event="reachedShuttle" />
696            </trigger>
697        </events>
698    </SimpleNotification>
699
700    <SimpleNotification broadcast="true" message="Ready to be a hero, Commander?">
701        <events>
702            <trigger>
703                <EventTrigger stayactive="true" delay=4 >
704                   <events>
705                      <trigger>
706                         <EventListener event="reachedShuttle" />
707                      </trigger>
708                   </events>
709                </EventTrigger>
710            </trigger>
711        </events>
712    </SimpleNotification>
713
714    <SimpleNotification broadcast="true" message="Congrats, Commander! You saved our skin.">
715        <events>
716            <trigger>
717                <EventListener event="waveClear3" />
718            </trigger>
719        </events>
720    </SimpleNotification>
721
722    <SimpleNotification broadcast="true" message="Get over to the safe base to take a break.">
723        <events>
724            <trigger>
725                <EventTrigger stayactive="true" delay=4 >
726                   <events>
727                      <trigger>
728                         <EventListener event="waveClear3" />
729                      </trigger>
730                   </events>
731                </EventTrigger>
732            </trigger>
733        </events>
734    </SimpleNotification>
735
736    <SimpleNotification broadcast="true" message="It's over... we failed. Retreat to Andromeda!">
737        <events>
738            <trigger>
739                <EventListener event="missionFailed" />
740            </trigger>
741        </events>
742    </SimpleNotification>
743
744    <!--STATIONS -->
745
746    <!-- (Temporary) Template for stations. Used to define common features of all Stations. -->
747    <Template name="station">
748        <Pawn mass=10000000 collisionType=dynamic friction=0.01>
749            <attached>
750                <Model mesh="HydroHarvester.mesh" position="0,0,0" scale=50 />
751                <DistanceTriggerBeacon name="NPC" />
752            </attached>
753            <collisionShapes>
754                <BoxCollisionShape  position="-560,0,0" halfExtents="115,100,245" /><!-- Three lower boxes -->
755                <BoxCollisionShape  position="290,0,-480" halfExtents="115,100,245" yaw=-120 />
756                <BoxCollisionShape  position="290,0,480" halfExtents="115,100,245" yaw=-240 />
757                <BoxCollisionShape  position="-280,0,0" halfExtents="163,50,50" /><!-- Three lower connections -->
758                <BoxCollisionShape  position="140,0,-240" halfExtents="163,50,50" yaw=-120 />
759                <BoxCollisionShape  position="140,0,240" halfExtents="163,50,50" yaw=-240 />
760                <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" /><!-- Upper Tower -->
761                <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" yaw=-120 />
762                <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" yaw=-240 />
763                <BoxCollisionShape  position="0,400,0" halfExtents="43,110,26" yaw=-30 /><!-- Middle one-->
764                <BoxCollisionShape  position="-200,100,0" halfExtents="26,50,43" /><!--Three lower legs -->
765                <BoxCollisionShape  position="100,100,-173" halfExtents="43,50,26" yaw=-30 />
766                <BoxCollisionShape  position="100,100,-173" halfExtents="43,50,26" yaw=30 />
767                <BoxCollisionShape  position="-100,264,0" halfExtents="26,105,43" roll=-49 /><!--Three upper legs -->
768                <BoxCollisionShape  position="50,264,-87" halfExtents="26,105,43" roll=-49 yaw=-120 />
769                <BoxCollisionShape  position="50,264,87" halfExtents="26,105,43" roll=-49 yaw=-240 />
770            </collisionShapes>
771        </Pawn>
772    </Template>
773
774    <!-- A, Coordinates are approx. (cos(29pi/16), sin(29pi/16), 0)*3000 -->
775    <Pawn name="statA" team=0 radarname="Andromeda Station" position="<?lua printC(cA) ?>" direction="<?lua printC(dStation) ?>" yaw=-50 initialhealth=10000 maxhealth=10000>
776        <templates>
777            <Template link="station" />
778        </templates>
779        <attached>
780            <DockingTarget name="dockTargetA" />
781            <Dock position="0,0,0" active=true>
782                <animations>
783                    <MoveToDockingTarget target="dockTargetA" />
784                </animations>
785                <effects>
786                    <DockToShip target="newSpaceShip" />
787                </effects>
788                <events>
789                    <execute>
790                        <EventListener event="dockA" />
791                    </execute>
792                </events>
793                <attached>
794                    <DistanceTrigger position="0,0,0" distance="200" target="SpaceShip" beaconMode="exclude" targetname="NPC" name="dockA" />
795                    <Billboard position="0,0,0" amplitude=1 material="Flares/lensflare" colour="1,0,0.05" />
796                </attached>
797            </Dock>
798        </attached>
799    </Pawn>
800
801    <!-- B, Coordinates are approx. (-cos(29pi/16), sin(29pi/16), 0)*3000 -->
802    <Pawn name="statB" team=0 radarname="Safe Base" position="<?lua printC(cB) ?>" direction="<?lua printC(dStation) ?>" yaw=210 initialhealth=10000 maxhealth=10000>
803        <templates>
804            <Template link="station" />
805        </templates>
806        <attached>
807            <DockingTarget name="dockTargetB" />
808            <Dock position="0,0,0" active=false>
809                <animations>
810                    <MoveToDockingTarget target="dockTargetB" />
811                </animations>
812                <effects>
813                    <DockToShip target="newSpaceShip" />
814                </effects>
815                <events>
816                    <execute>
817                        <EventListener event="dockB" />
818                    </execute>
819                </events>
820                <attached>
821                    <DistanceTrigger position="0,0,0" distance="200" target="SpaceShip" beaconMode="exclude" targetname="NPC" name="dockB" />
822                    <Billboard position="0,0,0" amplitude=1 material="Flares/lensflare" colour="1,0,0.05" />
823                </attached>
824            </Dock>
825        </attached>
826    </Pawn>
827
828    <!-- C -->
829    <Pawn name="statC" team=0 radarname="Defense Station" position="<?lua printC(cC) ?>" direction="<?lua printC(dStation) ?>" initialhealth=10000 maxhealth=10000>
830        <templates>
831            <Template link="station" />
832        </templates>
833        <attached>
834            <DockingTarget name="dockTargetC" />
835            <Dock position="0,0,0">
836                <animations>
837                    <MoveToDockingTarget target="dockTargetC" />
838                </animations>
839                <effects>
840                    <DockToShip target="fpsMode" />
841                </effects>
842                <events>
843                    <execute>
844                        <EventListener event="dockC" />
845                    </execute>
846                </events>
847                <attached>
848                    <!--HACK: We use another dock to undock back to the ship since undocking is not implemented... -->
849                    <Dock position="0,0,0" active=true>
850                        <effects>
851                            <DockToShip target="newSpaceShip" />
852                        </effects>
853                        <events>
854                            <execute>
855                                <EventListener event="undockC" />
856                            </execute>
857                        </events>
858                    </Dock>
859                    <DistanceTrigger active=false position="0,0,0" distance="200" target="SpaceShip" beaconMode="exclude" targetname="NPC" name="dockC">
860                        <events>
861                            <activity>
862                                <EventListener event="reachedC" />
863                            </activity>
864                        </events>
865                    </DistanceTrigger>
866                    <Billboard position="0,0,0" amplitude=1 material="Flares/lensflare" colour="1,0,0.05" />
867                </attached>
868            </Dock>
869        </attached>
870    </Pawn>
871
872    <!-- New SpaceShip as destination of dock A-->
873    <SpaceShip
874            template            = "spaceshipassff"
875            team                = "0"
876            position            = "<?lua printC(cNewShip) ?>"
877            lookat              = "<?lua print(rAllies[2] .. ',' .. [[0]] .. ',' .. rAllies[1]) ?>"
878            health              = "400"
879            initialhealth       = "400"
880            maxhealth           = "1500"
881            shieldhealth        = "80"
882            initialshieldhealth = "80"
883            maxshieldhealth     = "120"
884            shieldabsorption    = "0.8"
885            reloadrate          = "1"
886            reloadwaittime      = "1"
887            name                = "newSpaceShip"
888            radarname           = "Defender" >
889        <attached>
890            <DockingTarget name="newSpaceShip" />
891            <DistanceTriggerBeacon name="newSpaceShip" />
892        </attached>
893    </SpaceShip>
894
895    <!-- FPS Player as destination of dock C -->
896    <FpsPlayer team=0 template = "fps" radarname = "Cannon Suit" position = "<?lua printC(cFPS) ?>" lookat="<?lua printC(cCenter) ?>">
897        <attached>
898            <DockingTarget name="fpsMode" />
899            <DistanceTriggerBeacon name="fpsPlayer" />
900        </attached>
901        <collisionShapes>
902            <BoxCollisionShape position="0,0,0" halfExtents="1,1,1"/>
903        </collisionShapes>
904    </FpsPlayer>
905
906    <!-- Floor for FPS Player -->
907    <StaticEntity position="<?lua printC(cFPSGround) ?>" collisionType=static mass=100000 friction=0.01 >
908        <attached>
909            <Model position="0,0,0" mesh="crate.mesh" scale3D="80,5,80" />
910            <Billboard position="320,50,320" material="Flares/ringflare2" colour="0.2,0.4,0.8" />
911            <DistanceTrigger position="320,50,320" distance="50" target="Pawn" beaconMode="identify" targetname="fpsPlayer" name="undockC" stayactive=true />
912            <ForceField active=false position="0,0,0" mode="homogen" diameter="600" forcedirection = "0,-500,0" />
913        </attached>
914        <collisionShapes>
915            <BoxCollisionShape position="0,0,0" halfExtents="400,25,400" />
916        </collisionShapes>
917    </StaticEntity>
918
919    <!--ELEMENTS -->
920
921    <?lua
922        dofile("includes/asteroidField.lua")
923       asteroidField(cField1[1], cField1[2], cField1[3], 20, 30, 2000, 250, 0)
924    ?>
925
926    <?lua
927        dofile("includes/asteroidField.lua")
928       asteroidField(cField2[1], cField2[2], cField2[3], 20, 30, 2000, 250, 0)
929    ?>
930
931    <Planet
932        position="<?lua printC(cPlanet1) ?>"
933        scale="2000"
934        collisionType="dynamic"
935        linearDamping="0.8"
936        angularDamping="0"
937        mass="5000000"
938        pitch="0"
939        mesh="planets/muunilinst.mesh"
940        atmosphere="atmosphere1"
941        rotationaxis="1,0,0"
942        rotationrate="1.0"
943        atmospheresize="80.0f"
944        imagesize="1024.0f"
945        collisiondamage = 2
946        enablecollisiondamage = true
947      >
948      <attached>
949        <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
950        </attached>
951          <collisionShapes>
952            <SphereCollisionShape radius="2000" position="0,0,0" />
953      </collisionShapes>
954    </Planet>
955
956    <?lua
957        dofile("includes/asteroidField.lua")
958        asteroidBelt(cPlanet1[1], cPlanet1[2], cPlanet1[3], 30, 0, 30, 20, 40, 2800, 3000, 200, 1)
959    ?>
960
961    <Planet
962        position="<?lua printC(cPlanet2) ?>"
963        scale="3000"
964        collisionType="dynamic"
965        linearDamping="0.8"
966        angularDamping="0"
967        mass="5000000"
968        pitch="0"
969        mesh="planets/planet3.mesh"
970        atmosphere="atmosphere1"
971        rotationaxis="1,0,0"
972        rotationrate="1.0"
973        atmospheresize="80.0f"
974        imagesize="1024.0f"
975        collisiondamage = 2
976        enablecollisiondamage = true
977      >
978      <attached>
979        <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
980        </attached>
981          <collisionShapes>
982            <SphereCollisionShape radius="3000" position="0,0,0" />
983      </collisionShapes>
984    </Planet>
985
986    <?lua
987        dofile("includes/asteroidField.lua")
988        asteroidBelt(cPlanet2[1], cPlanet2[2], cPlanet2[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
989    ?>
990
991    <Pawn team=0 health=30 position="<?lua print((cC[1]+600) .. ',' .. cC[2] .. ',' .. (cC[3]-600)) ?>" direction="0,-1,0" collisionType=dynamic mass=1000 radarname="Supplies" name="gotPickups">
992        <events>
993            <visibility>
994                <EventListener event="readyAfterWave2" />
995            </visibility>
996            <activity>
997                <EventListener event="readyAfterWave2" />
998            </activity>
999        </events>
1000        <attached>
1001            <Model position="0,0,0" mesh="crate.mesh" scale3D="10,10,10" />
1002        </attached>
1003        <collisionShapes>
1004            <BoxCollisionShape position="0,0,0" halfExtents="30,30,30" />
1005        </collisionShapes>
1006    </Pawn>
1007
1008    <?lua
1009        include("includes/pickups.oxi")
1010    ?>
1011
1012    <PickupSpawner pickup=hugeshieldpickup position="<?lua print((cC[1]+585) .. ',' .. cC[2] .. ',' .. (cC[3]-585)) ?>" triggerDistance="15" maxSpawnedItems="1">
1013        <events>
1014            <visibility>
1015                <EventListener event="readyAfterWave2" />
1016            </visibility>
1017            <activity>
1018                <EventListener event="readyAfterWave2" />
1019            </activity>
1020        </events>
1021    </PickupSpawner>
1022
1023    <PickupSpawner pickup=crazyhealthpickup position="<?lua print((cC[1]+615) .. ',' .. cC[2] .. ',' .. (cC[3]-615)) ?>" triggerDistance="15" maxSpawnedItems="1">
1024        <events>
1025            <visibility>
1026                <EventListener event="readyAfterWave2" />
1027            </visibility>
1028            <activity>
1029                <EventListener event="readyAfterWave2" />
1030            </activity>
1031        </events>
1032    </PickupSpawner>
1033
1034    <PickupSpawner pickup=hugespeedpickup position="<?lua print((cC[1]+585) .. ',' .. cC[2] .. ',' .. (cC[3]-615)) ?>" triggerDistance="15" maxSpawnedItems="1" >
1035        <events>
1036            <visibility>
1037                <EventListener event="readyAfterWave2" />
1038            </visibility>
1039            <activity>
1040                <EventListener event="readyAfterWave2" />
1041            </activity>
1042        </events>
1043    </PickupSpawner>
1044
1045    <!-- Allies -->
1046    <?lua
1047    for i = 1, allies, 1
1048    do
1049    x = rAllies[1] + math.cos(2*math.pi/allies*(i+1))*100
1050    y = rAllies[2] + math.sin(2*math.pi/allies*(i+1))*100
1051    ?>
1052    <SpaceShip visible=false active=false name="allies<?lua print(k)?>" radarname="Ally" position="<?lua print(y)?>,<?lua print(math.pow(-1,i)*100) ?>,<?lua print(x)?>" lookat="0,0,0" team=0>
1053        <templates>
1054            <Template link="spaceshipassff" />
1055        </templates>
1056        <events>
1057            <visibility>
1058                <EventListener event="dockedA" />
1059            </visibility>
1060            <activity>
1061                <EventListener event="dockedA" />
1062            </activity>
1063        </events>
1064        <attached>
1065            <DistanceTriggerBeacon name="NPC" />
1066        </attached>
1067        <controller>
1068            <!-- also see allyControllerDispatcher -->
1069            <AIController name="allyController" accuracy=100 team=0 active=false />
1070        </controller>
1071    </SpaceShip>
1072    <?lua end ?>
1073
1074    <!-- Enemies. Outer loop defines waves, inner loop defines enemies in every wave. -->
1075    <?lua
1076    enemies = enemiesInit
1077    for k = 1, waves, 1
1078    do
1079    ?>
1080    <?lua
1081    for i = 1, enemies, 1
1082    do
1083    x = math.cos(math.pi/(2*enemies - 2)*(i+k))*1500
1084    y = math.sin(math.pi/(2*enemies - 2)*(i+k))*1500
1085    ?>
1086    <SpaceShip visible=false active=false name="attackers<?lua print(k)?>" radarname="Attacker" position="<?lua print(y)?>,<?lua print(math.pow(-1,i)*250) ?>,<?lua print(x)?>" lookat="0,0,0" team=1>
1087        <templates>
1088            <Template link="spaceshippirate" />
1089        </templates>
1090        <events>
1091            <visibility>
1092                <EventListener event="wave<?lua print(k)?>" />
1093            </visibility>
1094            <activity>
1095                <EventListener event="wave<?lua print(k)?>" />
1096            </activity>
1097        </events>
1098        <attached>
1099            <DistanceTriggerBeacon name="NPC" />
1100        </attached>
1101        <controller>
1102            <WaypointPatrolController name="attackController" accuracy=100 alertnessradius=100 team=1 active=false>
1103                <waypoints>
1104                    <Attacher target="transporter" deletewithparent=false />
1105                </waypoints>
1106                <events>
1107                    <activity>
1108                        <EventListener event="wave<?lua print(k)?>" />
1109                    </activity>
1110                </events>
1111            </WaypointPatrolController>
1112        </controller>
1113    </SpaceShip>
1114    <?lua end ?>
1115    <?lua
1116    enemies = enemies + enemiesIncrease
1117    end ?>
1118
1119    <!-- Transporter, starting Point is near A, end Point near B, the circle parameters for the waypoints are: Center = (0, -887, 0), r = 2613 -->
1120    <SpaceShip position="<?lua printC(cA) ?>" lookat="<?lua printC(cB) ?>" team=0 name="transporter" radarname="Shuttle" >
1121        <templates>
1122            <Template link="spaceshipShuttle" />
1123        </templates>
1124        <attached>
1125            <DistanceTriggerBeacon name="NPC" />
1126            <DistanceTriggerBeacon name="transporter" />
1127            <DistanceTrigger active=false name="reachedShuttle" position="0,0,0" distance=400 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true initialhealth=1000 maxhealth=1000>
1128                <events>
1129                    <activity>
1130                        <EventListener event="readyAfterWave2" />
1131                    </activity>
1132                </events>
1133            </DistanceTrigger>
1134        </attached>
1135        <controller>
1136            <WaypointController accuracy=10 team=0>
1137                <waypoints>
1138                    <!-- A to B -->
1139                    <?lua
1140                    max = 5
1141                    for i = 1, max, 1
1142                    do
1143                    x = math.cos(math.pi*(i+1)/8)*5000
1144                    y = -math.sin(math.pi*(i+1)/8)*700-3000
1145                    ?>
1146                    <Billboard position="<?lua print(y) ?>,0,<?lua print(x) ?>" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
1147                    <?lua end ?>
1148
1149                    <!-- Return Point -->
1150                    <Billboard position="<?lua printC(cB) ?>" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
1151
1152                    <!-- B to A -->
1153                    <?lua
1154                    max = 5
1155                    for i = 1, max, 1
1156                    do
1157                    x = math.cos(math.pi*(max+2-i)/8)*5000
1158                    y = -math.sin(math.pi*(max+2-i)/8)*700-3000
1159                    ?>
1160                    <Billboard position="<?lua print(y) ?>,0,<?lua print(x) ?>" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
1161                    <?lua end ?>
1162
1163                    <!-- Start Point -->
1164                    <Billboard position="<?lua printC(cA) ?>" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
1165                </waypoints>
1166            </WaypointController>
1167        </controller>
1168    </SpaceShip>
1169
1170    </Scene>
1171</Level>
Note: See TracBrowser for help on using the repository browser.