Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/cegui0.8_ogre1.9/data/levels/shuttleAttack.oxw @ 12189

Last change on this file since 12189 was 11802, checked in by landauf, 7 years ago

migrated NotificationLayer.lua to cegui 0.8

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