Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

Corrected ally behavoiur. Friendly fire needs fixing though

File size: 26.3 KB
Line 
1<LevelInfo
2    name = "CampaignHS15 1"
3    description = "Protect the transporter!"
4    tags = "mission"
5    screenshot = "missionOne.png"
6/>
7
8<?lua
9    include("stats.oxo")
10    include("HUDTemplates3.oxo")
11    include("templates/lodInformation.oxt")
12
13    include("templates/spaceshipAssff2.oxt")
14    include("templates/spaceshipPirate.oxt")
15    include("templates/spaceshipEscort.oxt")
16    include("templates/spaceshipTransporter.oxt")
17    include("templates/FPS.oxt")
18?>
19
20<Level gametype = "Mission">
21    <templates>
22        <Template link="lodtemplate_default" />
23    </templates>
24
25    <?lua include("includes/notifications.oxi") ?>
26
27    <NotificationQueueCEGUI
28        name="narrative"
29        targets="simpleNotification"
30        size=3
31        displayTime=3.9
32        position="0.15, 0, 0.1, 0"
33        fontSize="23"
34        fontColor="0.3, 1, 0.2, 0.8"
35        alignment="HorzCentred"
36        displaySize="0.7, 0, 0, 0"
37    />
38
39    <!-- GLOBAL LUA VARIABLES -->
40    <?lua
41        waves = 3
42        enemies = 5
43        allies = 5
44    ?>
45
46    <Scene
47        ambientlight = "0.8, 0.8, 0.8"
48        skybox = "Orxonox/skyBoxMoreNebula"
49        hasPhysics = true
50    >
51
52    <SpawnPoint name="playerSpawn" team=0 position="0,-50,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />
53
54    <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" />
55
56    <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"/>
57
58    <!--QUEST DEFINITIONS-->
59
60    <GlobalQuest id="quest1">
61        <QuestDescription title="Reach the Station A!" description="" failMessage="" completeMessage="" />
62        <hints>
63            <QuestHint id="quest1hint1" />
64        </hints>
65        <complete-effects>
66            <AddQuest questId="quest2" />
67            <AddQuest questId="quest2.1" />
68        </complete-effects>
69    </GlobalQuest>
70
71    <GlobalQuest id="quest2">
72        <QuestDescription title="Prepare to fight the Enemy" description="" failMessage="" completeMessage="" />
73        <hints>
74        </hints>
75        <subquests>
76            <GlobalQuest id="quest2.1">
77                <QuestDescription title="> Get a better Spaceship" description="" failMessage="" completeMessage="" />
78                <complete-effects>
79                    <AddQuest questId="quest2.2" />
80                </complete-effects>
81            </GlobalQuest>
82            <GlobalQuest id="quest2.2">
83                <QuestDescription title="> Meet your Unit" description="" failMessage="" completeMessage="" />
84            </GlobalQuest>
85        </subquests>
86        <complete-effects>
87            <AddQuest questId="quest3" />
88        </complete-effects>
89    </GlobalQuest>
90
91    <GlobalQuest id="quest3">
92        <QuestDescription title="Fight the first Wave" description="" failMessage="" completeMessage="" />
93        <hints>
94        </hints>
95        <complete-effects>
96            <AddQuest questId="quest4" />
97            <AddQuest questId="quest4.1" />
98            <AddQuest questId="quest4.2" />
99        </complete-effects>
100    </GlobalQuest>
101
102    <GlobalQuest id="quest4">
103        <QuestDescription title="Prepare for the next Wave" description="" failMessage="" completeMessage="" />
104        <hints>
105        </hints>
106        <subquests>
107            <GlobalQuest id="quest4.1">
108                <QuestDescription title="> Get to the Defense Station" description="" failMessage="" completeMessage="" />
109            </GlobalQuest>
110            <GlobalQuest id="quest4.2">
111                <QuestDescription title="> Find the turret" description="" failMessage="" completeMessage="" />
112            </GlobalQuest>
113        </subquests>
114        <complete-effects>
115            <AddQuest questId="quest5" />
116        </complete-effects>
117    </GlobalQuest>
118
119    <GlobalQuest id="quest5">
120        <QuestDescription title="Fight the Hord!" description="" failMessage="" completeMessage="" />
121        <hints>
122        </hints>
123        <complete-effects>
124            <AddQuest questId="quest6" />
125            <AddQuest questId="quest6.1" />
126            <AddQuest questId="quest6.2" />
127        </complete-effects>
128    </GlobalQuest>
129
130    <GlobalQuest id="quest6">
131        <QuestDescription title="Get back to the Transporter" description="" failMessage="" completeMessage="" />
132        <hints>
133        </hints>
134        <subquests>
135            <GlobalQuest id="quest6.1">
136                <QuestDescription title="> Collect the local Pickups" description="" failMessage="" completeMessage="" />
137            </GlobalQuest>
138            <GlobalQuest id="quest6.2">
139                <QuestDescription title="> Use Portal to the Transporter" description="" failMessage="" completeMessage="" />
140            </GlobalQuest>
141        </subquests>
142        <complete-effects>
143            <AddQuest questId="quest7" />
144        </complete-effects>
145    </GlobalQuest>
146
147    <GlobalQuest id="quest7">
148        <QuestDescription title="Fight the final Wave" description="" failMessage="" completeMessage="" />
149        <hints>
150        </hints>
151        <subquests>
152        </subquests>
153    </GlobalQuest>
154
155    <!--EVENTS AND TRIGGERS
156        Usable events and triggers:
157        _spawntrigger
158        _reachedA
159        _dock<A|B|C>
160        _docked<A>      WIP; see below
161        -joinedUnit
162        _wave<k>
163        _killedEnemy<k>.<i>
164        _waveClear<k>
165    -->
166
167    <EventMultiTrigger name="spawntrigger">
168        <events>
169            <trigger>
170                <EventListener event="playerSpawn" />
171            </trigger>
172        </events>
173    </EventMultiTrigger>
174
175    <DistanceTrigger name="reachedA" position="5000,-3000,0" distance=1000 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true />
176
177    <!-- TODO: find out how to link an event to the COMPLETION of a dock. How is this not possible?? -->
178    <EventMultiTrigger name="dockedA" activations="1" stayactive="true" delay=3>
179        <events>
180            <trigger>
181                <EventListener event="dockA" />
182            </trigger>
183        </events>
184    </EventMultiTrigger>
185
186    <DistanceTrigger name="joinedUnit" active=false position="3000,-2000,0" distance=100 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true>
187        <events>
188            <activity>
189                    <EventListener event="dockedA" />
190            </activity>
191        </events>
192    </DistanceTrigger>
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
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
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>
244
245    <Script code="Mission endMission fail" onLoad="false">
246        <events>
247            <trigger>
248                <EventListener event="missionFailed" />
249            </trigger>
250        </events>
251    </Script>
252
253    <!--QUEST EFFECT BEACONS -->
254
255    <QuestEffectBeacon times=1>
256        <effects>
257            <AddQuest questId="quest1" />
258        </effects>
259        <events>
260            <execute>
261                <EventListener event="spawntrigger" />
262            </execute>
263        </events>
264    </QuestEffectBeacon>
265
266    <QuestEffectBeacon times=1>
267        <effects>
268            <CompleteQuest questId="quest1" />
269        </effects>
270        <events>
271            <execute>
272                <EventListener event="reachedA" />
273            </execute>
274        </events>
275    </QuestEffectBeacon>
276
277    <QuestEffectBeacon times=1>
278        <effects>
279            <CompleteQuest questId="quest2.1" />
280        </effects>
281        <events>
282            <execute>
283                <EventListener event="dockedA" />
284            </execute>
285        </events>
286    </QuestEffectBeacon>
287
288    <QuestEffectBeacon times=1>
289        <effects>
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>
302            <CompleteQuest questId="quest3" />
303        </effects>
304        <events>
305            <execute>
306                <EventListener event="waveClear1" />
307            </execute>
308        </events>
309    </QuestEffectBeacon>
310
311    <!--NOTIFICATIONS -->
312
313    <SimpleNotification broadcast="true" message="Welcome, Commander. Please report at Station A.">
314        <events>
315            <trigger>
316                <EventTrigger stayactive="true" delay=4 >
317                   <events>
318                      <trigger>
319                         <EventListener event="spawntrigger" />
320                      </trigger>
321                   </events>
322                </EventTrigger>
323            </trigger>
324        </events>
325    </SimpleNotification>
326
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
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
395    <SimpleNotification broadcast="true" message="yippie ki yay motherf*cker!">
396        <events>
397            <trigger>
398                <EventListener event="attackers1" />
399                <EventListener event="attackers2" />
400                <EventListener event="attackers3" />
401            </trigger>
402        </events>
403    </SimpleNotification>
404
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
423    <!--STATIONS -->
424
425    <!-- (Temporary) Template for stations. Used to define common features of all Stations. -->
426    <Template name="station">
427        <Pawn mass=10000 collisionType=dynamic friction=0.01>
428          <attached>
429            <Model mesh="HydroHarvester.mesh" position="0,0,0" scale=50 />
430            <DistanceTriggerBeacon name="NPC" />
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
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>
458        <attached>
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>
477        </attached>
478    </Pawn>
479
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
534    <!-- New SpaceShip as destination of dock A-->
535    <SpaceShip
536        template            = "spaceshipassff2"
537        team                = "0"
538        position            = "4100,-2100,0"
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"
549        name                = "newSpaceShip"
550        radarname           = "Defender" >
551      <attached>
552        <DockingTarget name="newSpaceShip" />
553        <DistanceTriggerBeacon name="newSpaceShip" />
554      </attached>
555    </SpaceShip>
556
557    <!-- FPS Player as destination of dock C-->
558    <FpsPlayer team=0 template = "fps" rotationaxis="0,0,1" radarname = "First Person Player" position = "0,-2300,1201">
559        <attached>
560            <DockingTarget name="fpsMode" />
561            <DistanceTriggerBeacon name="fpsPlayer" />
562        </attached>
563    </FpsPlayer>
564
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    <!--ELEMENTS -->
575
576    <?lua
577        dofile("includes/asteroidField.lua")
578       asteroidField(2500, 400, 0, 20, 30, 2200, 250, 0)
579    ?>
580
581    <?lua
582        dofile("includes/asteroidField.lua")
583       asteroidField(-2500, 400, 0, 20, 30, 2200, 250, 0)
584    ?>
585
586    <Planet
587        position="15000,8000,-2000"
588        scale="2000"
589        collisionType="dynamic"
590        linearDamping="0.8"
591        angularDamping="0"
592        mass="5000000"
593        pitch="0"
594        mesh="planets/muunilinst.mesh"
595        atmosphere="atmosphere1"
596        rotationaxis="1,0,0"
597        rotationrate="1.0"
598        atmospheresize="80.0f"
599        imagesize="1024.0f"
600        collisiondamage = 2
601        enablecollisiondamage = true
602      >
603      <attached>
604        <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
605        </attached>
606          <collisionShapes>
607            <SphereCollisionShape radius="2000" position="0,0,0" />
608      </collisionShapes>
609    </Planet>
610
611    <?lua
612        dofile("includes/asteroidField.lua")
613        asteroidBelt(15000, 8000, -2000, 30, 0, 30, 20, 40, 2800, 3000, 200, 1)
614    ?>
615
616    <Planet
617        position="-1000,-20000,4000"
618        scale="3000"
619        collisionType="dynamic"
620        linearDamping="0.8"
621        angularDamping="0"
622        mass="5000000"
623        pitch="0"
624        mesh="planets/planet3.mesh"
625        atmosphere="atmosphere1"
626        rotationaxis="1,0,0"
627        rotationrate="1.0"
628        atmospheresize="80.0f"
629        imagesize="1024.0f"
630        collisiondamage = 2
631        enablecollisiondamage = true
632      >
633      <attached>
634        <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
635        </attached>
636          <collisionShapes>
637            <SphereCollisionShape radius="3000" position="0,0,0" />
638      </collisionShapes>
639    </Planet>
640
641    <?lua
642        dofile("includes/asteroidField.lua")
643        asteroidBelt(-1000, -20000, 4000, 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
644    ?>
645
646    <!-- Allies, 3000,-2000 -->
647    <?lua
648    for i = 1, allies, 1
649    do
650    x = 3000 + math.cos(2*math.pi/5*(i+1))*100
651    y = -2000 + math.sin(2*math.pi/5*(i+1))*100
652    ?>
653    <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>
654        <templates>
655            <Template link="spaceshipassff2" />
656        </templates>
657        <events>
658            <visibility>
659                <EventListener event="dockedA" />
660            </visibility>
661            <activity>
662                <EventListener event="dockedA" />
663            </activity>
664        </events>
665        <attached>
666            <DistanceTriggerBeacon name="NPC" />
667        </attached>
668        <controller>
669            <WaypointPatrolController accuracy=100 name="allyController" alertnessradius=5000 team=0 active=false>
670                <events>
671                    <activity>
672                        <EventListener event="joinedUnit" />
673                    </activity>
674                </events>
675            </WaypointPatrolController>
676        </controller>
677    </SpaceShip>
678    <?lua end ?>
679
680    <!-- Enemies. Outer loop defines waves, inner loop defines enemies in every wave. -->
681    <?lua
682    for k = 1, waves, 1
683    do
684    ?>
685    <?lua
686    for i = 1, enemies, 1
687    do
688    x = math.cos(math.pi/(8)*(i+1))*1500
689    y = math.sin(math.pi/(8)*(i+1))*1500
690    ?>
691    <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>
692        <templates>
693            <Template link="spaceshippirate" />
694        </templates>
695        <events>
696            <visibility>
697                <EventListener event="wave<?lua print(k)?>" />
698            </visibility>
699            <activity>
700                <EventListener event="wave<?lua print(k)?>" />
701            </activity>
702        </events>
703        <attached>
704            <DistanceTriggerBeacon name="NPC" />
705        </attached>
706        <controller>
707            <WaypointPatrolController name="attackController" accuracy=100 alertnessradius=100 team=1 active=false>
708                <waypoints>
709                    <Attacher target="transporter" deletewithparent=false />
710                </waypoints>
711                <events>
712                    <activity>
713                        <EventListener event="wave<?lua print(k)?>" />
714                    </activity>
715                </events>
716            </WaypointPatrolController>
717        </controller>
718    </SpaceShip>
719    <?lua end ?>
720    <?lua end ?>
721
722
723    <!-- Transporter, starting Point is near A, end Point near B, the circle parameters for the waypoints are: Center = (0, -887, 0), r = 2613 -->
724    <SpaceShip position="5000,-3000,0" lookat="-2494, -1667, 0" team=0 name="transporter" radarname="Shuttle">
725        <templates>
726            <Template link="spaceshipTransporter" />
727        </templates>
728        <attached>
729            <DistanceTriggerBeacon name="NPC" />
730        </attached>
731        <controller>
732            <WaypointController accuracy=10 team=0>
733                <waypoints>
734                    <!-- A to B -->
735                    <?lua
736                    max = 5
737                    for i = 1, max, 1
738                    do
739                    x = math.cos(math.pi*(i+1)/8)*5000
740                    y = -math.sin(math.pi*(i+1)/8)*700-3000
741                    ?>
742                    <Billboard position="<?lua print(x) ?>,<?lua print(y) ?>,0" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
743                    <?lua end ?>
744
745                    <!-- Return Point -->
746                    <Billboard position="-5000, -3000, 0" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
747
748                    <!-- B to A -->
749                    <?lua
750                    max = 5
751                    for i = 1, max, 1
752                    do
753                    x = math.cos(math.pi*(max+2-i)/8)*5000
754                    y = -math.sin(math.pi*(max+2-i)/8)*700-3000
755                    ?>
756                    <Billboard position="<?lua print(x) ?>,<?lua print(y) ?>,0" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
757                    <?lua end ?>
758
759                    <!-- Start Point -->
760                    <Billboard position="5000,-3000,0" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
761                </waypoints>
762            </WaypointController>
763        </controller>
764    </SpaceShip>
765
766    </Scene>
767</Level>
Note: See TracBrowser for help on using the repository browser.