Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 10883 was 10867, checked in by bhatiab, 9 years ago

Worked on expeditionSector.oxw, added EnemyBase and Enemies, they need to be fixed though…

File size: 13.8 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
48              cStationA = {1400, 400, -800}
49        cNewShip = {1000, 250, -350}
50
51              cPlanet1 = {-9000, -8000, 14000}
52              cPlanet2 = {12000, -1500, -10000}
53
54        cEnemyBasePlanet = {-20000, -5500, -8000}
55
56        cEnemyBaseStation1 = {-15000, -5000, -4000}
57        --[[
58        cEnemyBaseStation2 = {-16000, -5500, -4000}
59        cEnemyBaseStation3 = {-14000, -4500, -4000}
60        ]]--
61
62              cField1 = {-5000, -4000, -3000}
63              cField2 = {4000, 2000, 4500}
64
65        --[[ Function to print Coordinates. Quotes not included! ]]--
66        function printC(coord)
67          print(coord[1] .. [[,]] .. coord[2] .. [[,]] .. coord[3])
68        end
69    ?>
70
71    <Scene
72        ambientlight = "0.8, 0.8, 0.8"
73        skybox = "Orxonox/skyBoxMoreNebula"
74        hasPhysics = true
75    >
76
77    <SpawnPoint name="playerSpawn" team=0 position="<?lua printC(cSpawn) ?>" lookat="<?lua printC(cCenter) ?>" spawnclass=SpaceShip pawndesign=spaceshipescort />
78
79    <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" />
80
81    <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"/>
82
83    <!--QUEST DEFINITIONS-->
84
85    <GlobalQuest id="quest1">
86        <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="" />
87        <hints>
88        </hints>
89        <complete-effects>
90            <AddQuest questId="quest2" />
91        </complete-effects>
92    </GlobalQuest>
93
94    <!--EVENTS AND TRIGGERS
95        Usable events and triggers:
96        spawntrigger
97    -->
98
99    <EventMultiTrigger name="spawntrigger">
100        <events>
101            <trigger>
102                <EventListener event="playerSpawn" />
103            </trigger>
104        </events>
105    </EventMultiTrigger>
106
107    <!--TODO: Complete the DistanceTriggers for completing/succeeding correctly! -->
108
109    <DistanceTrigger active=false name="missionComplete" position="2000,0,0" distance=100 target="SpaceShip" stayactive=true>
110        <events>
111            <activity>
112                <EventListener event="missionCompletePrereq" />
113            </activity>
114        </events>
115    </DistanceTrigger>
116
117    <Script code="Mission endMission true" onLoad="false">
118        <events>
119            <trigger>
120                <EventListener event="missionComplete" />
121            </trigger>
122        </events>
123    </Script>
124
125    <DistanceTrigger active=false name="missionFailed" position="2000,0,0" distance=100 target="SpaceShip" stayactive=true>
126        <events>
127            <activity>
128                <EventListener event="missionFailedPrereq" />
129            </activity>
130        </events>
131    </DistanceTrigger>
132
133    <Script code="Mission endMission fail" onLoad="false">
134        <events>
135            <trigger>
136                <EventListener event="failMission" />
137            </trigger>
138        </events>
139    </Script>
140
141    <!--QUEST EFFECT BEACONS -->
142
143    <QuestEffectBeacon times=1>
144        <effects>
145            <AddQuest questId="quest1" />
146        </effects>
147        <events>
148            <execute>
149                <EventListener event="spawntrigger" />
150            </execute>
151        </events>
152    </QuestEffectBeacon>
153
154    <!--NOTIFICATIONS -->
155
156    <SimpleNotification broadcast="true" message="Welcome, Commander.">
157        <events>
158            <trigger>
159                <EventTrigger stayactive="true" delay=4 >
160                   <events>
161                      <trigger>
162                         <EventListener event="spawntrigger" />
163                      </trigger>
164                   </events>
165                </EventTrigger>
166            </trigger>
167        </events>
168    </SimpleNotification>
169
170    <SimpleNotification broadcast="true" message="Please check your quests!">
171        <events>
172            <trigger>
173                <EventTrigger stayactive="true" delay=7 >
174                   <events>
175                      <trigger>
176                         <EventListener event="spawntrigger" />
177                      </trigger>
178                   </events>
179                </EventTrigger>
180            </trigger>
181        </events>
182    </SimpleNotification>
183
184    <!--STATIONS -->
185
186    <Template name="station">
187        <Pawn mass=10000000 collisionType=dynamic friction=0.01>
188            <attached>
189                <Model mesh="HydroHarvester.mesh" position="0,0,0" scale=50 />
190                <DistanceTriggerBeacon name="NPC" />
191            </attached>
192            <collisionShapes>
193                <BoxCollisionShape  position="-560,0,0" halfExtents="115,100,245" /><!-- Three lower boxes -->
194                <BoxCollisionShape  position="290,0,-480" halfExtents="115,100,245" yaw=-120 />
195                <BoxCollisionShape  position="290,0,480" halfExtents="115,100,245" yaw=-240 />
196                <BoxCollisionShape  position="-280,0,0" halfExtents="163,50,50" /><!-- Three lower connections -->
197                <BoxCollisionShape  position="140,0,-240" halfExtents="163,50,50" yaw=-120 />
198                <BoxCollisionShape  position="140,0,240" halfExtents="163,50,50" yaw=-240 />
199                <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" /><!-- Upper Tower -->
200                <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" yaw=-120 />
201                <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" yaw=-240 />
202                <BoxCollisionShape  position="0,400,0" halfExtents="43,110,26" yaw=-30 /><!-- Middle one-->
203                <BoxCollisionShape  position="-200,100,0" halfExtents="26,50,43" /><!--Three lower legs -->
204                <BoxCollisionShape  position="100,100,-173" halfExtents="43,50,26" yaw=-30 />
205                <BoxCollisionShape  position="100,100,-173" halfExtents="43,50,26" yaw=30 />
206                <BoxCollisionShape  position="-100,264,0" halfExtents="26,105,43" roll=-49 /><!--Three upper legs -->
207                <BoxCollisionShape  position="50,264,-87" halfExtents="26,105,43" roll=-49 yaw=-120 />
208                <BoxCollisionShape  position="50,264,87" halfExtents="26,105,43" roll=-49 yaw=-240 />
209            </collisionShapes>
210        </Pawn>
211    </Template>
212
213    <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 >
214        <templates>
215            <Template link="station" />
216        </templates>
217        <attached>
218            <DockingTarget name="dockTargetA" />
219            <Dock position="0,0,0" active=true>
220                <animations>
221                    <MoveToDockingTarget target="dockTargetA" />
222                </animations>
223                <effects>
224                    <DockToShip target="newSpaceShip" />
225                </effects>
226                <events>
227                    <execute>
228                        <EventListener event="dockA" />
229                    </execute>
230                </events>
231            </Dock>
232        </attached>
233    </Pawn>
234
235    <!-- EnemyStation -->
236
237    <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 >
238        <templates>
239            <Template link="station" />
240        </templates>
241    </Pawn>
242
243    <!--TODO: The Other Stations are flying away...
244
245    <Pawn name="statB" team=1 radarname="EnemyBase" position="<?lua printC(cEnemyBaseStation2) ?>" direction="<?lua printC(cSpawn) ?>" yaw=45 pitch=-5 roll=-25 initialhealth=10000 maxhealth=10000 >
246        <templates>
247            <Template link="station" />
248        </templates>
249    </Pawn>
250
251    <Pawn name="statB" team=1 radarname="EnemyBase" position="<?lua printC(cEnemyBaseStation3) ?>" direction="<?lua printC(cSpawn) ?>" yaw=45 pitch=-5 roll=-25 initialhealth=10000 maxhealth=10000 >
252        <templates>
253            <Template link="station" />
254        </templates>
255    </Pawn>
256
257  -->
258
259    <!-- New SpaceShip as destination of dock A-->
260    <SpaceShip
261            template            = "spaceshipassff"
262            team                = "0"
263            position            = "<?lua printC(cNewShip) ?>"
264            lookat              = "0, 0, 0"
265            health              = "400"
266            initialhealth       = "400"
267            maxhealth           = "1500"
268            shieldhealth        = "80"
269            initialshieldhealth = "80"
270            maxshieldhealth     = "120"
271            shieldabsorption    = "0.8"
272            reloadrate          = "1"
273            reloadwaittime      = "1"
274            name                = "newSpaceShip"
275            radarname           = "ScoutShip" >
276        <attached>
277            <DockingTarget name="newSpaceShip" />
278            <DistanceTriggerBeacon name="newSpaceShip" />
279        </attached>
280    </SpaceShip>
281
282    <!--ELEMENTS -->
283
284    <!-- Asteroids you have to fly through to get to the EnemyBase -->
285
286    <?lua
287        dofile("includes/asteroidField.lua")
288       asteroidField(cField1[1], cField1[2], cField1[3], 20, 30, 4500, 500, 0)
289    ?>
290
291    <!-- Other Asteroid-Fields -->
292
293    <?lua
294        dofile("includes/asteroidField.lua")
295       asteroidField(cField2[1], cField2[2], cField2[3], 20, 30, 4500, 500, 0)
296    ?>
297
298    <!-- Planets -->
299
300   <Planet
301        position="<?lua printC(cPlanet1) ?>"
302        scale="3000"
303        collisionType="dynamic"
304        linearDamping="0.8"
305        angularDamping="0"
306        mass="5000000"
307        pitch="0"
308        mesh="planets/muunilinst.mesh"
309        atmosphere="atmosphere1"
310        rotationaxis="1,0,0"
311        rotationrate="1.0"
312        atmospheresize="80.0f"
313        imagesize="1024.0f"
314        collisiondamage=2
315        enablecollisiondamage=true
316              visible=true
317              active=true
318      >
319      <attached>
320        <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
321        </attached>
322          <collisionShapes>
323            <SphereCollisionShape radius="3000" position="0,0,0" />
324      </collisionShapes>
325    </Planet>
326
327    <?lua
328        dofile("includes/asteroidField.lua")
329        asteroidBelt(cPlanet1[1], cPlanet1[2], cPlanet1[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
330    ?>
331
332    <Planet
333        position="<?lua printC(cPlanet2) ?>"
334        scale="2000"
335        collisionType="dynamic"
336        linearDamping="0.8"
337        angularDamping="0"
338        mass="5000000"
339        pitch="0"
340        mesh="planets/ganymede.mesh"
341        atmosphere="atmosphere1"
342        rotationaxis="1,0,0"
343        rotationrate="1.0"
344        atmospheresize="80.0f"
345        imagesize="1024.0f"
346        collisiondamage=2
347        enablecollisiondamage=true
348              visible=true
349              active=true
350      >
351      <attached>
352        <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
353        </attached>
354          <collisionShapes>
355            <SphereCollisionShape radius="2000" position="0,0,0" />
356      </collisionShapes>
357    </Planet>
358
359    <?lua
360        dofile("includes/asteroidField.lua")
361        asteroidBelt(cPlanet2[1], cPlanet2[2], cPlanet2[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
362    ?>
363
364    <!-- EnemyPlanet(s) -->
365
366    <Planet
367        position="<?lua printC(cEnemyBasePlanet) ?>"
368        scale="5000"
369        collisionType="dynamic"
370        linearDamping="0.8"
371        angularDamping="0"
372        mass="5000000"
373        pitch="0"
374        mesh="planets/jupiter.mesh"
375        atmosphere="atmosphere1"
376        rotationaxis="1,0,0"
377        rotationrate="1.0"
378        atmospheresize="80.0f"
379        imagesize="1024.0f"
380        collisiondamage=2
381        enablecollisiondamage=true
382              visible=true
383              active=true
384      >
385      <attached>
386        <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-500" />
387        </attached>
388          <collisionShapes>
389            <SphereCollisionShape radius="5000" position="0,0,0" />
390      </collisionShapes>
391    </Planet>
392
393    <!--TODO: Fix Enemies and their coordinates
394
395    <?lua
396      rows = 10
397      colomns = 10
398      for k = 1, rows, 1
399      do
400    ?>
401    <?lua
402      for i = 1, colomns, 1
403      do
404      x = -10000+k*100
405      y = -5000+i*100
406    ?>
407    <SpaceShip visible=false active=false name="Enemies" radarname="Attacker" position="<?lua print(y)?>,-4000,<?lua print(x)?>" lookat="0,0,0" team=1>
408        <templates>
409            <Template link="spaceshippirate" />
410        </templates>
411    </SpaceShip>
412    <?lua end ?>
413    <?lua end ?>
414  -->
415
416    </Scene>
417</Level>
Note: See TracBrowser for help on using the repository browser.