Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 10783 was 10783, checked in by bhatiab, 8 years ago

Finished descriptions for the quests

File size: 30.8 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/spaceshipTransporter.oxt")
17    include("templates/FPS.oxt")
18?>
19
20<Level gametype = "Mission">
21    <templates>
22        <Template link="lodtemplate_default" />
23    </templates>
24
25    <?lua include("includes/notifications.oxi") ?>
26
27    <NotificationQueueCEGUI
28        name="narrative"
29        targets="simpleNotification"
30        size=3
31        displayTime=3.9
32        position="0.15, 0, 0.1, 0"
33        fontSize="23"
34        fontColor="0.3, 1, 0.2, 0.8"
35        alignment="HorzCentred"
36        displaySize="0.7, 0, 0, 0"
37    />
38
39    <!-- GLOBAL LUA VARIABLES -->
40    <?lua
41        waves = 3
42        enemies = 5
43        allies = 3
44
45        --[[ Coordinates in (y,z,x). NOTE: Indexing starts at 1 in lua! Don´t forget to adapt the for loops, too! ]]--
46        cCenter = {0, 0, 0}
47        cSpawn = {-50, 0, 0}
48        cUnit = {-2000, 0, 3000}
49        cA = {-3000, 0, 5000}
50        cB = {-3000, 0, -5000}
51        cC = {-2300, 0, 0}
52        dStation = {1, 0, 0}
53        cNewShip = {-2100, 0, 4100}
54        cFPSGround = {-2300, 800, 0}
55        cFPS = {-2300, 1000, 0}
56        cField1 = {400, 0, 2500}
57        cField2 = {400, 0, -2500}
58        cPlanet1 = {8000, -2000, 15000}
59        cPlanet2 = {-20000, 4000, -1000}
60        rAllies = {3000, -2000}         --[[ To be addressed directly, hence r. Do not permute! ]]--
61
62        --[[ Function to print Coordinates. Quotes not included! ]]--
63        function printC(coord)
64          print(coord[1] .. [[,]] .. coord[2] .. [[,]] .. coord[3])
65        end
66    ?>
67
68    <Scene
69        ambientlight = "0.8, 0.8, 0.8"
70        skybox = "Orxonox/skyBoxMoreNebula"
71        hasPhysics = true
72    >
73
74    <SpawnPoint name="playerSpawn" team=0 position="<?lua printC(cSpawn) ?>" lookat="<?lua printC(cCenter) ?>" spawnclass=SpaceShip pawndesign=spaceshipescort />
75
76    <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" />
77
78    <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"/>
79
80    <!--QUEST DEFINITIONS-->
81
82    <GlobalQuest id="quest1">
83        <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="" />
84        <hints>
85        </hints>
86        <complete-effects>
87            <AddQuest questId="quest2" />
88            <AddQuest questId="quest2.1" />
89        </complete-effects>
90    </GlobalQuest>
91
92    <GlobalQuest id="quest2">
93        <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="" />
94        <hints>
95        </hints>
96        <subquests>
97            <GlobalQuest id="quest2.1">
98                <QuestDescription title="> Get a better Spaceship" description="Take over the faster, stronger, more secure and overall better spaceship!" failMessage="" completeMessage="" />
99                <complete-effects>
100                    <AddQuest questId="quest2.2" />
101                </complete-effects>
102            </GlobalQuest>
103            <GlobalQuest id="quest2.2">
104                <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="" />
105            </GlobalQuest>
106        </subquests>
107        <complete-effects>
108            <AddQuest questId="quest3" />
109        </complete-effects>
110    </GlobalQuest>
111
112    <GlobalQuest id="quest3">
113        <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!" />
114        <hints>
115        </hints>
116        <complete-effects>
117            <AddQuest questId="quest4" />
118            <AddQuest questId="quest4.1" />
119            <AddQuest questId="quest4.2" />
120        </complete-effects>
121    </GlobalQuest>
122
123    <GlobalQuest id="quest4">
124        <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="" />
125        <hints>
126        </hints>
127        <subquests>
128            <GlobalQuest id="quest4.1">
129                <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="" />
130            </GlobalQuest>
131            <GlobalQuest id="quest4.2">
132                <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="" />
133            </GlobalQuest>
134        </subquests>
135        <complete-effects>
136            <AddQuest questId="quest5" />
137        </complete-effects>
138    </GlobalQuest>
139
140    <GlobalQuest id="quest5">
141        <QuestDescription title="Fight the Hord!" description="Destroy the next wave!" failMessage="" completeMessage="" />
142        <hints>
143        </hints>
144        <complete-effects>
145            <AddQuest questId="quest6" />
146            <AddQuest questId="quest6.1" />
147            <AddQuest questId="quest6.2" />
148        </complete-effects>
149    </GlobalQuest>
150
151    <GlobalQuest id="quest6">
152        <QuestDescription title="Get back to the Transporter" description="Undock from Station C and get into your Spaceship!" failMessage="" completeMessage="" />
153        <hints>
154        </hints>
155        <subquests>
156            <GlobalQuest id="quest6.1">
157                <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="" />
158            </GlobalQuest>
159            <GlobalQuest id="quest6.2">
160                <QuestDescription title="> Get back to the Transporter" description="Fly to the transporter!" failMessage="" completeMessage="" />
161            </GlobalQuest>
162        </subquests>
163        <complete-effects>
164            <AddQuest questId="quest7" />
165        </complete-effects>
166    </GlobalQuest>
167
168    <GlobalQuest id="quest7">
169        <QuestDescription title="Fight the final Wave" description="Good gracious, another hord of pirate ships!" failMessage="" completeMessage="" />
170        <hints>
171        </hints>
172        <subquests>
173        </subquests>
174    </GlobalQuest>
175
176    <!--EVENTS AND TRIGGERS
177        Usable events and triggers:
178        _spawntrigger
179        _reachedA
180        _dock<A|B|C>
181        _docked<A>      WIP; see below
182        -joinedUnit
183        _wave<k>
184        _killedEnemy<k>.<i>
185        _waveClear<k>
186    -->
187
188    <EventMultiTrigger name="spawntrigger">
189        <events>
190            <trigger>
191                <EventListener event="playerSpawn" />
192            </trigger>
193        </events>
194    </EventMultiTrigger>
195
196    <DistanceTrigger name="reachedA" position="<?lua printC(cA) ?>" distance=1000 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true />
197
198    <!-- TODO: find out how to link an event to the COMPLETION of a dock. How is this not possible?? -->
199    <EventMultiTrigger name="dockedA" activations="1" stayactive="true" delay=3>
200        <events>
201            <trigger>
202                <EventListener event="dockA" />
203            </trigger>
204        </events>
205    </EventMultiTrigger>
206
207    <DistanceTrigger name="joinedUnit" active=false position="<?lua printC(cUnit) ?>" distance=100 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true>
208        <events>
209            <activity>
210                    <EventListener event="dockedA" />
211            </activity>
212        </events>
213    </DistanceTrigger>
214
215    <EventMultiTrigger name="wave1" activations="1" delay=4>
216        <events>
217            <trigger>
218                <EventListener event="joinedUnit" />
219            </trigger>
220        </events>
221    </EventMultiTrigger>
222
223    <!-- Recursive helper function for the end-of-wave events. F*ck the event system, seriously. -->
224    <?lua
225    function enemyTriggerRecursor(i, k)
226    if i > 0 then
227    return [[
228    <EventTrigger name=killedEnemy]] .. k .. [[.]] .. i .. [[ activations=1 stayactive=true delay=0.1>
229        <events>
230            <trigger>
231                <EventListener event=attackers]] .. k .. [[ />
232            </trigger>
233        </events>
234        ]] .. enemyTriggerRecursor(i-1, k) .. [[
235    </EventTrigger>
236    ]]
237    else return ""
238    end
239    end
240    ?>
241    <!-- Actual recursive Event(s) for the respective waves. -->
242    <?lua
243    for k = 1, waves, 1
244    do
245    print(enemyTriggerRecursor(enemies,k))
246    ?>
247    <EventMultiTrigger name="waveClear<?lua print(k) ?>" delay=4.0>
248        <events>
249            <trigger>
250                <EventListener event="killedEnemy<?lua print(k .. [[.]] .. enemies) ?>" />
251            </trigger>
252        </events>
253    </EventMultiTrigger>
254    <?lua end ?>
255
256    <!-- This controls the ally AI controller so it is only active when active enemies are around!
257    TODO: Find a way to control the allies in another case (Multiple controllers are not allowed). -->
258    <EventDispatcher name="allyControllerDispatcher">
259      <targets>
260        <EventTarget target="allyController" />
261      </targets>
262      <events>
263          <activity>
264              <?lua
265              for k = 1, waves, 1 do
266              ?>
267              <Trigger mode=and>
268                  <EventTrigger>
269                      <events>
270                          <trigger>
271                              <EventListener event="wave<?lua print(k) ?>" />
272                          </trigger>
273                      </events>
274                  </EventTrigger>
275                  <EventTrigger invert=true>
276                      <events>
277                          <trigger>
278                              <EventListener event="waveClear<?lua print(k) ?>" />
279                          </trigger>
280                      </events>
281                  </EventTrigger>
282              </Trigger>
283              <?lua end ?>
284          </activity>
285      </events>
286    </EventDispatcher>
287
288    <!-- FIXME: This trigger needs fixing, as endMission can only be called by a Pawn Distance Trigger. Herpaderp.
289    Also, the fix proposed in MissionOne does not work anymore... -->
290   <EventMultiTrigger name="missionFailed" target="Pawn" stayActive="true" delay=1.5>
291       <events>
292           <trigger>
293               <EventListener event="transporter" />
294           </trigger>
295       </events>
296   </EventMultiTrigger>
297
298    <Script code="Mission endMission fail" onLoad="false">
299        <events>
300            <trigger>
301                <EventListener event="missionFailed" />
302            </trigger>
303        </events>
304    </Script>
305
306    <!--QUEST EFFECT BEACONS -->
307
308    <QuestEffectBeacon times=1>
309        <effects>
310            <AddQuest questId="quest1" />
311        </effects>
312        <events>
313            <execute>
314                <EventListener event="spawntrigger" />
315            </execute>
316        </events>
317    </QuestEffectBeacon>
318
319    <QuestEffectBeacon times=1>
320        <effects>
321            <CompleteQuest questId="quest1" />
322        </effects>
323        <events>
324            <execute>
325                <EventListener event="reachedA" />
326            </execute>
327        </events>
328    </QuestEffectBeacon>
329
330    <QuestEffectBeacon times=1>
331        <effects>
332            <CompleteQuest questId="quest2.1" />
333        </effects>
334        <events>
335            <execute>
336                <EventListener event="dockedA" />
337            </execute>
338        </events>
339    </QuestEffectBeacon>
340
341    <QuestEffectBeacon times=1>
342        <effects>
343            <CompleteQuest questId="quest2.2" />
344            <CompleteQuest questId="quest2" />
345        </effects>
346        <events>
347            <execute>
348                <EventListener event="joinedUnit" />
349            </execute>
350        </events>
351    </QuestEffectBeacon>
352
353    <QuestEffectBeacon times=1>
354        <effects>
355            <CompleteQuest questId="quest3" />
356        </effects>
357        <events>
358            <execute>
359                <EventListener event="waveClear1" />
360            </execute>
361        </events>
362    </QuestEffectBeacon>
363
364    <!--NOTIFICATIONS -->
365
366    <SimpleNotification broadcast="true" message="Welcome, Commander. Please report at Station A.">
367        <events>
368            <trigger>
369                <EventTrigger stayactive="true" delay=4 >
370                   <events>
371                      <trigger>
372                         <EventListener event="spawntrigger" />
373                      </trigger>
374                   </events>
375                </EventTrigger>
376            </trigger>
377        </events>
378    </SimpleNotification>
379
380    <SimpleNotification broadcast="true" message="Our enemy is set to attack us very soon.">
381        <events>
382            <trigger>
383                <EventTrigger stayactive="true" delay=8 >
384                   <events>
385                      <trigger>
386                         <EventListener event="spawntrigger" />
387                      </trigger>
388                   </events>
389                </EventTrigger>
390            </trigger>
391        </events>
392    </SimpleNotification>
393
394    <SimpleNotification broadcast="true" message="Please study your mission briefing!">
395        <events>
396            <trigger>
397                <EventTrigger stayactive="true" delay=12 >
398                   <events>
399                      <trigger>
400                         <EventListener event="spawntrigger" />
401                      </trigger>
402                   </events>
403                </EventTrigger>
404            </trigger>
405        </events>
406    </SimpleNotification>
407
408    <SimpleNotification broadcast="true" message="Welcome to Station A, Commander.">
409        <events>
410            <trigger>
411                <EventListener event="reachedA" />
412            </trigger>
413        </events>
414    </SimpleNotification>
415
416    <SimpleNotification broadcast="true" message="We've prepared a reinforced Ship for you.">
417        <events>
418            <trigger>
419                <EventTrigger stayactive="true" delay=4 >
420                   <events>
421                      <trigger>
422                         <EventListener event="reachedA" />
423                      </trigger>
424                   </events>
425                </EventTrigger>
426            </trigger>
427        </events>
428    </SimpleNotification>
429
430    <SimpleNotification broadcast="true" message="Now join our defense Team.">
431        <events>
432            <trigger>
433                <EventListener event="dockedA" />
434            </trigger>
435        </events>
436    </SimpleNotification>
437
438    <SimpleNotification broadcast="true" message="Howdy Commander! Ready to kick alien ass?">
439        <events>
440            <trigger>
441                <EventListener event="joinedUnit" />
442            </trigger>
443        </events>
444    </SimpleNotification>
445
446    <SimpleNotification broadcast="true" message="An enemy wave is approaching the shuttle!">
447        <events>
448            <trigger>
449                <EventListener event="wave1" />
450                <EventListener event="wave2" />
451                <EventListener event="wave3" />
452            </trigger>
453        </events>
454    </SimpleNotification>
455
456    <SimpleNotification broadcast="true" message="yippie ki yay motherf*cker!">
457        <events>
458            <trigger>
459                <EventListener event="attackers1" />
460                <EventListener event="attackers2" />
461                <EventListener event="attackers3" />
462            </trigger>
463        </events>
464    </SimpleNotification>
465
466    <SimpleNotification broadcast="true" message="Phew, that was close! Well done, Commmander.">
467        <events>
468            <trigger>
469                <EventListener event="waveClear1" />
470                <EventListener event="waveClear2" />
471                <EventListener event="waveClear3" />
472            </trigger>
473        </events>
474    </SimpleNotification>
475
476    <SimpleNotification broadcast="true" message="It's over... we failed. Retreat!">
477        <events>
478            <trigger>
479                <EventListener event="missionFailed" />
480            </trigger>
481        </events>
482    </SimpleNotification>
483
484    <!--STATIONS -->
485
486    <!-- (Temporary) Template for stations. Used to define common features of all Stations. -->
487    <Template name="station">
488        <Pawn mass=10000 collisionType=dynamic friction=0.01>
489            <attached>
490                <Model mesh="HydroHarvester.mesh" position="0,0,0" scale=50 />
491                <DistanceTriggerBeacon name="NPC" />
492            </attached>
493            <collisionShapes>
494                <BoxCollisionShape  position="-560,0,0" halfExtents="115,100,245" /><!-- Three lower boxes -->
495                <BoxCollisionShape  position="290,0,-480" halfExtents="115,100,245" yaw=-120 />
496                <BoxCollisionShape  position="290,0,480" halfExtents="115,100,245" yaw=-240 />
497                <BoxCollisionShape  position="-280,0,0" halfExtents="163,50,50" /><!-- Three lower connections -->
498                <BoxCollisionShape  position="140,0,-240" halfExtents="163,50,50" yaw=-120 />
499                <BoxCollisionShape  position="140,0,240" halfExtents="163,50,50" yaw=-240 />
500                <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" /><!-- Upper Tower -->
501                <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" yaw=-120 />
502                <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" yaw=-240 />
503                <BoxCollisionShape  position="0,400,0" halfExtents="43,110,26" yaw=-30 /><!-- Middle one-->
504                <BoxCollisionShape  position="-200,100,0" halfExtents="26,50,43" /><!--Three lower legs -->
505                <BoxCollisionShape  position="100,100,-173" halfExtents="43,50,26" yaw=-30 />
506                <BoxCollisionShape  position="100,100,-173" halfExtents="43,50,26" yaw=30 />
507                <BoxCollisionShape  position="-100,264,0" halfExtents="26,105,43" roll=-49 /><!--Three upper legs -->
508                <BoxCollisionShape  position="50,264,-87" halfExtents="26,105,43" roll=-49 yaw=-120 />
509                <BoxCollisionShape  position="50,264,87" halfExtents="26,105,43" roll=-49 yaw=-240 />
510            </collisionShapes>
511        </Pawn>
512    </Template>
513
514    <!-- A, Coordinates are approx. (cos(29pi/16), sin(29pi/16), 0)*3000 -->
515    <Pawn name="statA" team=0 radarname="Station A" position="<?lua printC(cA) ?>" direction="<?lua printC(dStation) ?>" initialhealth=10000 maxhealth=10000>
516        <templates>
517            <Template link="station" />
518        </templates>
519        <attached>
520            <DockingTarget name="dockTargetA" />
521            <Dock position="0,0,0" active=true>
522                <animations>
523                    <MoveToDockingTarget target="dockTargetA" />
524                </animations>
525                <effects>
526                    <DockToShip target="newSpaceShip" />
527                </effects>
528                <events>
529                    <execute>
530                        <EventListener event="dockA" />
531                    </execute>
532                </events>
533                <attached>
534                    <DistanceTrigger position="0,0,0" distance="200" target="SpaceShip" beaconMode="exclude" targetname="NPC" name="dockA" />
535                    <Billboard position="0,0,0" amplitude=1 material="Flares/lensflare" colour="1,0,0.05" />
536                </attached>
537            </Dock>
538        </attached>
539    </Pawn>
540
541    <!-- B, Coordinates are approx. (-cos(29pi/16), sin(29pi/16), 0)*3000 -->
542    <Pawn name="statB" team=0 radarname="Station B" position="<?lua printC(cB) ?>" direction="<?lua printC(dStation) ?>" initialhealth=10000 maxhealth=10000>
543        <templates>
544            <Template link="station" />
545        </templates>
546        <attached>
547            <DockingTarget name="dockTargetB" />
548            <Dock position="0,0,0" active=true>
549                <animations>
550                    <MoveToDockingTarget target="dockTargetB" />
551                </animations>
552                <effects>
553                    <DockToShip target="newSpaceShip" />
554                </effects>
555                <events>
556                    <execute>
557                        <EventListener event="dockB" />
558                    </execute>
559                </events>
560                <attached>
561                    <DistanceTrigger position="0,0,0" distance="200" target="SpaceShip" beaconMode="exclude" targetname="NPC" name="dockB" />
562                    <Billboard position="0,0,0" amplitude=1 material="Flares/lensflare" colour="1,0,0.05" />
563                </attached>
564            </Dock>
565        </attached>
566    </Pawn>
567
568    <!-- C -->
569    <Pawn name="statC" team=0 radarname="Station C" position="<?lua printC(cC) ?>" direction="<?lua printC(dStation) ?>" initialhealth=10000 maxhealth=10000>
570        <templates>
571            <Template link="station" />
572        </templates>
573        <attached>
574            <DockingTarget name="dockTargetC" />
575            <Dock position="0,0,0" active=true>
576                <animations>
577                    <MoveToDockingTarget target="dockTargetC" />
578                </animations>
579                <effects>
580                    <DockToShip target="fpsMode" />
581                </effects>
582                <events>
583                    <execute>
584                        <EventListener event="dockC" />
585                    </execute>
586                    <undocking>
587                        <EventListener event="undockC" />
588                    </undocking>
589                </events>
590                <attached>
591                    <DistanceTrigger position="0,0,0" distance="200" target="SpaceShip" beaconMode="exclude" targetname="NPC" name="dockC" />
592                    <Billboard position="0,0,0" amplitude=1 material="Flares/lensflare" colour="1,0,0.05" />
593                </attached>
594            </Dock>
595        </attached>
596    </Pawn>
597
598    <!-- New SpaceShip as destination of dock A-->
599    <SpaceShip
600            template            = "spaceshipassff"
601            team                = "0"
602            position            = "<?lua printC(cNewShip) ?>"
603            lookat              = "<?lua printC(cCenter) ?>"
604            health              = "400"
605            initialhealth       = "400"
606            maxhealth           = "500"
607            shieldhealth        = "80"
608            initialshieldhealth = "80"
609            maxshieldhealth     = "120"
610            shieldabsorption    = "0.8"
611            reloadrate          = "1"
612            reloadwaittime      = "1"
613            name                = "newSpaceShip"
614            radarname           = "Defender" >
615        <attached>
616            <DockingTarget name="newSpaceShip" />
617            <DistanceTriggerBeacon name="newSpaceShip" />
618        </attached>
619    </SpaceShip>
620
621    <!-- FPS Player as destination of dock C -->
622    <FpsPlayer team=0 template = "fps" radarname = "Cannon Suit" position = "<?lua printC(cFPS) ?>" lookat="<?lua printC(cCenter) ?>">
623        <attached>
624            <DockingTarget name="fpsMode" />
625            <DistanceTriggerBeacon name="fpsPlayer" />
626        </attached>
627        <collisionShapes>
628            <BoxCollisionShape position="0,0,0" halfExtents="1,1,1"/>
629        </collisionShapes>
630    </FpsPlayer>
631
632    <!-- Floor for FPS Player -->
633    <StaticEntity position="<?lua printC(cFPSGround) ?>" collisionType=static mass=100000 friction=0.01 >
634        <attached>
635            <Model position="0,0,0" mesh="crate.mesh" scale3D="80,5,80" />
636            <Billboard position="320,50,320" material="Flares/ringflare2" colour="0.2,0.4,0.8" />
637            <DistanceTrigger position="320,50,320" distance="50" target="Pawn" beaconMode="identify" targetname="fpsPlayer" name="undockC"/>
638            <ForceField active=false position="0,0,0" mode="homogen" diameter="600" forcedirection = "0,-500,0" />
639            <!-- TODO: Invisible boundaries to prevent falling off platform -->
640        </attached>
641        <collisionShapes>
642            <BoxCollisionShape position="0,0,0" halfExtents="400,25,400" />
643        </collisionShapes>
644    </StaticEntity>
645
646    <!--ELEMENTS -->
647
648    <?lua
649        dofile("includes/asteroidField.lua")
650       asteroidField(cField1[1], cField1[2], cField1[3], 20, 30, 2000, 250, 0)
651    ?>
652
653    <?lua
654        dofile("includes/asteroidField.lua")
655       asteroidField(cField2[1], cField2[2], cField2[3], 20, 30, 2000, 250, 0)
656    ?>
657
658    <Planet
659        position="<?lua printC(cPlanet1) ?>"
660        scale="2000"
661        collisionType="dynamic"
662        linearDamping="0.8"
663        angularDamping="0"
664        mass="5000000"
665        pitch="0"
666        mesh="planets/muunilinst.mesh"
667        atmosphere="atmosphere1"
668        rotationaxis="1,0,0"
669        rotationrate="1.0"
670        atmospheresize="80.0f"
671        imagesize="1024.0f"
672        collisiondamage = 2
673        enablecollisiondamage = true
674      >
675      <attached>
676        <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
677        </attached>
678          <collisionShapes>
679            <SphereCollisionShape radius="2000" position="0,0,0" />
680      </collisionShapes>
681    </Planet>
682
683    <?lua
684        dofile("includes/asteroidField.lua")
685        asteroidBelt(cPlanet1[1], cPlanet1[2], cPlanet1[3], 30, 0, 30, 20, 40, 2800, 3000, 200, 1)
686    ?>
687
688    <Planet
689        position="<?lua printC(cPlanet2) ?>"
690        scale="3000"
691        collisionType="dynamic"
692        linearDamping="0.8"
693        angularDamping="0"
694        mass="5000000"
695        pitch="0"
696        mesh="planets/planet3.mesh"
697        atmosphere="atmosphere1"
698        rotationaxis="1,0,0"
699        rotationrate="1.0"
700        atmospheresize="80.0f"
701        imagesize="1024.0f"
702        collisiondamage = 2
703        enablecollisiondamage = true
704      >
705      <attached>
706        <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
707        </attached>
708          <collisionShapes>
709            <SphereCollisionShape radius="3000" position="0,0,0" />
710      </collisionShapes>
711    </Planet>
712
713    <?lua
714        dofile("includes/asteroidField.lua")
715        asteroidBelt(cPlanet2[1], cPlanet2[2], cPlanet2[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
716    ?>
717
718    <!-- Allies -->
719    <?lua
720    for i = 1, allies, 1
721    do
722    x = rAllies[1] + math.cos(2*math.pi/allies*(i+1))*100
723    y = rAllies[2] + math.sin(2*math.pi/allies*(i+1))*100
724    ?>
725    <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>
726        <templates>
727            <Template link="spaceshipassff" />
728        </templates>
729        <events>
730            <visibility>
731                <EventListener event="dockedA" />
732            </visibility>
733            <activity>
734                <EventListener event="dockedA" />
735            </activity>
736        </events>
737        <attached>
738            <DistanceTriggerBeacon name="NPC" />
739        </attached>
740        <controller>
741            <!-- also see allyControllerDispatcher -->
742            <AIController name="allyController" accuracy=100 team=0 active=false />
743        </controller>
744    </SpaceShip>
745    <?lua end ?>
746
747    <!-- Enemies. Outer loop defines waves, inner loop defines enemies in every wave. -->
748    <?lua
749    for k = 1, waves, 1
750    do
751    ?>
752    <?lua
753    for i = 1, enemies, 1
754    do
755    x = math.cos(math.pi/(enemies + 3)*(i+1))*1500
756    y = math.sin(math.pi/(enemies + 3)*(i+1))*1500
757    ?>
758    <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>
759        <templates>
760            <Template link="spaceshippirate" />
761        </templates>
762        <events>
763            <visibility>
764                <EventListener event="wave<?lua print(k)?>" />
765            </visibility>
766            <activity>
767                <EventListener event="wave<?lua print(k)?>" />
768            </activity>
769        </events>
770        <attached>
771            <DistanceTriggerBeacon name="NPC" />
772        </attached>
773        <controller>
774            <WaypointPatrolController name="attackController" accuracy=100 alertnessradius=100 team=1 active=false>
775                <waypoints>
776                    <Attacher target="transporter" deletewithparent=false />
777                </waypoints>
778                <events>
779                    <activity>
780                        <EventListener event="wave<?lua print(k)?>" />
781                    </activity>
782                </events>
783            </WaypointPatrolController>
784        </controller>
785    </SpaceShip>
786    <?lua end ?>
787    <?lua end ?>
788
789    <!-- Transporter, starting Point is near A, end Point near B, the circle parameters for the waypoints are: Center = (0, -887, 0), r = 2613 -->
790    <SpaceShip position="<?lua printC(cA) ?>" lookat="<?lua printC(cB) ?>" team=0 name="transporter" radarname="Shuttle">
791        <templates>
792            <Template link="spaceshipTransporter" />
793        </templates>
794        <attached>
795            <DistanceTriggerBeacon name="NPC" />
796        </attached>
797        <controller>
798            <WaypointController accuracy=10 team=0>
799                <waypoints>
800                    <!-- A to B -->
801                    <?lua
802                    max = 5
803                    for i = 1, max, 1
804                    do
805                    x = math.cos(math.pi*(i+1)/8)*5000
806                    y = -math.sin(math.pi*(i+1)/8)*700-3000
807                    ?>
808                    <Billboard position="<?lua print(y) ?>,0,<?lua print(x) ?>" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
809                    <?lua end ?>
810
811                    <!-- Return Point -->
812                    <Billboard position="<?lua printC(cB) ?>" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
813
814                    <!-- B to A -->
815                    <?lua
816                    max = 5
817                    for i = 1, max, 1
818                    do
819                    x = math.cos(math.pi*(max+2-i)/8)*5000
820                    y = -math.sin(math.pi*(max+2-i)/8)*700-3000
821                    ?>
822                    <Billboard position="<?lua print(y) ?>,0,<?lua print(x) ?>" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
823                    <?lua end ?>
824
825                    <!-- Start Point -->
826                    <Billboard position="<?lua printC(cA) ?>" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
827                </waypoints>
828            </WaypointController>
829        </controller>
830    </SpaceShip>
831
832    </Scene>
833</Level>
Note: See TracBrowser for help on using the repository browser.