Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 10730 was 10730, checked in by bhatiab, 9 years ago

Worked on lua.fog, fogFields is working now, but I'm having problemes with generateTorusLikeFog

File size: 19.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
14<?lua
15    include("templates/spaceshipAssff2.oxt")
16    include("templates/spaceshipPirate.oxt")
17    include("templates/spaceshipEscort.oxt")
18    include("templates/spaceshipRing.oxt")
19    include("templates/spaceshipSwallow.oxt")
20    include("templates/spaceshipTransporter.oxt")
21    include("templates/FPS.oxt")
22?>
23
24<Level gametype = "Mission">
25    <templates>
26        <Template link="lodtemplate_default" />
27    </templates>
28
29    <?lua include("includes/notifications.oxi") ?>
30
31    <NotificationQueueCEGUI
32        name="narrative"
33        targets="simpleNotification"
34        size=3
35        displayTime=3.9
36        position="0.15, 0, 0.1, 0"
37        fontSize="23"
38        fontColor="0.3, 1, 0.2, 0.8"
39        alignment="HorzCentred"
40        displaySize="0.7, 0, 0, 0"
41    />
42
43    <!-- GLOBAL LUA VARIABLES -->
44    <?lua
45        waves = 3
46        enemies = 5
47    ?>
48
49    <Scene
50        ambientlight = "0.8, 0.8, 0.8"
51        skybox = "Orxonox/Starbox"
52        hasPhysics = true
53    >
54
55    <SpawnPoint name="playerSpawn" team=0 position="0,-50,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff2 />
56
57    <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" />
58
59    <Light type=directional position="0,0,0" 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"/>
60
61    <!--QUEST DEFINITIONS-->
62
63    <GlobalQuest id="quest1">
64        <QuestDescription title="Reach the Station A!" description="" failMessage="" completeMessage="" />
65        <hints>
66            <QuestHint id="quest1hint1" />
67        </hints>
68        <complete-effects>
69            <!-- Quest 2 not made as of yet
70            <AddQuest questId="quest2" />
71            <AddQuest questId="quest2.1" />
72            <AddQuest questId="quest2.2" />
73            <AddQuest questId="quest2.3" />
74            -->
75            <AddQuest questId="quest3" />
76        </complete-effects>
77    </GlobalQuest>
78
79    <GlobalQuest id="quest2">
80        <QuestDescription title="Prepare to fight the Wave" description="" failMessage="" completeMessage="" />
81        <hints>
82        </hints>
83        <subquests>
84            <GlobalQuest id="quest2.1">
85                <QuestDescription title="Get a better Spaceship" description="" failMessage="" completeMessage="" />
86            </GlobalQuest>
87            <GlobalQuest id="quest2.2">
88                <QuestDescription title="Get some Pickups" description="" failMessage="" completeMessage="" />
89            </GlobalQuest>
90            <GlobalQuest id="quest2.3">
91                <QuestDescription title="Meet your Unit" description="" failMessage="" completeMessage="" />
92            </GlobalQuest>
93        </subquests>
94        <complete-effects>
95            <AddQuest questId="quest3" />
96        </complete-effects>
97    </GlobalQuest>
98
99    <GlobalQuest id="quest3">
100        <QuestDescription title="Fight the first Wave" description="" failMessage="" completeMessage="" />
101        <hints>
102        </hints>
103        <complete-effects>
104            <AddQuest questId="quest4" />
105            <AddQuest questId="quest4.1" />
106            <AddQuest questId="quest4.2" />
107        </complete-effects>
108    </GlobalQuest>
109
110    <GlobalQuest id="quest4">
111        <QuestDescription title="Prepare for the next Wave" description="" failMessage="" completeMessage="" />
112        <hints>
113        </hints>
114        <subquests>
115            <GlobalQuest id="quest4.1">
116                <QuestDescription title="Get to the Defense Station" description="" failMessage="" completeMessage="" />
117            </GlobalQuest>
118            <GlobalQuest id="quest4.2">
119                <QuestDescription title="Find the turret" description="" failMessage="" completeMessage="" />
120            </GlobalQuest>
121        </subquests>
122        <complete-effects>
123            <AddQuest questId="quest5" />
124        </complete-effects>
125    </GlobalQuest>
126
127    <GlobalQuest id="quest5">
128        <QuestDescription title="Fight the Hord!" description="" failMessage="" completeMessage="" />
129        <hints>
130        </hints>
131        <complete-effects>
132            <AddQuest questId="quest6" />
133            <AddQuest questId="quest6.1" />
134            <AddQuest questId="quest6.2" />
135        </complete-effects>
136    </GlobalQuest>
137
138    <GlobalQuest id="quest6">
139        <QuestDescription title="Get back to the Transporter" description="" failMessage="" completeMessage="" />
140        <hints>
141        </hints>
142        <subquests>
143            <GlobalQuest id="quest6.1">
144                <QuestDescription title="Collect the local Pickups" description="" failMessage="" completeMessage="" />
145            </GlobalQuest>
146            <GlobalQuest id="quest6.2">
147                <QuestDescription title="Use Portal to the Transporter" description="" failMessage="" completeMessage="" />
148            </GlobalQuest>
149        </subquests>
150        <complete-effects>
151            <AddQuest questId="quest7" />
152        </complete-effects>
153    </GlobalQuest>
154
155    <GlobalQuest id="quest7">
156        <QuestDescription title="Fight the final Wave" description="" failMessage="" completeMessage="" />
157        <hints>
158        </hints>
159        <subquests>
160        </subquests>
161    </GlobalQuest>
162
163    <!--EVENTS AND TRIGGERS
164        Usable events and triggers:
165        _spawntrigger
166        _reachedA
167        _wave<k>
168        _killedEnemy<k>.<i>
169        _waveClear<k>
170    -->
171
172    <EventMultiTrigger name="spawntrigger">
173        <events>
174            <trigger>
175                <EventListener event="playerSpawn" />
176            </trigger>
177        </events>
178    </EventMultiTrigger>
179
180    <DistanceTrigger name="reachedA" position="5000,-3000,0" distance=200 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true />
181
182    <EventMultiTrigger name="wave1" activations="1" stayactive="true" >
183        <events>
184            <trigger>
185                <EventListener event="reachedA" />
186            </trigger>
187        </events>
188    </EventMultiTrigger>
189
190    <!-- Recursive helper function for the end-of-wave events. F*ck the event system, seriously. -->
191    <?lua
192    function enemyTriggerRecursor(i, k)
193    if i > 0 then
194    return [[
195    <EventTrigger name=killedEnemy]] .. k .. [[.]] .. i .. [[ activations=1 stayactive=true delay=0.1>
196        <events>
197            <trigger>
198                <EventListener event=attackers]] .. k .. [[ />
199            </trigger>
200        </events>
201        ]] .. enemyTriggerRecursor(i-1, k) .. [[
202    </EventTrigger>
203    ]]
204    else return ""
205    end
206    end
207    ?>
208    <!-- Actual recursive Event(s) for the respective waves. -->
209    <?lua
210    for k = 1, waves, 1
211    do
212    print(enemyTriggerRecursor(enemies,k))
213    ?>
214    <EventMultiTrigger name="waveClear<?lua print(k) ?>" delay=4.0>
215        <events>
216            <trigger>
217                <EventListener event="killedEnemy<?lua print(k .. [[.]] .. enemies) ?>" />
218            </trigger>
219        </events>
220    </EventMultiTrigger>
221    <?lua end ?>
222
223    <!-- This trigger needs fixing, as endMission can only be called by a Pawn Distance Trigger. Herpaderp -->
224    <EventMultiTrigger name="missionFailed" target="Pawn" stayActive="true" delay=1.5>
225        <events>
226            <trigger>
227                <EventListener event="transporter" />
228            </trigger>
229        </events>
230    </EventMultiTrigger>
231
232    <Script code="Mission endMission fail" onLoad="false" times="1">
233        <events>
234            <trigger>
235                <EventListener event="missionFailed" />
236            </trigger>
237        </events>
238    </Script>
239
240    <!--QUEST EFFECT BEACONS -->
241
242    <QuestEffectBeacon times=1>
243        <effects>
244            <AddQuest questId="quest1" />
245        </effects>
246        <events>
247            <execute>
248                <EventListener event="spawntrigger" />
249            </execute>
250        </events>
251    </QuestEffectBeacon>
252
253    <QuestEffectBeacon times=1>
254        <effects>
255            <CompleteQuest questId="quest1" />
256        </effects>
257        <events>
258            <execute>
259                <EventListener event="reachedA" />
260            </execute>
261        </events>
262    </QuestEffectBeacon>
263
264    <QuestEffectBeacon times=1>
265        <effects>
266            <CompleteQuest questId="quest3" />
267        </effects>
268        <events>
269            <execute>
270                <EventListener event="waveClear1" />
271            </execute>
272        </events>
273    </QuestEffectBeacon>
274
275    <!--NOTIFICATIONS -->
276
277    <SimpleNotification broadcast="true" message="Welcome, Commander. Please report at Station A">
278        <events>
279            <trigger>
280                <EventListener event="spawntrigger" />
281            </trigger>
282        </events>
283    </SimpleNotification>
284
285    <SimpleNotification broadcast="true" message="An enemy wave is approaching the shuttle!">
286        <events>
287            <trigger>
288                <EventListener event="wave1" />
289                <EventListener event="wave2" />
290                <EventListener event="wave3" />
291            </trigger>
292        </events>
293    </SimpleNotification>
294
295    <SimpleNotification broadcast="true" message="yippie ki yay motherf*cker!">
296        <events>
297            <trigger>
298                <EventListener event="attackers1" />
299                <EventListener event="attackers2" />
300                <EventListener event="attackers3" />
301            </trigger>
302        </events>
303    </SimpleNotification>
304
305    <SimpleNotification broadcast="true" message="Phew, that was close! Well done, Commmander.">
306        <events>
307            <trigger>
308                <EventListener event="waveClear1" />
309                <EventListener event="waveClear2" />
310                <EventListener event="waveClear3" />
311            </trigger>
312        </events>
313    </SimpleNotification>
314
315    <SimpleNotification broadcast="true" message="It's over... we failed. Retreat!">
316        <events>
317            <trigger>
318                <EventListener event="missionFailed" />
319            </trigger>
320        </events>
321    </SimpleNotification>
322
323    <!--STATIONS -->
324
325    <!-- (Temporary) Template for stations. Used to define common features of all Stations. -->
326    <Template name="station">
327        <Pawn mass=10000 collisionType=dynamic friction=0.01>
328          <attached>
329            <Model mesh="HydroHarvester.mesh" position="0,0,0" scale=50 />
330            <DistanceTriggerBeacon name="NPC" />
331          </attached>
332          <collisionShapes>
333            <BoxCollisionShape  position="-560,0,0" halfExtents="115,100,245" /><!-- Three lower boxes -->
334            <BoxCollisionShape  position="290,0,-480" halfExtents="115,100,245" yaw=-120 />
335            <BoxCollisionShape  position="290,0,480" halfExtents="115,100,245" yaw=-240 />
336            <BoxCollisionShape  position="-280,0,0" halfExtents="163,50,50" /><!-- Three lower connections -->
337            <BoxCollisionShape  position="140,0,-240" halfExtents="163,50,50" yaw=-120 />
338            <BoxCollisionShape  position="140,0,240" halfExtents="163,50,50" yaw=-240 />
339            <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" /><!-- Upper Tower -->
340            <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" yaw=-120 />
341            <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" yaw=-240 />
342            <BoxCollisionShape  position="0,400,0" halfExtents="43,110,26" yaw=-30 /><!-- Middle one-->
343            <BoxCollisionShape  position="-200,100,0" halfExtents="26,50,43" /><!--Three lower legs -->
344            <BoxCollisionShape  position="100,100,-173" halfExtents="43,50,26" yaw=-30 />
345            <BoxCollisionShape  position="100,100,-173" halfExtents="43,50,26" yaw=30 />
346            <BoxCollisionShape  position="-100,264,0" halfExtents="26,105,43" roll=-49 /><!--Three upper legs -->
347            <BoxCollisionShape  position="50,264,-87" halfExtents="26,105,43" roll=-49 yaw=-120 />
348            <BoxCollisionShape  position="50,264,87" halfExtents="26,105,43" roll=-49 yaw=-240 />
349          </collisionShapes>
350      </Pawn>
351    </Template>
352
353    <!-- A, Coordinates are approx. (cos(29pi/16), sin(29pi/16), 0)*3000 -->
354    <Pawn name="statA" team=0 radarname="Station A" position="5000,-3000,0" direction="0,1,0" initialhealth=10000 maxhealth=10000>
355        <templates>
356            <Template link="station" />
357        </templates>
358        <attached>
359            <DockingTarget name="dockTargetA" />
360            <Dock position="0,0,0" active=true>
361                <animations>
362                    <MoveToDockingTarget target="dockTargetA" />
363                </animations>
364                <effects>
365                    <DockToShip target="newSpaceShip" />
366                </effects>
367                <events>
368                    <execute>
369                        <EventListener event="dockA" />
370                    </execute>
371                </events>
372                <attached>
373                    <DistanceTrigger position="0,0,0" distance="200" target="SpaceShip" beaconMode="exclude" targetname="NPC" name="dockA" />
374                    <Billboard position="0,0,0" amplitude=1 material="Flares/lensflare" colour="1,0,0.05" />
375                </attached>
376            </Dock>
377        </attached>
378    </Pawn>
379
380    <!-- B, Coordinates are approx. (-cos(29pi/16), sin(29pi/16), 0)*3000 -->
381    <Pawn name="statB" team=0 radarname="Station B" position="-5000,-3000,0" direction="0,1,0" initialhealth=10000 maxhealth=10000>
382        <templates>
383            <Template link="station" />
384        </templates>
385        <attached>
386            <DockingTarget name="dockTargetB" />
387            <Dock position="0,0,0" active=true>
388                <animations>
389                    <MoveToDockingTarget target="dockTargetB" />
390                </animations>
391                <effects>
392                    <DockToShip target="newSpaceShip" />
393                </effects>
394                <events>
395                    <execute>
396                        <EventListener event="dockB" />
397                    </execute>
398                </events>
399                <attached>
400                    <DistanceTrigger position="0,0,0" distance="200" target="SpaceShip" beaconMode="exclude" targetname="NPC" name="dockB" />
401                    <Billboard position="0,0,0" amplitude=1 material="Flares/lensflare" colour="1,0,0.05" />
402                </attached>
403            </Dock>
404        </attached>
405    </Pawn>
406
407    <!-- C -->
408    <Pawn name="statC" team=0 radarname="Station C" position="0,-2300,0" direction="0,1,0" initialhealth=10000 maxhealth=10000>
409        <templates>
410            <Template link="station" />
411        </templates>
412        <attached>
413            <DockingTarget name="dockTargetC" />
414            <Dock position="0,0,0" active=true>
415                <animations>
416                    <MoveToDockingTarget target="dockTargetC" />
417                </animations>
418                <effects>
419                    <DockToShip target="fpsMode" />
420                </effects>
421                <events>
422                    <execute>
423                        <EventListener event="dockC" />
424                    </execute>
425                </events>
426                <attached>
427                    <DistanceTrigger position="0,0,0" distance="200" target="SpaceShip" beaconMode="exclude" targetname="NPC" name="dockC" />
428                    <Billboard position="0,0,0" amplitude=1 material="Flares/lensflare" colour="1,0,0.05" />
429                </attached>
430            </Dock>
431        </attached>
432    </Pawn>
433
434    <!-- New SpaceShip as destination of dock C-->
435    <SpaceShip
436        template            = "spaceshipassff2"
437        team                = "0"
438        position            = "7500,-5500,0"
439        orientation         = "-0.14, 0.68, 0.68, 0.223"
440        health              = "400"
441        initialhealth       = "400"
442        maxhealth           = "500"
443        shieldhealth        = "80"
444        initialshieldhealth = "80"
445        maxshieldhealth     = "120"
446        shieldabsorption    = "0.8"
447        reloadrate          = "1"
448        reloadwaittime      = "1"
449        name                = "cruiser"
450        radarname           = "Spacecruiser" >
451      <attached>
452        <DockingTarget name="newSpaceShip" />
453      </attached>
454    </SpaceShip>
455
456    <!-- FPS Player as destination of dock C-->
457    <FpsPlayer template = "fps" radarname = "First Person Player" position = "0,-2300,640" lookat="0,0,0" >
458        <attached>
459            <DockingTarget name="fpsMode" />
460            <DistanceTriggerBeacon name="fpsPlayer" />
461        </attached>
462    </FpsPlayer>
463
464    <!--ELEMENTS -->
465
466    <?lua
467        dofile("includes/asteroidField.lua")
468        asteroidBelt(0,-2000, 0, 30, 0, 5, 20, 40, 500, 3300, 75, 0)
469    ?>
470
471    <?lua
472        dofile("includes/fog.lua")
473       fogField(0,0,500,150,20)
474    ?>
475
476    <!-- Enemies. Outer loop defines waves, inner loop defines enemies in every wave. -->
477    <?lua
478    for k = 1, waves, 1
479    do
480    ?>
481    <?lua
482    for i = 1, enemies, 1
483    do
484    x = math.cos(math.pi/8*(i+1))*1500
485    y = math.sin(math.pi/8*(i+1))*1500
486    ?>
487    <SpaceShip visible=false active=flase name="attackers<?lua print(k)?>" radarname="Attacker" position="<?lua print(x)?>,<?lua print(y)?>,<?lua print(math.pow(-1,i)*250) ?>" lookat="0,0,0" team=1>
488        <templates>
489            <Template link="spaceshippirate" />
490        </templates>
491        <events>
492            <visibility>
493                <EventListener event="wave<?lua print(k)?>" />
494            </visibility>
495            <activity>
496                <EventListener event="wave<?lua print(k)?>" />
497            </activity>
498        </events>
499        <attached>
500            <DistanceTriggerBeacon name="NPC" />
501        </attached>
502        <controller>
503            <WaypointPatrolController name="attackController" alertnessradius=50 team=1 active=false>
504                <waypoints>
505                    <Attacher target="transporter" deletewithparent=false />
506                </waypoints>
507                <events>
508                    <activity>
509                        <EventListener event="wave<?lua print(k)?>" />
510                    </activity>
511                </events>
512            </WaypointPatrolController>
513        </controller>
514    </SpaceShip>
515    <?lua end ?>
516    <?lua end ?>
517
518    <!-- Transporter, starting Point is near A, end Point near B, the circle parameters for the waypoints are: Center = (0, -887, 0), r = 2613 -->
519    <SpaceShip position="5000,-3000,0" lookat="-2494, -1667, 0" team=0 name="transporter" radarname="Shuttle">
520        <templates>
521            <Template link="spaceshipTransporter" />
522        </templates>
523        <attached>
524            <DistanceTriggerBeacon name="NPC" />
525        </attached>
526        <controller>
527            <WaypointController accuracy=10 team=0>
528                <waypoints>
529                    <!-- A to B -->
530                    <?lua
531                    max = 5
532                    for i = 1, max, 1
533                    do
534                    x = math.cos(math.pi*(i+1)/8)*5000
535                    y = -math.sin(math.pi*(i+1)/8)*700-3000
536                    ?>
537                    <Billboard position="<?lua print(x) ?>,<?lua print(y) ?>,0" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
538                    <?lua end ?>
539
540                    <!-- Return Point -->
541                    <Billboard position="-5000, -3000, 0" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
542
543                    <!-- B to A -->
544                    <?lua
545                    max = 5
546                    for i = 1, max, 1
547                    do
548                    x = math.cos(math.pi*(max+2-i)/8)*5000
549                    y = -math.sin(math.pi*(max+2-i)/8)*700-3000
550                    ?>
551                    <Billboard position="<?lua print(x) ?>,<?lua print(y) ?>,0" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
552                    <?lua end ?>
553
554                    <!-- Start Point -->
555                    <Billboard position="5000,-3000,0" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
556                </waypoints>
557            </WaypointController>
558        </controller>
559    </SpaceShip>
560
561
562
563    </Scene>
564</Level>
Note: See TracBrowser for help on using the repository browser.