Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/campaignHS15/data/levels/expeditionSector.oxw @ 10914

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

Finished Storyline and description, finished waypontpatrols for the 5 enemies, only problem i am having is that they don't attack me for some reason…

File size: 18.6 KB
Line 
1<!--TODO: Rename screenshot as soon as it is in data_extern branch -->
2<LevelInfo
3    name = "Expedition to Sector 5C"
4    description = "Commander, our scientists are reporting strange binary radio signals from a yet unexplored and thought to be uninhabited region, sector 5C. Explore the sector and get to the bottom of these messages!"
5    tags = "mission"
6    screenshot = "missionOne.png"
7/>
8
9<?lua
10    include("stats.oxo")
11    include("HUDTemplates3.oxo")
12    include("templates/lodInformation.oxt")
13
14    include("templates/spaceshipAssff.oxt")
15    include("templates/spaceshipPirate.oxt")
16    include("templates/spaceshipEscort.oxt")
17    include("templates/spaceshipShuttle.oxt")
18    include("templates/FPS.oxt")
19    include("templates/pickupRepresentationTemplates.oxt")
20?>
21
22<Level gametype = "Mission">
23    <templates>
24        <Template link="lodtemplate_default" />
25    </templates>
26
27    <?lua include("includes/notifications.oxi") ?>
28
29    <NotificationQueueCEGUI
30        name="narrative"
31        targets="simpleNotification"
32        size=3
33        displayTime=3.9
34        position="0.15, 0, 0.1, 0"
35        fontSize="15"
36        fontColor="0.3, 1, 0.2, 0.8"
37        alignment="HorzCentred"
38        displaySize="0.7, 0, 0, 0"
39    />
40
41    <!-- GLOBAL LUA VARIABLES -->
42    <?lua
43
44        --[[ Coordinates in (y,z,x). NOTE: Indexing starts at 1 in lua! Don´t forget to adapt the for loops, too! ]]--
45        cCenter = {0, 0, 0}
46        cSpawn = {-50, 0, 0}
47        cSector = {-15000, -5500, -9000}
48        cSectorEntry = {-4710, -5500, -2826}
49        cPathToEntry = {{0, -2000, 0}}
50        cBeacon = {-6500, -5500, -4400}
51
52        radSector = 12000
53
54              cStationA = {1400, 400, -800}
55        cNewShip = {1000, 250, -350}
56
57        cPlanet1 = {20000, 0, 29000}
58        cPlanet2 = {-22000, 0, -29000}
59
60        cEnemyBasePlanet = {-20000, -5500, -8000}
61
62        cEnemyBaseStation1 = {-12500, -4500, -3500}
63
64              cField1 = {-5000, -4000, -3000}
65              cField2 = {4000, 2000, 4500}
66
67        --[[ Function to print Coordinates. Quotes not included! ]]--
68        function printC(coord)
69          print(coord[1] .. [[,]] .. coord[2] .. [[,]] .. coord[3])
70        end
71
72        --[[ Function to add Coordinates.]]--
73        function addC(coord1, coord2)
74            return {coord1[1]+coord2[1], coord1[2]+coord2[2], coord1[3]+coord2[3]}
75        end
76    ?>
77
78    <Scene
79        ambientlight = "0.8, 0.8, 0.8"
80        skybox = "Orxonox/skyBoxMoreNebula"
81        hasPhysics = true
82    >
83
84    <SpawnPoint name="playerSpawn" team=0 position="<?lua printC(cSpawn) ?>" lookat="<?lua printC(cCenter) ?>" spawnclass=SpaceShip pawndesign=spaceshipescort />
85
86    <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" />
87
88    <Light type=directional position="<?lua printC(cCenter) ?>" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
89
90    <!--QUEST DEFINITIONS-->
91
92    <GlobalQuest id="quest1">
93        <QuestDescription title="Quest 1" description="We received some extraterrestial binary radio signals from Sector 5C! We'd like yout to take the portal and fly over there to check out if life can be found there as we believed to be an inhabitated region in space." failMessage="" completeMessage="" />
94        <hints>
95        </hints>
96        <complete-effects>
97            <AddQuest questId="quest2" />
98        </complete-effects>
99    </GlobalQuest>
100
101    <!--EVENTS AND TRIGGERS
102        Usable events and triggers:
103        spawntrigger
104
105        BASE-STORY-LINE:
106        We receive a message from commander (SimpleNotification -> SpawnTrigger) about alien radio activity in a nearby sector and are asked to change our spaceship
107        QUEST1: Dock to Station and get better Spaceship
108        TRIGGER: Docked to Station
109        EVENT: Change Spaceship and Sector 5C becomes visilbe
110
111        We are asked to go to the sector and explore it
112        QUEST2.1: Go to Sector 5C and see what you can find there
113        TRIGGER: Distance Trigger at enemy spacestation, with a rather large radius
114        EVENT: The 25 Enemies and there SpaceStation become visible, the planet should stay invisible; the patroling enemies on your way back become visible as well.
115
116        On your way back you discover the patroling enemy spaceships, they attack you, but you must survive and report to your commander about an possible upcoming attack from the aliens
117        QUEST2.2: Destroy the patroling spaceships, spare no one
118        TRIGGER: -------- The patroling spaceships should triggered bythemselves?
119        EVENT: After destroying all 5 enemy ships, you can return to your base and safety, the Distancetrigger for next quest is activated
120        FAIL: You fail if you die here
121
122        After destroying the enemy ships, you make it bake to your station in time to report about the hord of enemies you saw and start preparing for the upcoming fight!
123        QUEST3: Go back to spacestation
124        TRIGGER: Distancetrigger i suppose?
125        EVENT: You win this level, and the main level is unlocked.
126    -->
127
128    <EventMultiTrigger name="spawntrigger">
129        <events>
130            <trigger>
131                <EventListener event="playerSpawn" />
132            </trigger>
133        </events>
134    </EventMultiTrigger>
135
136    <!--TODO: Complete the DistanceTriggers for completing/succeeding correctly! -->
137
138    <DistanceTrigger active=false name="missionComplete" position="2000,0,0" distance=100 target="SpaceShip" stayactive=true>
139        <events>
140            <activity>
141                <EventListener event="missionCompletePrereq" />
142            </activity>
143        </events>
144    </DistanceTrigger>
145
146    <Script code="Mission endMission true" onLoad="false">
147        <events>
148            <trigger>
149                <EventListener event="missionComplete" />
150            </trigger>
151        </events>
152    </Script>
153
154    <DistanceTrigger active=false name="missionFailed" position="2000,0,0" distance=100 target="SpaceShip" stayactive=true>
155        <events>
156            <activity>
157                <EventListener event="missionFailedPrereq" />
158            </activity>
159        </events>
160    </DistanceTrigger>
161
162    <Script code="Mission endMission fail" onLoad="false">
163        <events>
164            <trigger>
165                <EventListener event="failMission" />
166            </trigger>
167        </events>
168    </Script>
169
170    <!--QUEST EFFECT BEACONS -->
171
172    <QuestEffectBeacon times=1>
173        <effects>
174            <AddQuest questId="quest1" />
175        </effects>
176        <events>
177            <execute>
178                <EventListener event="spawntrigger" />
179            </execute>
180        </events>
181    </QuestEffectBeacon>
182
183    <!--NOTIFICATIONS -->
184
185    <SimpleNotification broadcast="true" message="Welcome, Commander.">
186        <events>
187            <trigger>
188                <EventTrigger stayactive="true" delay=4 >
189                   <events>
190                      <trigger>
191                         <EventListener event="spawntrigger" />
192                      </trigger>
193                   </events>
194                </EventTrigger>
195            </trigger>
196        </events>
197    </SimpleNotification>
198
199    <SimpleNotification broadcast="true" message="Please check your quests!">
200        <events>
201            <trigger>
202                <EventTrigger stayactive="true" delay=7 >
203                   <events>
204                      <trigger>
205                         <EventListener event="spawntrigger" />
206                      </trigger>
207                   </events>
208                </EventTrigger>
209            </trigger>
210        </events>
211    </SimpleNotification>
212
213    <!--STATIONS -->
214
215    <Template name="station">
216        <Pawn mass=10000000 collisionType=dynamic friction=0.01>
217            <attached>
218                <Model mesh="HydroHarvester.mesh" position="0,0,0" scale=50 />
219                <DistanceTriggerBeacon name="NPC" />
220            </attached>
221            <collisionShapes>
222                <BoxCollisionShape  position="-560,0,0" halfExtents="115,100,245" /><!-- Three lower boxes -->
223                <BoxCollisionShape  position="290,0,-480" halfExtents="115,100,245" yaw=-120 />
224                <BoxCollisionShape  position="290,0,480" halfExtents="115,100,245" yaw=-240 />
225                <BoxCollisionShape  position="-280,0,0" halfExtents="163,50,50" /><!-- Three lower connections -->
226                <BoxCollisionShape  position="140,0,-240" halfExtents="163,50,50" yaw=-120 />
227                <BoxCollisionShape  position="140,0,240" halfExtents="163,50,50" yaw=-240 />
228                <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" /><!-- Upper Tower -->
229                <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" yaw=-120 />
230                <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" yaw=-240 />
231                <BoxCollisionShape  position="0,400,0" halfExtents="43,110,26" yaw=-30 /><!-- Middle one-->
232                <BoxCollisionShape  position="-200,100,0" halfExtents="26,50,43" /><!--Three lower legs -->
233                <BoxCollisionShape  position="100,100,-173" halfExtents="43,50,26" yaw=-30 />
234                <BoxCollisionShape  position="100,100,-173" halfExtents="43,50,26" yaw=30 />
235                <BoxCollisionShape  position="-100,264,0" halfExtents="26,105,43" roll=-49 /><!--Three upper legs -->
236                <BoxCollisionShape  position="50,264,-87" halfExtents="26,105,43" roll=-49 yaw=-120 />
237                <BoxCollisionShape  position="50,264,87" halfExtents="26,105,43" roll=-49 yaw=-240 />
238            </collisionShapes>
239        </Pawn>
240    </Template>
241
242    <Pawn name="statA" team=0 radarname="Outer Base - Sector 4B" position="<?lua printC(cStationA) ?>" direction="<?lua printC(cSpawn) ?>" yaw=45 pitch=-5 roll=-25 initialhealth=10000 maxhealth=10000 >
243        <templates>
244            <Template link="station" />
245        </templates>
246        <attached>
247            <DockingTarget name="dockTargetA" />
248            <Dock position="0,0,0" active=true>
249                <animations>
250                    <MoveToDockingTarget target="dockTargetA" />
251                </animations>
252                <effects>
253                    <DockToShip target="newSpaceShip" />
254                </effects>
255                <events>
256                    <execute>
257                        <EventListener event="dockA" />
258                    </execute>
259                </events>
260            </Dock>
261        </attached>
262    </Pawn>
263
264    <!-- EnemyStation -->
265
266    <Pawn name="statB" team=1 radarname="EnemyBase" position="<?lua printC(cEnemyBaseStation1) ?>" direction="<?lua printC(cSpawn) ?>" yaw=45 pitch=-5 roll=-25 initialhealth=10000 maxhealth=10000 >
267        <templates>
268            <Template link="station" />
269        </templates>
270    </Pawn>
271
272    <!-- New SpaceShip as destination of dock A-->
273    <SpaceShip
274            template            = "spaceshipassff"
275            team                = "0"
276            position            = "<?lua printC(cNewShip) ?>"
277            lookat              = "0, 0, 0"
278            health              = "400"
279            initialhealth       = "400"
280            maxhealth           = "1500"
281            shieldhealth        = "80"
282            initialshieldhealth = "80"
283            maxshieldhealth     = "120"
284            shieldabsorption    = "0.8"
285            reloadrate          = "1"
286            reloadwaittime      = "1"
287            name                = "newSpaceShip"
288            radarname           = "ScoutShip" >
289        <attached>
290            <DockingTarget name="newSpaceShip" />
291            <DistanceTriggerBeacon name="newSpaceShip" />
292        </attached>
293    </SpaceShip>
294
295    <!--ELEMENTS -->
296
297    <?lua
298    for i = 1, 64, 1
299    do
300    rBillboard = {math.sin(i*math.pi/32)*radSector, 0, math.cos(i*math.pi/32)*radSector}
301    cBillNow = addC(cSector,rBillboard)
302    ?>
303    <Billboard position="<?lua printC(cBillNow) ?>"  scale=10 material="Flares/lensflare" colour="1,0.2,0.2"/>
304    <?lua end ?>
305
306    <!-- Asteroids you have to fly through to get to the EnemyBase -->
307
308    <?lua
309        dofile("includes/asteroidField.lua")
310       asteroidField(cField1[1], cField1[2], cField1[3], 20, 30, 4500, 500, 0)
311    ?>
312
313    <!-- Other Asteroid-Fields -->
314
315    <?lua
316        dofile("includes/asteroidField.lua")
317       asteroidField(cField2[1], cField2[2], cField2[3], 20, 30, 4500, 500, 0)
318    ?>
319
320    <!-- Planets -->
321
322   <Planet
323        position="<?lua printC(cPlanet1) ?>"
324        scale="3000"
325        collisionType="dynamic"
326        linearDamping="0.8"
327        angularDamping="0"
328        mass="5000000"
329        pitch="0"
330        mesh="planets/muunilinst.mesh"
331        atmosphere="atmosphere1"
332        rotationaxis="1,0,0"
333        rotationrate="1.0"
334        atmospheresize="80.0f"
335        imagesize="1024.0f"
336        collisiondamage=2
337        enablecollisiondamage=true
338              visible=true
339              active=true
340      >
341      <attached>
342        <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
343        </attached>
344          <collisionShapes>
345            <SphereCollisionShape radius="3000" position="0,0,0" />
346      </collisionShapes>
347    </Planet>
348
349    <?lua
350        dofile("includes/asteroidField.lua")
351        asteroidBelt(cPlanet1[1], cPlanet1[2], cPlanet1[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
352    ?>
353
354    <Planet
355        position="<?lua printC(cPlanet2) ?>"
356        scale="2000"
357        collisionType="dynamic"
358        linearDamping="0.8"
359        angularDamping="0"
360        mass="5000000"
361        pitch="0"
362        mesh="planets/ganymede.mesh"
363        atmosphere="atmosphere1"
364        rotationaxis="1,0,0"
365        rotationrate="1.0"
366        atmospheresize="80.0f"
367        imagesize="1024.0f"
368        collisiondamage=2
369        enablecollisiondamage=true
370              visible=true
371              active=true
372      >
373      <attached>
374        <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
375        </attached>
376          <collisionShapes>
377            <SphereCollisionShape radius="2000" position="0,0,0" />
378      </collisionShapes>
379    </Planet>
380
381    <?lua
382        dofile("includes/asteroidField.lua")
383        asteroidBelt(cPlanet2[1], cPlanet2[2], cPlanet2[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
384    ?>
385
386    <!-- EnemyPlanet(s) -->
387
388    <Planet
389        position="<?lua printC(cEnemyBasePlanet) ?>"
390        scale="5000"
391        collisionType="dynamic"
392        linearDamping="0.8"
393        angularDamping="0"
394        mass="5000000"
395        pitch="0"
396        mesh="planets/jupiter.mesh"
397        atmosphere="atmosphere1"
398        rotationaxis="1,0,0"
399        rotationrate="1.0"
400        atmospheresize="80.0f"
401        imagesize="1024.0f"
402        collisiondamage=2
403        enablecollisiondamage=true
404              visible=true
405              active=true
406      >
407      <attached>
408        <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-500" />
409        </attached>
410          <collisionShapes>
411            <SphereCollisionShape radius="5000" position="0,0,0" />
412      </collisionShapes>
413    </Planet>
414
415    <?lua
416      xi = 5
417      zi = 5
418      for k = 1, xi, 1
419      do
420    ?>
421    <?lua
422      for j = 1, zi, 1
423      do
424      x = -2500+k*100
425      z = -4400+j*100
426    ?>
427    <SpaceShip visible=true active=false name="Enemies" radarname="Attacker" position="-11000,<?lua print(z)?>,<?lua print(x)?>" lookat="0,0,0" team=1>
428        <templates>
429            <Template link="spaceshippirate" />
430        </templates>
431    </SpaceShip>
432    <?lua end ?>
433    <?lua end ?>
434
435    <SpaceShip visible=true active=true name="Enemies" radarname="Attacker" position="-2700,-800,-800" lookat="0,0,0" team=1>
436      <templates>
437        <Template link=spaceshippirate />
438      </templates>
439      <controller>
440        <WaypointPatrolController accuracy=40 alertnessradius=100 team=1>
441          <waypoints>
442            <StaticEntity position="-3400,-1200,-200" />
443            <StaticEntity position="-1600,-1000,-200" />
444            <StaticEntity position="-1700,-1400,-940" />
445            <StaticEntity position="-2100,-1200,-1250" />
446            <StaticEntity position="-2700,-800,-800" />
447          </waypoints>
448        </WaypointPatrolController>
449      </controller>
450    </SpaceShip>
451
452    <SpaceShip visible=true active=true name="Enemies" radarname="Attacker" position="-3400,-1200,-200" lookat="0,0,0" team=1>
453      <templates>
454        <Template link=spaceshippirate />
455      </templates>
456      <controller>
457        <WaypointPatrolController accuracy=40 alertnessradius=100 team=1>
458          <waypoints>
459            <StaticEntity position="-1600,-1000,-200" />
460            <StaticEntity position="-1700,-1400,-940" />
461            <StaticEntity position="-2100,-1200,-1250" />
462            <StaticEntity position="-2700,-800,-800" />
463            <StaticEntity position="-3400,-1200,-200" />
464          </waypoints>
465        </WaypointPatrolController>
466      </controller>
467    </SpaceShip>
468
469    <SpaceShip visible=true active=true name="Enemies" radarname="Attacker" position="-1600,-1000,-200" lookat="0,0,0" team=1>
470      <templates>
471        <Template link=spaceshippirate />
472      </templates>
473      <controller>
474        <WaypointPatrolController accuracy=40 alertnessradius=100 team=1>
475          <waypoints>
476            <StaticEntity position="-1700,-1400,-940" />
477            <StaticEntity position="-2100,-1200,-1250" />
478            <StaticEntity position="-2700,-800,-800" />
479            <StaticEntity position="-3400,-1200,-200" />
480            <StaticEntity position="-1600,-1000,-200" />
481          </waypoints>
482        </WaypointPatrolController>
483      </controller>
484    </SpaceShip>
485
486    <SpaceShip visible=true active=true name="Enemies" radarname="Attacker" position="-1700,-1400,-940" lookat="0,0,0" team=1>
487      <templates>
488        <Template link=spaceshippirate />
489      </templates>
490      <controller>
491        <WaypointPatrolController accuracy=40 alertnessradius=100 team=1>
492          <waypoints>
493            <StaticEntity position="-2100,-1200,-1250" />
494            <StaticEntity position="-2700,-800,-800" />
495            <StaticEntity position="-3400,-1200,-200" />
496            <StaticEntity position="-1600,-1000,-200" />
497            <StaticEntity position="-1700,-1400,-940" />
498          </waypoints>
499        </WaypointPatrolController>
500      </controller>
501    </SpaceShip>
502
503    <SpaceShip visible=true active=true name="Enemies" radarname="Attacker" position="-2100,-1200,-1250" lookat="0,0,0" team=1>
504      <templates>
505        <Template link=spaceshippirate />
506      </templates>
507      <controller>
508        <WaypointPatrolController accuracy=40 alertnessradius=100 team=1>
509          <waypoints>
510            <StaticEntity position="-2700,-800,-800" />
511            <StaticEntity position="-3400,-1200,-200" />
512            <StaticEntity position="-1600,-1000,-200" />
513            <StaticEntity position="-1700,-1400,-940" />
514            <StaticEntity position="-2100,-1200,-1250" />
515          </waypoints>
516        </WaypointPatrolController>
517      </controller>
518    </SpaceShip>
519
520
521    </Scene>
522</Level>
Note: See TracBrowser for help on using the repository browser.