Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

removed the other enemystations, as one should be enough, added enemies and fixed their coordinates, too many of them cause performance issues, so just 25 enemies at the moment

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