Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/campaignHS15/data/levels/Campaign1.oxw @ 10804

Last change on this file since 10804 was 10804, checked in by paulsc, 9 years ago

Started work on spaceshipShuttle.oxt, furthered quests.

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