Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

Changed the mass for the stations

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