Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/cegui0.8_ogre1.9/data/levels/shuttleRetaliation.oxw @ 12192

Last change on this file since 12192 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: 39.3 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"
[11802]37        alignment="CentreAligned"
[10823]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
[11795]882    <MovableEntity
[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        rotationaxis="1,0,0"
891        rotationrate="1.0"
892        collisiondamage = 2
893        enablecollisiondamage = true
[11795]894    >
[10823]895      <attached>
[11795]896        <Planet
897            mesh="planets/muunilinst.mesh"
898            atmosphere="atmosphere1"
899            atmospheresize="80.0f"
900            imagesize="1024.0f"
901            visible=true
902            active=true
903        >
904          <attached>
905            <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
906          </attached>
907        </Planet>
908      </attached>
909      <collisionShapes>
910        <SphereCollisionShape radius="3000" position="0,0,0" />
[10823]911      </collisionShapes>
[11795]912    </MovableEntity>
[10823]913
914    <?lua
915        dofile("includes/asteroidField.lua")
[10841]916        asteroidBelt(cPlanet1[1], cPlanet1[2], cPlanet1[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
[10823]917    ?>
918
[11795]919    <MovableEntity
[10823]920        position="<?lua printC(cPlanet2) ?>"
[10841]921        scale="2000"
[10823]922        collisionType="dynamic"
923        linearDamping="0.8"
924        angularDamping="0"
925        mass="5000000"
926        pitch="0"
927        rotationaxis="1,0,0"
928        rotationrate="1.0"
929        collisiondamage = 2
930        enablecollisiondamage = true
[11795]931    >
[10823]932      <attached>
[11795]933        <Planet
934            mesh="planets/ganymede.mesh"
935            atmosphere="atmosphere1"
936            atmospheresize="80.0f"
937            imagesize="1024.0f"
938            visible=true
939            active=true
940        >
941          <attached>
942            <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
943          </attached>
944        </Planet>
945      </attached>
946      <collisionShapes>
947        <SphereCollisionShape radius="2000" position="0,0,0" />
[10823]948      </collisionShapes>
[11795]949    </MovableEntity>
[10823]950
951    <?lua
952        dofile("includes/asteroidField.lua")
953        asteroidBelt(cPlanet2[1], cPlanet2[2], cPlanet2[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
954    ?>
955
[10887]956    <!-- EnemyPlanet -->
[10841]957
[11795]958    <MovableEntity
[10841]959        position="<?lua printC(cEnemyBasePlanet) ?>"
960        scale="5000"
961        collisionType="dynamic"
962        linearDamping="0.8"
963        angularDamping="0"
964        mass="5000000"
965        pitch="0"
966        rotationaxis="1,0,0"
967        rotationrate="1.0"
968        collisiondamage = 2
969        enablecollisiondamage = true
[10887]970    >
[11795]971      <attached>
972        <Planet
973            mesh="planets/jupiter.mesh"
974            atmosphere="atmosphere1"
975            atmospheresize="80.0f"
976            imagesize="1024.0f"
977            visible=false
978            active=false
979        >
980          <attached>
[10907]981           <ForceField position="0,0,0" rotationaxis="0.1,1,0.1"mode="sphere" diameter="10000" velocity="-500" />
[11795]982          </attached>
983          <events>
[10887]984            <activity>
[10907]985                <Trigger  name="enemyPlanetVisible" mode=and>
986                   <EventTrigger>
987                         <events>
988                             <trigger>
989                                 <EventListener event="cloakBeacon" />
990                             </trigger>
991                         </events>
992                     </EventTrigger>
993                     <EventTrigger invert=true>
994                         <events>
995                             <trigger>
996                                 <EventListener event="enemyPlanetMulti" />
997                             </trigger>
998                         </events>
999                     </EventTrigger>
1000                 </Trigger>
[10887]1001            </activity>
1002            <visibility>
[10907]1003                <Trigger  name="enemyPlanetVisible" mode=and>
1004                   <EventTrigger>
1005                         <events>
1006                             <trigger>
1007                                 <EventListener event="cloakBeacon" />
1008                             </trigger>
1009                         </events>
1010                     </EventTrigger>
1011                     <EventTrigger invert=true>
1012                         <events>
1013                             <trigger>
1014                                 <EventListener event="enemyPlanetMulti" />
1015                             </trigger>
1016                         </events>
1017                     </EventTrigger>
1018                 </Trigger>
[10887]1019            </visibility>
[11795]1020          </events>
1021        </Planet>
1022      </attached>
1023      <collisionShapes>
1024        <SphereCollisionShape position="0,0,0" radius=5000/>
1025      </collisionShapes>
1026    </MovableEntity>
[10841]1027
[10887]1028    <!-- Pawn that represents the planet during destruction -->
1029
[10907]1030    <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">
1031        <events>
1032            <activity>
1033                <EventListener event="allUnitsDown" />
1034            </activity>
1035            <visibility>
1036                <EventListener event="allUnitsDown" />
1037            </visibility>
1038        </events>
[10887]1039        <collisionShapes>
[10907]1040          <SphereCollisionShape position="0,0,0" radius=5005/>
[10887]1041        </collisionShapes>
1042    </Pawn>
1043    <!--SHIPS -->
[10953]1044    <!-- one Controller to rule them all -->
1045    <Pawn position = "100000, 100000, 100000">
1046      <controller>
1047        <MasterController>
1048        </MasterController>
1049      </controller>
1050    </Pawn>
[10887]1051    <!--Allied units-->
1052
1053    <?lua
1054    for i = 1, allies, 1
1055    do
1056    rUnit = {-math.sin(math.pi*((i-1/2)/allies))*125, math.pow(-1,i)*80, math.cos(math.pi*((i-1/2)/allies))*800}
1057    cAllyNow = addC(cAlly,rUnit)
1058    ?>
1059
1060    <SpaceShip health=600 initialhealth=600 maxhealth=600 position="<?lua printC(cAllyNow) ?>" name="ally<?lua print(i) ?>.D">
1061      <templates>
1062        <Template link=ally />
1063      </templates>
1064      <controller>
1065        <DivisionController name="allyController" team=0 formationMode="diamond" spread=100>
1066          <actionpoints>
1067              <?lua
1068              for i = 1, 13, 1
1069              do
1070              ?>
[10904]1071              <Actionpoint position="<?lua printC(addC(cPathToEntry[i], rUnit)) ?>" action="fly"/>
[10887]1072              <?lua end ?>
1073           </actionpoints>
1074        </DivisionController>
1075      </controller>
1076    </SpaceShip>
1077
1078    <SpaceShip health=600 initialhealth=600 maxhealth=600 position="<?lua printC(addC(cAllyNow,rSection)) ?>" lookat="0,0,0" name="ally<?lua print(i) ?>.S">
1079      <templates>
1080        <Template link=ally />
1081      </templates>
1082      <controller>
1083        <SectionController name="allyController" team=0>
1084        </SectionController>
1085      </controller>
1086    </SpaceShip>
1087
1088    <SpaceShip health=600 initialhealth=600 maxhealth=600 position="<?lua printC(addC(cAllyNow,rWingman1)) ?>" lookat="0,0,0" name="ally<?lua print(i) ?>.W1">
1089      <templates>
1090        <Template link=ally />
1091      </templates>
1092      <controller>
1093        <WingmanController name="allyController" team=0>
1094        </WingmanController>
1095      </controller>
1096    </SpaceShip>
1097
1098    <SpaceShip health=600 initialhealth=600 maxhealth=600 position="<?lua printC(addC(cAllyNow,rWingman2)) ?>" lookat="0,0,0" name="ally<?lua print(i) ?>.W2">
1099      <templates>
1100        <Template link=ally />
1101      </templates>
1102      <controller>
1103        <WingmanController name="allyController" team=0>
1104        </WingmanController>
1105      </controller>
1106    </SpaceShip>
1107
1108    <?lua end ?>
1109
1110    <!-- Enemy Units -->
1111
1112    <?lua
1113    for k = 1, enemies, 1
1114    do
1115    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}
1116    cEnemyNow = addC(cEnemy,rUnit)
1117    ?>
1118
1119    <SpaceShip health=400 initialhealth=400 maxhealth=400 position="<?lua printC(cEnemyNow) ?>" name="enemy<?lua print(k) ?>">
1120      <templates>
1121        <Template link=enemy />
1122      </templates>
1123      <events>
1124          <activity>
1125              <EventListener event="cloakBeacon" />
1126          </activity>
1127          <visibility>
1128              <EventListener event="cloakBeacon" />
1129          </visibility>
1130      </events>
1131      <controller>
[10904]1132        <DivisionController name="enemyController" active=false team=1 formationMode="diamond" spread=100>
[10887]1133          <actionpoints>
1134              <Actionpoint position="<?lua printC(cEnemyNow) ?>" action="fightall" />
1135          </actionpoints>
1136        </DivisionController>
1137      </controller>
1138    </SpaceShip>
1139
1140    <SpaceShip health=400 initialhealth=400 maxhealth=400 position="<?lua printC(addC(cEnemyNow,rSection)) ?>" name="enemy<?lua print(k) ?>">
1141      <templates>
1142        <Template link=enemy />
1143      </templates>
1144      <events>
1145          <activity>
1146              <EventListener event="cloakBeacon" />
1147          </activity>
1148          <visibility>
1149              <EventListener event="cloakBeacon" />
1150          </visibility>
1151      </events>
1152      <controller>
[10904]1153        <SectionController name="enemyController" active=false team=1>
[10887]1154        </SectionController>
1155      </controller>
1156    </SpaceShip>
1157
1158    <SpaceShip health=400 initialhealth=400 maxhealth=400 position="<?lua printC(addC(cEnemyNow,rWingman1)) ?>" lookat="0,0,0" name="enemy<?lua print(k) ?>">
1159      <templates>
1160        <Template link=enemy />
1161      </templates>
1162      <events>
1163          <activity>
1164              <EventListener event="cloakBeacon" />
1165          </activity>
1166          <visibility>
1167              <EventListener event="cloakBeacon" />
1168          </visibility>
1169      </events>
1170      <controller>
[10904]1171        <WingmanController name="enemyController" active=false team=1>
[10887]1172        </WingmanController>
1173      </controller>
1174    </SpaceShip>
1175
1176    <SpaceShip health=400 initialhealth=400 maxhealth=400 position="<?lua printC(addC(cEnemyNow,rWingman2)) ?>" name="enemy<?lua print(k) ?>">
1177      <templates>
1178        <Template link=enemy />
1179      </templates>
1180      <events>
1181          <activity>
1182              <EventListener event="cloakBeacon" />
1183          </activity>
1184          <visibility>
1185              <EventListener event="cloakBeacon" />
1186          </visibility>
1187      </events>
1188      <controller>
[10904]1189        <WingmanController name="enemyController" active=false team=1>
[10887]1190        </WingmanController>
1191      </controller>
1192    </SpaceShip>
1193
1194    <?lua end ?>
1195
[10823]1196    </Scene>
1197</Level>
Note: See TracBrowser for help on using the repository browser.