Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

Added Allies.

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