Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/data/levels/shuttleRetaliation.oxw @ 11326

Last change on this file since 11326 was 11104, checked in by fvultier, 9 years ago

Some HUDs (Health, Shield, Weapons, EnemyHealth, EnemyShield) are also displayed in FPS mode. Removed two unused redundant files.

  • Property svn:eol-style set to native
File size: 38.9 KB
RevLine 
[10823]1<LevelInfo
2    name = "Retaliation"
3    description = "This attack cannot be met with no consequences! Commander, we order you to get back to sector 5C and erradicate the alien menace at once!"
4    tags = "mission"
[10932]5    screenshot = "retailiation.png"
[10823]6/>
7
8<?lua
9    include("stats.oxo")
10    include("HUDTemplates3.oxo")
[11104]11    include("HUDTemplatesFPS.oxo")
[10823]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
[10906]44        enemies = 2
45        allies = 2
[10841]46
[10887]47        radSector = 12000
48
[10823]49        --[[ Coordinates in (y,z,x). NOTE: Indexing starts at 1 in lua! Don´t forget to adapt the for loops, too! ]]--
50        cCenter = {0, 0, 0}
[10887]51        cSpawn = {1500, -2000, 900}
52        cSector = {-15000, -5500, -9000}
53        cSectorEntry = {-4710, -5500, -2826}
54        cPathToEntry = {{0, -2000, 0}}
55        cBeacon = {-6500, -5500, -4400}
56         cAllyWait = cBeacon
[10823]57
[10887]58        cAlly = cSpawn
59        cEnemy = {-9600, -5500, -6000}
[10823]60
[10887]61        rSection= {0, -200, 0}
62        rWingman1 = {0, -100, 100}
63        rWingman2 = {0, -100, -100}
64
[10892]65        cPlanet1 = {20000, 0, 29000}
66        cPlanet2 = {-22000, 0, -29000}
[10841]67
[10892]68        cEnemyBasePlanet = {-20000, -8000, -10000}
[10841]69
70        cField1 = {-5000, -4000, -3000}
71        cField2 = {4000, 2000, 4500}
72
73
[10823]74        --[[ Function to print Coordinates. Quotes not included! ]]--
75        function printC(coord)
76          print(coord[1] .. [[,]] .. coord[2] .. [[,]] .. coord[3])
77        end
[10887]78
79        --[[ Function to add Coordinates.]]--
80        function addC(coord1, coord2)
81            return {coord1[1]+coord2[1], coord1[2]+coord2[2], coord1[3]+coord2[3]}
82        end
[10823]83    ?>
84
85    <Scene
86        ambientlight = "0.8, 0.8, 0.8"
87        skybox = "Orxonox/skyBoxMoreNebula"
88        hasPhysics = true
89    >
90
91    <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" />
92
[10887]93    <Light type=directional position="<?lua printC(cSpawn) ?>" 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"/>
[10823]94
[10887]95    <!--SPAWNING-->
96
97    <Template name=commander>
98        <SpaceShip
99            template            = "spaceshipassff"
100            team                = "0"
101            health              = "800"
102            initialhealth       = "800"
103            maxhealth           = "1500"
104            shieldhealth        = "80"
105            initialshieldhealth = "80"
106            maxshieldhealth     = "120"
107            shieldabsorption    = "0.8"
108            reloadrate          = "1"
109            reloadwaittime      = "1"
110            name                = "commander"
111            radarname           = "Commander"
112            >
113            <attached>
114                <DistanceTriggerBeacon name="Commander" />
115            </attached>
116        </SpaceShip>
117    </Template>
118
119    <Template name=ally>
120        <SpaceShip
121            template            = "spaceshipassff"
122            team                = "0"
123            radarname           = "Ally"
124            lookat              = "<?lua printC(cPathToEntry[1]) ?>"
125        >
126            <attached>
127                <DistanceTriggerBeacon name="Ally" />
128            </attached>
129        </SpaceShip>
130    </Template>
131
132    <Template name=enemy>
133        <SpaceShip
134            template            = "spaceshippirate"
135            team                = "1"
136            radarname           = "Invader"
137            lookat              = "<?lua printC(cBeacon) ?>"
138            active              = false
139            visible             = false
140        >
141            <attached>
142                <DistanceTriggerBeacon name="Enemy" />
143            </attached>
144        </SpaceShip>
145    </Template>
146
147    <TeamSpawnPoint active=false name="playerSpawn" team=0 position="<?lua printC(cSpawn) ?>" lookat="<?lua printC(cPathToEntry[1]) ?>" spawnclass=SpaceShip pawndesign=commander>
148        <events>
149            <activity>
150                <EventTrigger invert=true>
151                  <events>
152                    <trigger>
153                      <EventListener event="reachedSector" />
154                    </trigger>
155                  </events>
156                </EventTrigger>
157            </activity>
158        </events>
159    </TeamSpawnPoint>
160
161    <TeamSpawnPoint active=false name="altSpawn" team=0 position="<?lua printC(cBeacon) ?>" lookat="<?lua printC(cSector) ?>" spawnclass=SpaceShip pawndesign=commander>
162        <events>
163            <activity>
164                <EventListener event="reachedSector" />
165            </activity>
166        </events>
167    </TeamSpawnPoint>
168
[10823]169    <!--QUEST DEFINITIONS-->
170
171    <GlobalQuest id="quest1">
[10887]172        <QuestDescription title="Enter Sector 5C" description="It is time to retaliate against the aggressors. Get back to Sector 5C to kill every last one of them! We have you covered with <?lua print(allies) ?> of our finest Divisions. They will guide, help and protect you if necessary." failMessage="" completeMessage="" />
[10823]173        <hints>
[10887]174            <QuestHint id="quest1hint1">
175                <QuestDescription title="Markings" description="We have marked the bounds of Sector 5C in red lights, you can follow the green trail to get there." />
176            </QuestHint>
[10823]177        </hints>
178    </GlobalQuest>
179
[10841]180    <GlobalQuest id="quest2">
[10887]181        <QuestDescription title="Find them" description="It seems they have hidden themselves, that is, their whole civilization, in fear of retaliation. Our scientists presume some cloaking technology to be in use. Look out for a way to make the aggressors visible!" failMessage="" completeMessage="" />
[10841]182        <hints>
183            <QuestHint id="quest2hint1">
[10887]184                <QuestDescription title="The detector beacon" description="Our scientists claim cloaking is generally toggled by a visible Switch called a detector beacon. Try to find a bright light in your Area and approach it!" />
[10841]185            </QuestHint>
186        </hints>
187    </GlobalQuest>
188
189    <GlobalQuest id="quest3">
190        <QuestDescription title="Fight their army" description="You have successfully uncovered their civilization and home planet, and it is much worse than we thought... they came prepared! You have to fight their army to fulfill your mission." failMessage="" completeMessage="" />
191        <hints>
192        </hints>
193        <complete-effects>
194            <AddQuest questId="quest4" />
[10887]195            <AddQuest questId="quest4.1" />
196            <AddQuest questId="quest4.2" />
197            <AddQuestHint hintId="quest4.1hint1" />
198            <AddQuestHint hintId="quest4.2hint1" />
[10841]199        </complete-effects>
200    </GlobalQuest>
201
202    <GlobalQuest id="quest4">
[10887]203        <QuestDescription title="Do the right thing" description="The aggressors have surrendered and seem to have had good reasons for their actions. Yet they did not talk to us beforehand and tried to kill us. What will you do?" failMessage="" completeMessage="" />
[10841]204        <hints>
205        </hints>
[10887]206        <subquests>
207            <GlobalQuest id="quest4.1">
208                <QuestDescription title="> Destroy their civilisation" description="Even if they had reasons, they are still murderers and can not be trusted anymore. This whole thing might even be a setup... We need to kill them and destroy their planet!" failMessage="" completeMessage="" />
209                <hints>
210                    <QuestHint id="quest4.1hint1">
[10907]211                        <QuestDescription title="Choosing" description="To make this choice, kill the remaining enemy ships. The divisions will follow your decision." />
[10887]212                    </QuestHint>
213                </hints>
214            </GlobalQuest>
215            <GlobalQuest id="quest4.2">
216                <QuestDescription title="> Spare them and leave" description="Military tension arising from a missunderstanding is no valid reasoning for a genocide. Nothing is. We should leave and talk this out later." failMessage="" completeMessage="" />
217                <hints>
218                    <QuestHint id="quest4.2hint1">
[10907]219                        <QuestDescription title="Choosing" description="To make this choice, fly out of the sector. The divisions will follow your decision." />
[10887]220                    </QuestHint>
221                </hints>
222            </GlobalQuest>
223        </subquests>
[10841]224    </GlobalQuest>
225
[10823]226    <!--EVENTS AND TRIGGERS
227        Usable events and triggers:
228        spawntrigger
229    -->
230
[10841]231    <EventMultiTrigger name="spawntrigger" activations=1>
[10823]232        <events>
233            <trigger>
234                <EventListener event="playerSpawn" />
235            </trigger>
236        </events>
237    </EventMultiTrigger>
238
[10904]239    <EventMultiTrigger name="spawned" stayactive=true activations=1>
240        <events>
241            <trigger>
242                <EventListener event="spawntrigger" />
243            </trigger>
244        </events>
245    </EventMultiTrigger>
246
[10887]247    <DistanceTrigger name="reachedSector" position="<?lua printC(cSector) ?>" distance="<?lua print(radSector) ?>" target="SpaceShip" beaconMode="identify" targetname="Commander" stayactive=true />
[10841]248
[10887]249    <EventMultiTrigger name="addQuest2">
250        <events>
251            <trigger>
252                <EventTrigger stayactive="true" delay=10 >
253                   <events>
254                      <trigger>
255                         <EventListener event="reachedSector" />
256                      </trigger>
257                   </events>
258                </EventTrigger>
259            </trigger>
260        </events>
261    </EventMultiTrigger>
262
263    <DistanceTrigger name="alliesReachedWait" position="<?lua printC(cAllyWait) ?>" distance="1000" target="SpaceShip" beaconMode="identify" targetname="Ally" stayactive=true />
264
265    <!-- So the allies stall when they reached their position for negociation and don´t fire away... -->
266
267    <EventDispatcher name="allyControllerDispatcher">
268      <targets>
269        <EventTarget target="allyController" />
270      </targets>
271      <events>
272          <activity>
[10904]273                <Trigger mode=or>
274                    <EventTrigger invert=true>
275                        <events>
276                            <trigger>
277                                <EventListener event="alliesReachedWait" />
278                            </trigger>
279                        </events>
280                    </EventTrigger>
281                    <EventTrigger>
282                        <events>
283                            <trigger>
284                                <EventListener event="noMercy" />
285                            </trigger>
286                        </events>
287                    </EventTrigger>
288                    <Trigger mode=and>
289                        <EventTrigger>
290                            <events>
291                                <trigger>
292                                    <EventListener event="fightBegun" />
293                                </trigger>
294                            </events>
295                        </EventTrigger>
296                        <EventTrigger invert=true>
297                            <events>
298                                <trigger>
299                                    <EventListener event="oneUnitLeft" />
300                                </trigger>
301                            </events>
302                        </EventTrigger>
303                    </Trigger>
[10907]304                </Trigger>
[10887]305          </activity>
306      </events>
307    </EventDispatcher>
308
[10841]309    <EventMultiTrigger name="hintBeacon">
310        <events>
311            <trigger>
[10887]312                <EventTrigger stayactive="true" delay=70 >
[10841]313                   <events>
314                      <trigger>
315                         <EventListener event="reachedSector" />
316                      </trigger>
317                   </events>
318                </EventTrigger>
319            </trigger>
320        </events>
321    </EventMultiTrigger>
322
[10887]323    <DistanceTrigger name="cloakBeacon" position="<?lua printC(cBeacon) ?>" distance=100 target="SpaceShip" beaconMode="identify" targetname="Commander" stayactive=true />
[10841]324
[10887]325    <EventMultiTrigger name="fightBegun" stayactive=true>
326        <events>
327            <trigger>
328                <EventTrigger stayactive="true" delay=12>
329                   <events>
330                      <trigger>
331                         <EventListener event="cloakBeacon" />
332                      </trigger>
333                   </events>
334                </EventTrigger>
335            </trigger>
336        </events>
337    </EventMultiTrigger>
338
339    <EventDispatcher name="enemyControllerDispatcher">
340      <targets>
341        <EventTarget target="enemyController" />
342      </targets>
343      <events>
344          <activity>
345              <Trigger mode=and>
346                  <EventTrigger>
347                      <events>
348                          <trigger>
349                              <EventListener event="fightBegun" />
350                          </trigger>
351                      </events>
352                  </EventTrigger>
353                  <EventTrigger invert=true>
354                      <events>
355                          <trigger>
356                              <EventListener event="oneUnitLeft" />
357                          </trigger>
358                      </events>
359                  </EventTrigger>
360              </Trigger>
361          </activity>
362      </events>
363    </EventDispatcher>
364
365    <EventMultiTrigger name="noMercy" stayactive=true>
366        <events>
367            <trigger>
[10907]368                <EventListener event="allUnitsDown" />
[10887]369            </trigger>
370        </events>
371    </EventMultiTrigger>
372
[10907]373    <EventMultiTrigger name="enemyPlanetMulti">
374     <events>
375         <trigger>
376             <EventListener event="enemyPlanet" />
377         </trigger>
378     </events>
379    </EventMultiTrigger>
380
[10887]381    <!-- Recursive helper function for the event at the "end" of a Unit.-->
382    <?lua
383    function enemyTriggerRecursor(i, k)
384    if i > 0 then
385    return [[
386    <EventTrigger name=killedEnemy]] .. ((k-1)*4+i) .. [[ activations=1 stayactive=true delay=0.1>
387        <events>
388            <trigger>
389                <EventListener event=enemy]] .. k .. [[ />
390            </trigger>
391        </events>
392        ]] .. enemyTriggerRecursor(i-1, k) .. [[
393    </EventTrigger>
394    ]]
395    else return ""
396    end
397    end
398    ?>
399    <!-- Actual recursive Event(s) for the respective Units. (packs of 4 Enemies that is!) -->
400    <?lua
401    for k = 1, enemies, 1
402    do
403    print(enemyTriggerRecursor(4,k))
404    ?>
405    <EventMultiTrigger name="unit<?lua print(k) ?>Down" delay=0.1 stayactive=true>
406        <events>
407            <trigger>
408                <EventListener event="killedEnemy<?lua print(k*4) ?>" />
409            </trigger>
410        </events>
411    </EventMultiTrigger>
412    <?lua end ?>
413
414    <EventMultiTrigger name="oneUnitLeft" stayactive=true>
415        <events>
416            <trigger>
417                <Trigger mode=or>
418                    <?lua
419                    for k = 1, enemies, 1
420                    do
421                    ?>
422                        <Trigger mode=and>
423                            <EventTrigger invert=true>
424                                <events>
425                                    <trigger>
426                                        <EventListener event="unit<?lua print(k) ?>Down" />
427                                    </trigger>
428                                </events>
429                            </EventTrigger>
430                            <?lua
431                            for i = 1, enemies, 1
432                            do
433                            if not (i == k) then
434                            ?>
435                            <EventTrigger>
436                                <events>
437                                    <trigger>
438                                        <EventListener event="unit<?lua print(i) ?>Down" />
439                                    </trigger>
440                                </events>
441                            </EventTrigger>
442                            <?lua end end ?>
443                        </Trigger>
444                    <?lua end ?>
445                </Trigger>
446            </trigger>
447        </events>
448    </EventMultiTrigger>
449
[10904]450    <EventMultiTrigger name="allUnitsDown" stayactive=true>
[10887]451        <events>
452            <trigger>
453                <Trigger mode=and>
454                    <?lua
455                    for k = 1, enemies, 1
456                    do
457                    ?>
458                    <EventTrigger>
459                        <events>
460                            <trigger>
[10907]461                                <EventListener event="unit<?lua print(k) ?>Down" />
[10887]462                            </trigger>
463                        </events>
464                    </EventTrigger>
465                    <?lua end ?>
466                </Trigger>
467            </trigger>
468        </events>
469    </EventMultiTrigger>
470
[10823]471    <!--TODO: Complete the DistanceTriggers for completing/succeeding correctly! -->
472
[10907]473    <DistanceTrigger active=false invert=true name="almostLeft" position="<?lua printC(cSector) ?>" distance="<?lua print(radSector-200) ?>" target="SpaceShip" beaconMode="identify" targetname="Commander" stayactive=true>
[10823]474        <events>
475            <activity>
[10907]476                <Trigger mode=and>
477                    <EventTrigger>
478                        <events>
479                            <trigger>
480                                <EventListener event="oneUnitLeft" />
481                            </trigger>
482                        </events>
483                    </EventTrigger>
484                    <EventTrigger invert=true>
485                        <events>
486                            <trigger>
487                                <EventListener event="enemyPlanetMulti" />
488                            </trigger>
489                        </events>
490                    </EventTrigger>
491                </Trigger>
[10823]492            </activity>
493        </events>
494    </DistanceTrigger>
495
[10907]496    <DistanceTrigger active=false invert=true name="leftSector" position="<?lua printC(cSector) ?>" distance="<?lua print(radSector) ?>" target="SpaceShip" beaconMode="identify" targetname="Commander" stayactive=true>
[10823]497        <events>
498            <activity>
[10907]499                <EventListener event="oneUnitLeft" />
[10823]500            </activity>
501        </events>
502    </DistanceTrigger>
503
[10907]504    <Script code="Mission endMission true" onLoad="false">
[10823]505        <events>
506            <trigger>
[10907]507                <EventListener event="leftSector" />
[10823]508            </trigger>
509        </events>
510    </Script>
511
512    <!--QUEST EFFECT BEACONS -->
513
514    <QuestEffectBeacon times=1>
515        <effects>
516            <AddQuest questId="quest1" />
[10887]517            <AddQuestHint HintId="quest1hint1" />
[10823]518        </effects>
519        <events>
520            <execute>
521                <EventListener event="spawntrigger" />
522            </execute>
523        </events>
524    </QuestEffectBeacon>
525
[10841]526    <QuestEffectBeacon times=1>
527        <effects>
528            <CompleteQuest questId="quest1" />
529        </effects>
530        <events>
531            <execute>
532                <EventListener event="reachedSector" />
533            </execute>
534        </events>
535    </QuestEffectBeacon>
536
537    <QuestEffectBeacon times=1>
538        <effects>
[10887]539            <AddQuest questId="quest2" />
[10841]540        </effects>
541        <events>
542            <execute>
[10887]543                <EventListener event="addQuest2" />
544            </execute>
545        </events>
546    </QuestEffectBeacon>
547
548    <QuestEffectBeacon times=1>
549        <effects>
550            <AddQuestHint hintId="quest2hint1
551                " />
552        </effects>
553        <events>
554            <execute>
[10841]555                <EventListener event="hintBeacon" />
556            </execute>
557        </events>
558    </QuestEffectBeacon>
559
560    <QuestEffectBeacon times=1>
561        <effects>
562            <CompleteQuest questId="quest2" />
563        </effects>
564        <events>
565            <execute>
566                <EventListener event="cloakBeacon" />
567            </execute>
568        </events>
569    </QuestEffectBeacon>
570
[10887]571    <QuestEffectBeacon times=1>
572        <effects>
573            <AddQuest questId="quest3" />
574        </effects>
575        <events>
576            <execute>
577                <EventListener event="fightBegun" />
578            </execute>
579        </events>
580    </QuestEffectBeacon>
581
582    <QuestEffectBeacon times=1>
583        <effects>
584            <CompleteQuest questId="quest3" />
585        </effects>
586        <events>
587            <execute>
588                <EventListener event="oneUnitLeft" />
589            </execute>
590        </events>
591    </QuestEffectBeacon>
592
593    <!--TODO: Include planet destruction and quitting -->
594
595    <QuestEffectBeacon times=1>
596        <effects>
597            <CompleteQuest questId="quest4" />
598        </effects>
599        <events>
600            <execute>
601                <EventListener event="enemyAllGone" />
602            </execute>
603        </events>
604    </QuestEffectBeacon>
605
606
[10823]607    <!--NOTIFICATIONS -->
608
[10841]609    <SimpleNotification broadcast="true" message="Welcome, Commander. It is time to retaliate!">
[10823]610        <events>
611            <trigger>
612                <EventTrigger stayactive="true" delay=4 >
613                   <events>
614                      <trigger>
615                         <EventListener event="spawntrigger" />
616                      </trigger>
617                   </events>
618                </EventTrigger>
619            </trigger>
620        </events>
621    </SimpleNotification>
622
[10841]623    <SimpleNotification broadcast="true" message="Get to section 5C and erradicate the aggressors!">
624        <events>
625            <trigger>
626                <EventTrigger stayactive="true" delay=8 >
627                   <events>
628                      <trigger>
629                         <EventListener event="spawntrigger" />
630                      </trigger>
631                   </events>
632                </EventTrigger>
633            </trigger>
634        </events>
635    </SimpleNotification>
[10823]636
[10841]637    <SimpleNotification broadcast="true" message="That seems extreme. Is there no way around it?">
638        <events>
639            <trigger>
640                <EventTrigger stayactive="true" delay=12 >
641                   <events>
642                      <trigger>
643                         <EventListener event="spawntrigger" />
644                      </trigger>
645                   </events>
646                </EventTrigger>
647            </trigger>
648        </events>
649    </SimpleNotification>
650
[10887]651    <SimpleNotification broadcast="true" message="Stick to your objective, Commander. This is war.">
[10841]652        <events>
653            <trigger>
654                <EventTrigger stayactive="true" delay=16 >
655                   <events>
656                      <trigger>
657                         <EventListener event="spawntrigger" />
658                      </trigger>
659                   </events>
660                </EventTrigger>
661            </trigger>
662        </events>
663    </SimpleNotification>
664
[10887]665    <SimpleNotification broadcast="true" message="Huh?! The sector is empty! where are they hiding?">
666       <events>
667           <trigger>
668               <EventTrigger stayactive="true" delay=2 >
669                  <events>
670                     <trigger>
671                        <EventListener event="reachedSector" />
672                     </trigger>
673                  </events>
674               </EventTrigger>
675           </trigger>
676       </events>
677    </SimpleNotification>
[10841]678
[10887]679    <SimpleNotification broadcast="true" message="They must be cloaking themselves! But we'll figure it out...">
680      <events>
681          <trigger>
682              <EventTrigger stayactive="true" delay=6 >
683                 <events>
684                    <trigger>
685                       <EventListener event="reachedSector" />
686                    </trigger>
687                 </events>
688              </EventTrigger>
689          </trigger>
690      </events>
691    </SimpleNotification>
[10841]692
[10887]693    <SimpleNotification broadcast="true" message="Got it! Look out for a bright light and touch it!">
694     <events>
695         <trigger>
696             <EventListener event="addQuest2" />
697         </trigger>
698     </events>
699    </SimpleNotification>
[10841]700
[10887]701    <SimpleNotification broadcast="true" message="Divisions are standing by, Sir.">
702     <events>
703         <trigger>
704             <EventListener event="alliesReachedWait" />
705         </trigger>
706     </events>
707    </SimpleNotification>
[10841]708
[10887]709    <SimpleNotification broadcast="true" message="Woah! what the hell! they boobytrapped us!">
710     <events>
711         <trigger>
712             <EventListener event="cloakBeacon" />
713         </trigger>
714     </events>
715    </SimpleNotification>
[10841]716
[10887]717    <SimpleNotification broadcast="true" message="Greetings, Humans. Are you here to resign to your menace and make amends?">
718     <events>
719         <trigger>
720             <EventTrigger stayactive="true" delay=4 >
721                <events>
722                   <trigger>
723                      <EventListener event="cloakBeacon" />
724                   </trigger>
725                </events>
726             </EventTrigger>
727         </trigger>
728     </events>
729    </SimpleNotification>
[10841]730
[10887]731    <SimpleNotification broadcast="true" message="Menace? What is he on about, General?">
732     <events>
733         <trigger>
734             <EventTrigger stayactive="true" delay=8 >
735                <events>
736                   <trigger>
737                      <EventListener event="cloakBeacon" />
738                   </trigger>
739                </events>
740             </EventTrigger>
741         </trigger>
742     </events>
743    </SimpleNotification>
[10841]744
[10887]745    <SimpleNotification broadcast="true" message="None of your concern, Commander. Launch the attack!">
746     <events>
747         <trigger>
748             <EventTrigger stayactive="true" delay=12 >
749                <events>
750                   <trigger>
751                      <EventListener event="cloakBeacon" />
752                   </trigger>
753                </events>
754             </EventTrigger>
755         </trigger>
756     </events>
757    </SimpleNotification>
[10841]758
[10887]759    <SimpleNotification broadcast="true" message="Unit 1 down!">
760     <events>
761         <trigger>
762             <EventListener event="unit1Down" />
763         </trigger>
764     </events>
765    </SimpleNotification>
[10841]766
[10887]767    <SimpleNotification broadcast="true" message="Unit 2 down!">
768     <events>
769         <trigger>
770             <EventListener event="unit2Down" />
771         </trigger>
772     </events>
773    </SimpleNotification>
774
775    <SimpleNotification broadcast="true" message="Unit 3 down!">
776     <events>
777         <trigger>
778             <EventListener event="unit3Down" />
779         </trigger>
780     </events>
781    </SimpleNotification>
782
783    <SimpleNotification broadcast="true" message="Unit 4 down!">
784     <events>
785         <trigger>
786             <EventListener event="unit4Down" />
787         </trigger>
788     </events>
789    </SimpleNotification>
790
791    <SimpleNotification broadcast="true" message="Please! No More! We surrender!">
792     <events>
793         <trigger>
794             <EventListener event="oneUnitLeft" />
795         </trigger>
796     </events>
797    </SimpleNotification>
798
[10907]799    <SimpleNotification broadcast="true" message="Roger that, Commander. We destroy their planet.">
[10887]800     <events>
801         <trigger>
[10904]802             <EventListener event="allUnitsDown" />
[10887]803         </trigger>
804     </events>
805    </SimpleNotification>
806
[10907]807    <SimpleNotification broadcast="true" message="Well done, Commander! Now exfiltrate the sector!">
[10887]808     <events>
809         <trigger>
[10907]810             <EventListener event="enemyPlanetMulti" />
[10887]811         </trigger>
812     </events>
813    </SimpleNotification>
814
[10907]815    <SimpleNotification broadcast="true" message="This will have dire consequences, Commander!">
816     <events>
817         <trigger>
818             <EventListener event="almostLeft" />
819         </trigger>
820     </events>
821    </SimpleNotification>
822
[10887]823    <!--ELEMENTS -->
824
825    <!-- Billboard Path to Sector 5C. Height changes in an atan shape -->
826
[10841]827    <?lua
[10887]828    for i = 1, 11, 1
[10841]829    do
[10887]830    heightNow = cPathToEntry[1][2] - (cPathToEntry[1][2]-cSectorEntry[2])*(math.atan(-1.6+0.3*i) + 1)/2
831    cBillNow = {(cSectorEntry[1]-cPathToEntry[1][1])*i/12, heightNow, (cSectorEntry[3]-cPathToEntry[1][3])*i/12}
832    cPathToEntry[i+1] = cBillNow
[10841]833    ?>
[10887]834    <Billboard position="<?lua printC(cBillNow) ?>"  scale=2 material="Flares/ringflare" colour="0.2,0.9,0.2"/>
835    <?lua
836    end
837    cPathToEntry[13] = cSectorEntry
838    ?>
[10841]839
[10887]840    <Billboard position="<?lua printC(cSectorEntry) ?>"  scale=5 material="Flares/ringflare" colour="0.2,0.9,0.2"/>
[10841]841
[10887]842    <!-- Circular Billboard Ring around Sector 5C -->
[10841]843
[10887]844    <?lua
845    for i = 1, 64, 1
846    do
847    rBillboard = {math.sin(i*math.pi/32)*radSector, 0, math.cos(i*math.pi/32)*radSector}
848    cBillNow = addC(cSector,rBillboard)
849    ?>
850    <Billboard position="<?lua printC(cBillNow) ?>"  scale=10 material="Flares/lensflare" colour="1,0.2,0.2"/>
851    <?lua end ?>
[10841]852
[10887]853    <!-- Cloaking Beacon -->
[10841]854
[10887]855    <BlinkingBillboard visible=false active=false scale=2 position="<?lua printC(cBeacon) ?>" material="Flares/lensflare" frequency=1 amplitude=3 colour="0.4,0.4,1">
856        <events>
857            <activity>
858                <EventListener event="addQuest2" />
859            </activity>
860            <visibility>
861                <EventListener event="addQuest2" />
862            </visibility>
863        </events>
864    </BlinkingBillboard>
[10823]865
[10841]866    <!-- Asteroids you have to fly through to get to the EnemyBase -->
[10887]867
[10841]868    <?lua
869        dofile("includes/asteroidField.lua")
870       asteroidField(cField1[1], cField1[2], cField1[3], 20, 30, 4500, 500, 0)
[10887]871    ?>
[10823]872
[10841]873    <!-- Other Asteroid-Fields -->
874
875    <?lua
876        dofile("includes/asteroidField.lua")
877       asteroidField(cField2[1], cField2[2], cField2[3], 20, 30, 4500, 500, 0)
[10887]878    ?>
[10841]879
880    <!-- Planets -->
881
882   <Planet
[10823]883        position="<?lua printC(cPlanet1) ?>"
[10841]884        scale="3000"
[10823]885        collisionType="dynamic"
886        linearDamping="0.8"
887        angularDamping="0"
888        mass="5000000"
889        pitch="0"
890        mesh="planets/muunilinst.mesh"
891        atmosphere="atmosphere1"
892        rotationaxis="1,0,0"
893        rotationrate="1.0"
894        atmospheresize="80.0f"
895        imagesize="1024.0f"
896        collisiondamage = 2
897        enablecollisiondamage = true
[10841]898    visible=true
899    active=true
[10823]900      >
901      <attached>
[10841]902        <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
[10823]903        </attached>
[10907]904        <collisionShapes>
[10841]905            <SphereCollisionShape radius="3000" position="0,0,0" />
[10823]906      </collisionShapes>
907    </Planet>
908
909    <?lua
910        dofile("includes/asteroidField.lua")
[10841]911        asteroidBelt(cPlanet1[1], cPlanet1[2], cPlanet1[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
[10823]912    ?>
913
914    <Planet
915        position="<?lua printC(cPlanet2) ?>"
[10841]916        scale="2000"
[10823]917        collisionType="dynamic"
918        linearDamping="0.8"
919        angularDamping="0"
920        mass="5000000"
921        pitch="0"
[10841]922        mesh="planets/ganymede.mesh"
[10823]923        atmosphere="atmosphere1"
924        rotationaxis="1,0,0"
925        rotationrate="1.0"
926        atmospheresize="80.0f"
927        imagesize="1024.0f"
928        collisiondamage = 2
929        enablecollisiondamage = true
[10887]930        visible=true
931        active=true
[10823]932      >
933      <attached>
[10841]934        <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
[10823]935        </attached>
936          <collisionShapes>
[10841]937            <SphereCollisionShape radius="2000" position="0,0,0" />
[10823]938      </collisionShapes>
939    </Planet>
940
941    <?lua
942        dofile("includes/asteroidField.lua")
943        asteroidBelt(cPlanet2[1], cPlanet2[2], cPlanet2[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
944    ?>
945
[10887]946    <!-- EnemyPlanet -->
[10841]947
948    <Planet
949        position="<?lua printC(cEnemyBasePlanet) ?>"
950        scale="5000"
951        collisionType="dynamic"
952        linearDamping="0.8"
953        angularDamping="0"
954        mass="5000000"
955        pitch="0"
956        mesh="planets/jupiter.mesh"
957        atmosphere="atmosphere1"
958        rotationaxis="1,0,0"
959        rotationrate="1.0"
960        atmospheresize="80.0f"
961        imagesize="1024.0f"
962        collisiondamage = 2
963        enablecollisiondamage = true
[10887]964        visible=false
965        active=false
966    >
967        <attached>
[10907]968           <ForceField position="0,0,0" rotationaxis="0.1,1,0.1"mode="sphere" diameter="10000" velocity="-500" />
[10841]969        </attached>
[10887]970        <events>
971            <activity>
[10907]972                <Trigger  name="enemyPlanetVisible" mode=and>
973                   <EventTrigger>
974                         <events>
975                             <trigger>
976                                 <EventListener event="cloakBeacon" />
977                             </trigger>
978                         </events>
979                     </EventTrigger>
980                     <EventTrigger invert=true>
981                         <events>
982                             <trigger>
983                                 <EventListener event="enemyPlanetMulti" />
984                             </trigger>
985                         </events>
986                     </EventTrigger>
987                 </Trigger>
[10887]988            </activity>
989            <visibility>
[10907]990                <Trigger  name="enemyPlanetVisible" mode=and>
991                   <EventTrigger>
992                         <events>
993                             <trigger>
994                                 <EventListener event="cloakBeacon" />
995                             </trigger>
996                         </events>
997                     </EventTrigger>
998                     <EventTrigger invert=true>
999                         <events>
1000                             <trigger>
1001                                 <EventListener event="enemyPlanetMulti" />
1002                             </trigger>
1003                         </events>
1004                     </EventTrigger>
1005                 </Trigger>
[10887]1006            </visibility>
1007        </events>
[10907]1008        <collisionShapes>
1009          <SphereCollisionShape position="0,0,0" radius=5000/>
1010        </collisionShapes>
[10841]1011    </Planet>
1012
[10887]1013    <!-- Pawn that represents the planet during destruction -->
1014
[10907]1015    <Pawn team=1 visible=false active=false scale=5000 health=500 name="enemyPlanet" position="<?lua printC(cEnemyBasePlanet) ?>" collisionType=dynamic mass=5000000 radarname="Enemy home planet">
1016        <events>
1017            <activity>
1018                <EventListener event="allUnitsDown" />
1019            </activity>
1020            <visibility>
1021                <EventListener event="allUnitsDown" />
1022            </visibility>
1023        </events>
[10887]1024        <collisionShapes>
[10907]1025          <SphereCollisionShape position="0,0,0" radius=5005/>
[10887]1026        </collisionShapes>
1027    </Pawn>
1028    <!--SHIPS -->
[10953]1029    <!-- one Controller to rule them all -->
1030    <Pawn position = "100000, 100000, 100000">
1031      <controller>
1032        <MasterController>
1033        </MasterController>
1034      </controller>
1035    </Pawn>
[10887]1036    <!--Allied units-->
1037
1038    <?lua
1039    for i = 1, allies, 1
1040    do
1041    rUnit = {-math.sin(math.pi*((i-1/2)/allies))*125, math.pow(-1,i)*80, math.cos(math.pi*((i-1/2)/allies))*800}
1042    cAllyNow = addC(cAlly,rUnit)
1043    ?>
1044
1045    <SpaceShip health=600 initialhealth=600 maxhealth=600 position="<?lua printC(cAllyNow) ?>" name="ally<?lua print(i) ?>.D">
1046      <templates>
1047        <Template link=ally />
1048      </templates>
1049      <controller>
1050        <DivisionController name="allyController" team=0 formationMode="diamond" spread=100>
1051          <actionpoints>
1052              <?lua
1053              for i = 1, 13, 1
1054              do
1055              ?>
[10904]1056              <Actionpoint position="<?lua printC(addC(cPathToEntry[i], rUnit)) ?>" action="fly"/>
[10887]1057              <?lua end ?>
1058           </actionpoints>
1059        </DivisionController>
1060      </controller>
1061    </SpaceShip>
1062
1063    <SpaceShip health=600 initialhealth=600 maxhealth=600 position="<?lua printC(addC(cAllyNow,rSection)) ?>" lookat="0,0,0" name="ally<?lua print(i) ?>.S">
1064      <templates>
1065        <Template link=ally />
1066      </templates>
1067      <controller>
1068        <SectionController name="allyController" team=0>
1069        </SectionController>
1070      </controller>
1071    </SpaceShip>
1072
1073    <SpaceShip health=600 initialhealth=600 maxhealth=600 position="<?lua printC(addC(cAllyNow,rWingman1)) ?>" lookat="0,0,0" name="ally<?lua print(i) ?>.W1">
1074      <templates>
1075        <Template link=ally />
1076      </templates>
1077      <controller>
1078        <WingmanController name="allyController" team=0>
1079        </WingmanController>
1080      </controller>
1081    </SpaceShip>
1082
1083    <SpaceShip health=600 initialhealth=600 maxhealth=600 position="<?lua printC(addC(cAllyNow,rWingman2)) ?>" lookat="0,0,0" name="ally<?lua print(i) ?>.W2">
1084      <templates>
1085        <Template link=ally />
1086      </templates>
1087      <controller>
1088        <WingmanController name="allyController" team=0>
1089        </WingmanController>
1090      </controller>
1091    </SpaceShip>
1092
1093    <?lua end ?>
1094
1095    <!-- Enemy Units -->
1096
1097    <?lua
1098    for k = 1, enemies, 1
1099    do
1100    rUnit = {125 -math.sin(math.pi*((k-1/2)/enemies))*200, math.pow(-1,k)*300, math.cos(math.pi*((k-1/2)/enemies))*1000}
1101    cEnemyNow = addC(cEnemy,rUnit)
1102    ?>
1103
1104    <SpaceShip health=400 initialhealth=400 maxhealth=400 position="<?lua printC(cEnemyNow) ?>" name="enemy<?lua print(k) ?>">
1105      <templates>
1106        <Template link=enemy />
1107      </templates>
1108      <events>
1109          <activity>
1110              <EventListener event="cloakBeacon" />
1111          </activity>
1112          <visibility>
1113              <EventListener event="cloakBeacon" />
1114          </visibility>
1115      </events>
1116      <controller>
[10904]1117        <DivisionController name="enemyController" active=false team=1 formationMode="diamond" spread=100>
[10887]1118          <actionpoints>
1119              <Actionpoint position="<?lua printC(cEnemyNow) ?>" action="fightall" />
1120          </actionpoints>
1121        </DivisionController>
1122      </controller>
1123    </SpaceShip>
1124
1125    <SpaceShip health=400 initialhealth=400 maxhealth=400 position="<?lua printC(addC(cEnemyNow,rSection)) ?>" name="enemy<?lua print(k) ?>">
1126      <templates>
1127        <Template link=enemy />
1128      </templates>
1129      <events>
1130          <activity>
1131              <EventListener event="cloakBeacon" />
1132          </activity>
1133          <visibility>
1134              <EventListener event="cloakBeacon" />
1135          </visibility>
1136      </events>
1137      <controller>
[10904]1138        <SectionController name="enemyController" active=false team=1>
[10887]1139        </SectionController>
1140      </controller>
1141    </SpaceShip>
1142
1143    <SpaceShip health=400 initialhealth=400 maxhealth=400 position="<?lua printC(addC(cEnemyNow,rWingman1)) ?>" lookat="0,0,0" name="enemy<?lua print(k) ?>">
1144      <templates>
1145        <Template link=enemy />
1146      </templates>
1147      <events>
1148          <activity>
1149              <EventListener event="cloakBeacon" />
1150          </activity>
1151          <visibility>
1152              <EventListener event="cloakBeacon" />
1153          </visibility>
1154      </events>
1155      <controller>
[10904]1156        <WingmanController name="enemyController" active=false team=1>
[10887]1157        </WingmanController>
1158      </controller>
1159    </SpaceShip>
1160
1161    <SpaceShip health=400 initialhealth=400 maxhealth=400 position="<?lua printC(addC(cEnemyNow,rWingman2)) ?>" name="enemy<?lua print(k) ?>">
1162      <templates>
1163        <Template link=enemy />
1164      </templates>
1165      <events>
1166          <activity>
1167              <EventListener event="cloakBeacon" />
1168          </activity>
1169          <visibility>
1170              <EventListener event="cloakBeacon" />
1171          </visibility>
1172      </events>
1173      <controller>
[10904]1174        <WingmanController name="enemyController" active=false team=1>
[10887]1175        </WingmanController>
1176      </controller>
1177    </SpaceShip>
1178
1179    <?lua end ?>
1180
[10823]1181    </Scene>
1182</Level>
Note: See TracBrowser for help on using the repository browser.