Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/campaignHS15/data/levels/shuttleRetaliation.oxw @ 10841

Last change on this file since 10841 was 10841, checked in by paulsc, 8 years ago

Worked on retaliation level.

File size: 15.1 KB
Line 
1<!--TODO: Rename screenshot as soon as it is in data_extern branch -->
2<LevelInfo
3    name = "Retaliation"
4    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!"
5    tags = "mission"
6    screenshot = "missionOne.png"
7/>
8
9<?lua
10    include("stats.oxo")
11    include("HUDTemplates3.oxo")
12    include("templates/lodInformation.oxt")
13
14    include("templates/spaceshipAssff.oxt")
15    include("templates/spaceshipPirate.oxt")
16    include("templates/spaceshipEscort.oxt")
17    include("templates/spaceshipShuttle.oxt")
18    include("templates/FPS.oxt")
19    include("templates/pickupRepresentationTemplates.oxt")
20?>
21
22<Level gametype = "Mission">
23    <templates>
24        <Template link="lodtemplate_default" />
25    </templates>
26
27    <?lua include("includes/notifications.oxi") ?>
28
29    <NotificationQueueCEGUI
30        name="narrative"
31        targets="simpleNotification"
32        size=3
33        displayTime=3.9
34        position="0.15, 0, 0.1, 0"
35        fontSize="15"
36        fontColor="0.3, 1, 0.2, 0.8"
37        alignment="HorzCentred"
38        displaySize="0.7, 0, 0, 0"
39    />
40
41    <!-- GLOBAL LUA VARIABLES -->
42    <?lua
43
44        units = 1
45
46        --[[ Coordinates in (y,z,x). NOTE: Indexing starts at 1 in lua! Don´t forget to adapt the for loops, too! ]]--
47        cCenter = {0, 0, 0}
48        cSpawn = {-2000, 2000, 2000}
49        cSector = {2000, 2000, 2000}
50        cBeacon = {1500, 1500, 1500}
51
52        cAlly1 = {-100, 0, 0}
53        cEnemy1 = {1000, 0, 0}
54
55        cPlanet1 = {-9000, -8000, 14000}
56        cPlanet2 = {12000, -1500, -10000}
57
58        cEnemyBasePlanet = {-20000, -5500, -8000}
59
60        cField1 = {-5000, -4000, -3000}
61        cField2 = {4000, 2000, 4500}
62
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    <TeamSpawnPoint name="playerSpawn" team=0 position="<?lua printC(cSpawn) ?>" lookat="<?lua printC(cCenter) ?>" 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="Enter Sector 5C" description="It is time to retaliate against the aggressors. Get back to Sector 5C to kill every last one of them!" failMessage="" completeMessage="" />
86        <hints>
87        </hints>
88        <complete-effects>
89            <AddQuest questId="quest2" />
90        </complete-effects>
91    </GlobalQuest>
92
93    <GlobalQuest id="quest2">
94        <QuestDescription title="Find them" description="It seems they have hiden 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="" />
95        <hints>
96            <QuestHint id="quest2hint1">
97                <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" />
98            </QuestHint>
99        </hints>
100        <complete-effects>
101            <AddQuest questId="quest3" />
102        </complete-effects>
103    </GlobalQuest>
104
105    <GlobalQuest id="quest3">
106        <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="" />
107        <hints>
108        </hints>
109        <complete-effects>
110            <AddQuest questId="quest4" />
111        </complete-effects>
112    </GlobalQuest>
113
114    <GlobalQuest id="quest4">
115        <QuestDescription title="Destroy their civilisation" 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="" />
116        <hints>
117        </hints>
118    </GlobalQuest>
119
120    <!--EVENTS AND TRIGGERS
121        Usable events and triggers:
122        spawntrigger
123    -->
124
125    <EventMultiTrigger name="spawntrigger" activations=1>
126        <events>
127            <trigger>
128                <EventListener event="playerSpawn" />
129            </trigger>
130        </events>
131    </EventMultiTrigger>
132
133    <DistanceTrigger name="reachedSector" position="<?lua printC(cSector) ?>" distance=1000 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true />
134
135    <EventMultiTrigger name="hintBeacon">
136        <events>
137            <trigger>
138                <EventTrigger stayactive="true" delay=90 >
139                   <events>
140                      <trigger>
141                         <EventListener event="reachedSector" />
142                      </trigger>
143                   </events>
144                </EventTrigger>
145            </trigger>
146        </events>
147    </EventMultiTrigger>
148
149    <DistanceTrigger name="cloakBeacon" position="<?lua printC(cBeacon) ?>" distance=100 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true />
150
151    <!--TODO: Complete the DistanceTriggers for completing/succeeding correctly! -->
152
153    <DistanceTrigger active=false name="missionComplete" position="2000,0,0" distance=100 target="SpaceShip" stayactive=true>
154        <events>
155            <activity>
156                <EventListener event="missionCompletePrereq" />
157            </activity>
158        </events>
159    </DistanceTrigger>
160
161    <Script code="Mission endMission true" onLoad="false">
162        <events>
163            <trigger>
164                <EventListener event="missionComplete" />
165            </trigger>
166        </events>
167    </Script>
168
169    <DistanceTrigger active=false name="missionFailed" position="2000,0,0" distance=100 target="SpaceShip" stayactive=true>
170        <events>
171            <activity>
172                <EventListener event="missionFailedPrereq" />
173            </activity>
174        </events>
175    </DistanceTrigger>
176
177    <Script code="Mission endMission fail" onLoad="false">
178        <events>
179            <trigger>
180                <EventListener event="failMission" />
181            </trigger>
182        </events>
183    </Script>
184
185    <!--QUEST EFFECT BEACONS -->
186
187    <QuestEffectBeacon times=1>
188        <effects>
189            <AddQuest questId="quest1" />
190        </effects>
191        <events>
192            <execute>
193                <EventListener event="spawntrigger" />
194            </execute>
195        </events>
196    </QuestEffectBeacon>
197
198    <QuestEffectBeacon times=1>
199        <effects>
200            <CompleteQuest questId="quest1" />
201        </effects>
202        <events>
203            <execute>
204                <EventListener event="reachedSector" />
205            </execute>
206        </events>
207    </QuestEffectBeacon>
208
209    <QuestEffectBeacon times=1>
210        <effects>
211            <AddQuestHint hintId="quest2hint2" />
212        </effects>
213        <events>
214            <execute>
215                <EventListener event="hintBeacon" />
216            </execute>
217        </events>
218    </QuestEffectBeacon>
219
220    <QuestEffectBeacon times=1>
221        <effects>
222            <CompleteQuest questId="quest2" />
223        </effects>
224        <events>
225            <execute>
226                <EventListener event="cloakBeacon" />
227            </execute>
228        </events>
229    </QuestEffectBeacon>
230
231    <!--NOTIFICATIONS -->
232
233    <SimpleNotification broadcast="true" message="Welcome, Commander. It is time to retaliate!">
234        <events>
235            <trigger>
236                <EventTrigger stayactive="true" delay=4 >
237                   <events>
238                      <trigger>
239                         <EventListener event="spawntrigger" />
240                      </trigger>
241                   </events>
242                </EventTrigger>
243            </trigger>
244        </events>
245    </SimpleNotification>
246
247    <SimpleNotification broadcast="true" message="Get to section 5C and erradicate the aggressors!">
248        <events>
249            <trigger>
250                <EventTrigger stayactive="true" delay=8 >
251                   <events>
252                      <trigger>
253                         <EventListener event="spawntrigger" />
254                      </trigger>
255                   </events>
256                </EventTrigger>
257            </trigger>
258        </events>
259    </SimpleNotification>
260
261    <SimpleNotification broadcast="true" message="That seems extreme. Is there no way around it?">
262        <events>
263            <trigger>
264                <EventTrigger stayactive="true" delay=12 >
265                   <events>
266                      <trigger>
267                         <EventListener event="spawntrigger" />
268                      </trigger>
269                   </events>
270                </EventTrigger>
271            </trigger>
272        </events>
273    </SimpleNotification>
274
275     <SimpleNotification broadcast="true" message="Stick to your objective, Commander. This is war.">
276        <events>
277            <trigger>
278                <EventTrigger stayactive="true" delay=16 >
279                   <events>
280                      <trigger>
281                         <EventListener event="spawntrigger" />
282                      </trigger>
283                   </events>
284                </EventTrigger>
285            </trigger>
286        </events>
287    </SimpleNotification>
288
289    <!--SHIPS -->
290
291    <!--Allied units-->
292
293   
294
295    <SpaceShip position="<?lua printC(cAlly1) ?>" lookat="0,0,0" name="leader1">
296      <templates>
297        <Template link=spaceshipassff />
298      </templates>
299      <controller>
300        <DivisionController team=0 formationMode="DIAMOND" action="FIGHT">
301        </DivisionController>
302      </controller>
303    </SpaceShip>
304
305    <SpaceShip position="100 ,0,100" lookat="0,0,0">
306      <templates>
307        <Template link=spaceshipassff />
308      </templates>
309      <controller>
310        <WingmanController team=0>
311        </WingmanController>
312      </controller>
313    </SpaceShip>
314
315    <SpaceShip position="0, -100,0" lookat="0,0,0">
316      <templates>
317        <Template link=spaceshipassff />
318      </templates>
319      <controller>
320        <WingmanController team=0>
321        </WingmanController>
322      </controller>
323    </SpaceShip>
324
325    <SpaceShip position="-100, 0, 100" lookat="0,0,0">
326      <templates>
327        <Template link=spaceshipassff />
328      </templates>
329      <controller>
330        <SectionController team=0>
331        </SectionController>
332      </controller>
333    </SpaceShip>
334
335   
336   
337    <!-- Enemy Units -->
338
339
340    <?lua
341    for k = 1, units, 1
342    do
343    x = math.cos(math.pi/(2*units - 2)*k)*1500
344    y = math.sin(math.pi/(2*units - 2)*k)*1500
345    ?>
346
347    <SpaceShip team=1 position="<?lua printC(cEnemy1) ?>" lookat="0,0,0" name="enemy<?lua print(k) ?>">
348      <templates>
349        <Template link=spaceshipassff />
350      </templates>
351      <controller>
352        <DivisionController team=1 formationMode="DIAMOND" action="FIGHT">
353        </DivisionController>
354      </controller>
355    </SpaceShip>
356
357    <SpaceShip team=1 position="100 ,0,100" lookat="0,0,0" name="enemy<?lua print(k) ?>">
358      <templates>
359        <Template link=spaceshipassff />
360      </templates>
361      <controller>
362        <WingmanController team=1>
363        </WingmanController>
364      </controller>
365    </SpaceShip>
366
367    <SpaceShip team=1 position="0, -100,0" lookat="0,0,0" name="enemy<?lua print(k) ?>">
368      <templates>
369        <Template link=spaceshipassff />
370      </templates>
371      <controller>
372        <WingmanController team=1>
373        </WingmanController>
374      </controller>
375    </SpaceShip>
376
377    <SpaceShip team=1 position="-100, 0, 100" lookat="0,0,0" name="enemy<?lua print(k) ?>">
378      <templates>
379        <Template link=spaceshipassff />
380      </templates>
381      <controller>
382        <SectionController team=1>
383        </SectionController>
384      </controller>
385    </SpaceShip>
386
387    <?lua end ?>
388   
389    <!--ELEMENTS -->
390
391    <!-- Asteroids you have to fly through to get to the EnemyBase -->
392   
393    <?lua
394        dofile("includes/asteroidField.lua")
395       asteroidField(cField1[1], cField1[2], cField1[3], 20, 30, 4500, 500, 0)
396    ?>   
397
398    <!-- Other Asteroid-Fields -->
399
400    <?lua
401        dofile("includes/asteroidField.lua")
402       asteroidField(cField2[1], cField2[2], cField2[3], 20, 30, 4500, 500, 0)
403    ?>
404
405    <!-- Planets -->
406
407   <Planet
408        position="<?lua printC(cPlanet1) ?>"
409        scale="3000"
410        collisionType="dynamic"
411        linearDamping="0.8"
412        angularDamping="0"
413        mass="5000000"
414        pitch="0"
415        mesh="planets/muunilinst.mesh"
416        atmosphere="atmosphere1"
417        rotationaxis="1,0,0"
418        rotationrate="1.0"
419        atmospheresize="80.0f"
420        imagesize="1024.0f"
421        collisiondamage = 2
422        enablecollisiondamage = true
423    visible=true
424    active=true
425      >
426      <attached>
427        <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
428        </attached>
429          <collisionShapes>
430            <SphereCollisionShape radius="3000" position="0,0,0" />
431      </collisionShapes>
432    </Planet>
433
434    <?lua
435        dofile("includes/asteroidField.lua")
436        asteroidBelt(cPlanet1[1], cPlanet1[2], cPlanet1[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
437    ?>
438
439    <Planet
440        position="<?lua printC(cPlanet2) ?>"
441        scale="2000"
442        collisionType="dynamic"
443        linearDamping="0.8"
444        angularDamping="0"
445        mass="5000000"
446        pitch="0"
447        mesh="planets/ganymede.mesh"
448        atmosphere="atmosphere1"
449        rotationaxis="1,0,0"
450        rotationrate="1.0"
451        atmospheresize="80.0f"
452        imagesize="1024.0f"
453        collisiondamage = 2
454        enablecollisiondamage = true
455    visible=true
456    active=true
457      >
458      <attached>
459        <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
460        </attached>
461          <collisionShapes>
462            <SphereCollisionShape radius="2000" position="0,0,0" />
463      </collisionShapes>
464    </Planet>
465
466    <?lua
467        dofile("includes/asteroidField.lua")
468        asteroidBelt(cPlanet2[1], cPlanet2[2], cPlanet2[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
469    ?>
470
471    <!-- EnemyPlanet(s) -->
472
473    <Planet
474        position="<?lua printC(cEnemyBasePlanet) ?>"
475        scale="5000"
476        collisionType="dynamic"
477        linearDamping="0.8"
478        angularDamping="0"
479        mass="5000000"
480        pitch="0"
481        mesh="planets/jupiter.mesh"
482        atmosphere="atmosphere1"
483        rotationaxis="1,0,0"
484        rotationrate="1.0"
485        atmospheresize="80.0f"
486        imagesize="1024.0f"
487        collisiondamage = 2
488        enablecollisiondamage = true
489    visible=true
490    active=true
491      >
492      <attached>
493        <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-500" />
494        </attached>
495          <collisionShapes>
496            <SphereCollisionShape radius="5000" position="0,0,0" />
497      </collisionShapes>
498    </Planet>
499
500    </Scene>
501</Level>
Note: See TracBrowser for help on using the repository browser.