Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

Added Waypoints for enemies

File size: 15.2 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 alien radio activity, you are asked to dock into the station, and change into the faster spaceship,[Quest: Dock to station, Event: when docked, change spaceship as in the main level! This triggers the next quest to fly in to the sector] after that
107        [Quest: fly to sector] go into the sector 5c [Event: when in range, Planet becomes visible, an enemy base station, as well es the enmies, around 25 of them], you want to warn your commander, but 5 of the patroling enemies discover[WAYPOINT-Controlled Enemies] you so they hund and try to kill you [Quest: destroy the Aliens who want to hunt you, and escape, Event: 5 of the enemies are hunting you]
108        [Quest: Triggerd after all 5 enemies are dead, if you die, you fail the mission! AFter destroying the enemies, go to your base and report what you have discovered!]
109    -->
110
111    <EventMultiTrigger name="spawntrigger">
112        <events>
113            <trigger>
114                <EventListener event="playerSpawn" />
115            </trigger>
116        </events>
117    </EventMultiTrigger>
118
119    <!--TODO: Complete the DistanceTriggers for completing/succeeding correctly! -->
120
121    <DistanceTrigger active=false name="missionComplete" position="2000,0,0" distance=100 target="SpaceShip" stayactive=true>
122        <events>
123            <activity>
124                <EventListener event="missionCompletePrereq" />
125            </activity>
126        </events>
127    </DistanceTrigger>
128
129    <Script code="Mission endMission true" onLoad="false">
130        <events>
131            <trigger>
132                <EventListener event="missionComplete" />
133            </trigger>
134        </events>
135    </Script>
136
137    <DistanceTrigger active=false name="missionFailed" position="2000,0,0" distance=100 target="SpaceShip" stayactive=true>
138        <events>
139            <activity>
140                <EventListener event="missionFailedPrereq" />
141            </activity>
142        </events>
143    </DistanceTrigger>
144
145    <Script code="Mission endMission fail" onLoad="false">
146        <events>
147            <trigger>
148                <EventListener event="failMission" />
149            </trigger>
150        </events>
151    </Script>
152
153    <!--QUEST EFFECT BEACONS -->
154
155    <QuestEffectBeacon times=1>
156        <effects>
157            <AddQuest questId="quest1" />
158        </effects>
159        <events>
160            <execute>
161                <EventListener event="spawntrigger" />
162            </execute>
163        </events>
164    </QuestEffectBeacon>
165
166    <!--NOTIFICATIONS -->
167
168    <SimpleNotification broadcast="true" message="Welcome, Commander.">
169        <events>
170            <trigger>
171                <EventTrigger stayactive="true" delay=4 >
172                   <events>
173                      <trigger>
174                         <EventListener event="spawntrigger" />
175                      </trigger>
176                   </events>
177                </EventTrigger>
178            </trigger>
179        </events>
180    </SimpleNotification>
181
182    <SimpleNotification broadcast="true" message="Please check your quests!">
183        <events>
184            <trigger>
185                <EventTrigger stayactive="true" delay=7 >
186                   <events>
187                      <trigger>
188                         <EventListener event="spawntrigger" />
189                      </trigger>
190                   </events>
191                </EventTrigger>
192            </trigger>
193        </events>
194    </SimpleNotification>
195
196    <!--STATIONS -->
197
198    <Template name="station">
199        <Pawn mass=10000000 collisionType=dynamic friction=0.01>
200            <attached>
201                <Model mesh="HydroHarvester.mesh" position="0,0,0" scale=50 />
202                <DistanceTriggerBeacon name="NPC" />
203            </attached>
204            <collisionShapes>
205                <BoxCollisionShape  position="-560,0,0" halfExtents="115,100,245" /><!-- Three lower boxes -->
206                <BoxCollisionShape  position="290,0,-480" halfExtents="115,100,245" yaw=-120 />
207                <BoxCollisionShape  position="290,0,480" halfExtents="115,100,245" yaw=-240 />
208                <BoxCollisionShape  position="-280,0,0" halfExtents="163,50,50" /><!-- Three lower connections -->
209                <BoxCollisionShape  position="140,0,-240" halfExtents="163,50,50" yaw=-120 />
210                <BoxCollisionShape  position="140,0,240" halfExtents="163,50,50" yaw=-240 />
211                <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" /><!-- Upper Tower -->
212                <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" yaw=-120 />
213                <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" yaw=-240 />
214                <BoxCollisionShape  position="0,400,0" halfExtents="43,110,26" yaw=-30 /><!-- Middle one-->
215                <BoxCollisionShape  position="-200,100,0" halfExtents="26,50,43" /><!--Three lower legs -->
216                <BoxCollisionShape  position="100,100,-173" halfExtents="43,50,26" yaw=-30 />
217                <BoxCollisionShape  position="100,100,-173" halfExtents="43,50,26" yaw=30 />
218                <BoxCollisionShape  position="-100,264,0" halfExtents="26,105,43" roll=-49 /><!--Three upper legs -->
219                <BoxCollisionShape  position="50,264,-87" halfExtents="26,105,43" roll=-49 yaw=-120 />
220                <BoxCollisionShape  position="50,264,87" halfExtents="26,105,43" roll=-49 yaw=-240 />
221            </collisionShapes>
222        </Pawn>
223    </Template>
224
225    <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 >
226        <templates>
227            <Template link="station" />
228        </templates>
229        <attached>
230            <DockingTarget name="dockTargetA" />
231            <Dock position="0,0,0" active=true>
232                <animations>
233                    <MoveToDockingTarget target="dockTargetA" />
234                </animations>
235                <effects>
236                    <DockToShip target="newSpaceShip" />
237                </effects>
238                <events>
239                    <execute>
240                        <EventListener event="dockA" />
241                    </execute>
242                </events>
243            </Dock>
244        </attached>
245    </Pawn>
246
247    <!-- EnemyStation -->
248
249    <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 >
250        <templates>
251            <Template link="station" />
252        </templates>
253    </Pawn>
254
255    <!-- New SpaceShip as destination of dock A-->
256    <SpaceShip
257            template            = "spaceshipassff"
258            team                = "0"
259            position            = "<?lua printC(cNewShip) ?>"
260            lookat              = "0, 0, 0"
261            health              = "400"
262            initialhealth       = "400"
263            maxhealth           = "1500"
264            shieldhealth        = "80"
265            initialshieldhealth = "80"
266            maxshieldhealth     = "120"
267            shieldabsorption    = "0.8"
268            reloadrate          = "1"
269            reloadwaittime      = "1"
270            name                = "newSpaceShip"
271            radarname           = "ScoutShip" >
272        <attached>
273            <DockingTarget name="newSpaceShip" />
274            <DistanceTriggerBeacon name="newSpaceShip" />
275        </attached>
276    </SpaceShip>
277
278    <!--ELEMENTS -->
279
280    <?lua
281    for i = 1, 64, 1
282    do
283    rBillboard = {math.sin(i*math.pi/32)*radSector, 0, math.cos(i*math.pi/32)*radSector}
284    cBillNow = addC(cSector,rBillboard)
285    ?>
286    <Billboard position="<?lua printC(cBillNow) ?>"  scale=10 material="Flares/lensflare" colour="1,0.2,0.2"/>
287    <?lua end ?>
288
289    <!-- Asteroids you have to fly through to get to the EnemyBase -->
290
291    <?lua
292        dofile("includes/asteroidField.lua")
293       asteroidField(cField1[1], cField1[2], cField1[3], 20, 30, 4500, 500, 0)
294    ?>
295
296    <!-- Other Asteroid-Fields -->
297
298    <?lua
299        dofile("includes/asteroidField.lua")
300       asteroidField(cField2[1], cField2[2], cField2[3], 20, 30, 4500, 500, 0)
301    ?>
302
303    <!-- Planets -->
304
305   <Planet
306        position="<?lua printC(cPlanet1) ?>"
307        scale="3000"
308        collisionType="dynamic"
309        linearDamping="0.8"
310        angularDamping="0"
311        mass="5000000"
312        pitch="0"
313        mesh="planets/muunilinst.mesh"
314        atmosphere="atmosphere1"
315        rotationaxis="1,0,0"
316        rotationrate="1.0"
317        atmospheresize="80.0f"
318        imagesize="1024.0f"
319        collisiondamage=2
320        enablecollisiondamage=true
321              visible=true
322              active=true
323      >
324      <attached>
325        <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
326        </attached>
327          <collisionShapes>
328            <SphereCollisionShape radius="3000" position="0,0,0" />
329      </collisionShapes>
330    </Planet>
331
332    <?lua
333        dofile("includes/asteroidField.lua")
334        asteroidBelt(cPlanet1[1], cPlanet1[2], cPlanet1[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
335    ?>
336
337    <Planet
338        position="<?lua printC(cPlanet2) ?>"
339        scale="2000"
340        collisionType="dynamic"
341        linearDamping="0.8"
342        angularDamping="0"
343        mass="5000000"
344        pitch="0"
345        mesh="planets/ganymede.mesh"
346        atmosphere="atmosphere1"
347        rotationaxis="1,0,0"
348        rotationrate="1.0"
349        atmospheresize="80.0f"
350        imagesize="1024.0f"
351        collisiondamage=2
352        enablecollisiondamage=true
353              visible=true
354              active=true
355      >
356      <attached>
357        <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
358        </attached>
359          <collisionShapes>
360            <SphereCollisionShape radius="2000" position="0,0,0" />
361      </collisionShapes>
362    </Planet>
363
364    <?lua
365        dofile("includes/asteroidField.lua")
366        asteroidBelt(cPlanet2[1], cPlanet2[2], cPlanet2[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
367    ?>
368
369    <!-- EnemyPlanet(s) -->
370
371    <Planet
372        position="<?lua printC(cEnemyBasePlanet) ?>"
373        scale="5000"
374        collisionType="dynamic"
375        linearDamping="0.8"
376        angularDamping="0"
377        mass="5000000"
378        pitch="0"
379        mesh="planets/jupiter.mesh"
380        atmosphere="atmosphere1"
381        rotationaxis="1,0,0"
382        rotationrate="1.0"
383        atmospheresize="80.0f"
384        imagesize="1024.0f"
385        collisiondamage=2
386        enablecollisiondamage=true
387              visible=true
388              active=true
389      >
390      <attached>
391        <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-500" />
392        </attached>
393          <collisionShapes>
394            <SphereCollisionShape radius="5000" position="0,0,0" />
395      </collisionShapes>
396    </Planet>
397
398    <?lua
399      xi = 5
400      zi = 5
401      for k = 1, xi, 1
402      do
403    ?>
404    <?lua
405      for j = 1, zi, 1
406      do
407      x = -2500+k*100
408      z = -4400+j*100
409    ?>
410    <SpaceShip visible=true active=false name="Enemies" radarname="Attacker" position="-11000,<?lua print(z)?>,<?lua print(x)?>" lookat="0,0,0" team=1>
411        <templates>
412            <Template link="spaceshippirate" />
413        </templates>
414    </SpaceShip>
415    <?lua end ?>
416    <?lua end ?>
417
418    <SpaceShip visible=true active=true name="Enemies" radarname="Attacker" position="-2700,-800,-800" lookat="0,0,0" team=1>
419    <templates>
420        <Template link=spaceshipescort />
421    </templates>
422    <controller>
423      <WaypointController accuracy=10 team=3>
424        <waypoints>
425            <Model mesh="cube.mesh" scale=8 position="-2700,-800,-800" />
426            <Model mesh="cube.mesh" scale=8 position="-3400,-1200,-200" />
427            <Model mesh="cube.mesh" scale=8 position="-1600,-1000,-200" />
428            <Model mesh="cube.mesh" scale=8 position="-2000,-1600,-1700" />
429            <StaticEntity position="-2700,-800,-800" />
430        </waypoints>
431      </WaypointController>
432    </controller>
433</SpaceShip>
434
435
436    </Scene>
437</Level>
Note: See TracBrowser for help on using the repository browser.