Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/ProtectBoss_HS17/data/levels/ProtectBoss.oxw @ 11639

Last change on this file since 11639 was 11639, checked in by lrigoni, 7 years ago

Changes of 4.12.2017

File size: 19.3 KB
Line 
1<LevelInfo
2 name = "ProtectBoss"
3 description = "Protect a disabled cargo ship!"
4 tags = "test, mission"
5 screenshot = "emptylevel.png"
6/>
7
8
9<?lua
10  include("stats.oxo")
11  include("HUDTemplates3.oxo")
12  include("templates/lodInformation.oxt")
13  include("templates/HeavyCruiser.oxt")
14  include("HUDPickupTemplate.oxo")
15  include("templates/pickupRepresentationTemplates.oxt")
16?>
17
18<?lua
19  include("templates/spaceshipEscort.oxt")
20  include("templates/spaceshipAssff.oxt")
21  include("templates/endurancetest_template.oxt")
22  include("templates/spaceshipPirate.oxt")
23?>
24
25<Level gametype="Mission">
26  <templates>
27    <Template link=lodtemplate_default />
28  </templates>
29  <?lua include("includes/notifications.oxi") ?>
30
31  <NotificationQueueCEGUI
32    name="narrative"
33    targets="simpleNotification"
34    size=3
35    displayTime=7
36    position="0.2, 0, 0.1, 0"
37    fontSize="16"
38    fontColor="0.3, 1, 0.2, 0.8"
39    alignment="HorzCentred"
40    displaySize="0.6, 0, 0, 0"
41  />
42
43  <Scene
44    ambientlight = "0.8, 0.8, 0.8"
45    skybox       = "Orxonox/Starbox"
46  >
47
48    <?lua
49      include("includes/pickups.oxi")
50    ?>
51
52    <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" /> <!-- AlphaCentauri.ogg, Mars.ogg-->
53
54    <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"/>
55
56    <EventMultiTrigger name=spawntrigger>
57      <events>
58        <trigger>
59          <SpawnPoint team=0 position="0,0,1" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
60        </trigger>
61      </events>
62    </EventMultiTrigger>
63   
64    <Pawn
65        team      = 0
66        collisionType = kinematic
67        enablecollisiondamage=true
68        collisiondamage = 10
69        position  = "0,0,-2500"
70        mass      = 100000
71        health    = 100 initialhealth=100 maxhealth="100"
72        direction = "1,0,0"
73        rotationaxis="0,0,1" rotationrate="4.5" velocity="0,0,30"
74        vulnerable=true
75        name      = "CargoShip"
76        radarname = "Cargo Ship" >
77      <attached>
78        <DistanceTriggerBeacon name="CargoShip" />
79        <Model mesh="escortShip.mesh" mass=10000 position="0,0,0" scale=100 />
80      </attached>
81      <collisionShapes>
82        <BoxCollisionShape position="0,0,0" halfExtents="300,100,200" /> <!-- laenge  ,   dicke    , breite -->
83        <BoxCollisionShape position="-100,-50,-280" halfExtents="220,70,100" />
84        <BoxCollisionShape position="-100,-50,280" halfExtents="220,70,100" />
85      </collisionShapes>
86      <explosion>
87        <ExplosionPart scale = 12 minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
88        <ExplosionPart scale = 12 minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
89        <ExplosionPart scale = 12 minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
90        <ExplosionPart offset="94,33,-50" delay=1 minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
91        <ExplosionPart offset="94,33,-50" delay=1 minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
92        <ExplosionPart offset="94,33,-50" delay=1 minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
93   
94        <ExplosionPart scale = 5 mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
95        <ExplosionPart scale = 5 mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
96        <ExplosionPart scale = 5 mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
97        <ExplosionPart scale = 5 mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
98        <ExplosionPart scale = 5 mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
99        <ExplosionPart scale = 5 mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
100        <ExplosionPart scale = 5 mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
101        <ExplosionPart scale = 5 mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
102        <ExplosionPart delay=0.8 scale = 2.5 mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
103        <ExplosionPart delay=0.8 scale = 2.5 mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
104        <ExplosionPart delay=0.8 scale = 2.5 mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
105        <ExplosionPart delay=0.8 scale = 2.5 mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
106       
107        <ExplosionPart offset="20,13,-15" scale=7 delay=1.3 minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
108        <ExplosionPart offset="30,13,-15" scale=7 delay=1.3 minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
109        <ExplosionPart offset="20,13,-15" scale=7 delay=1.3 minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
110        <ExplosionPart offset="-20,-13,-15" scale=5 delay=1.8 minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
111        <ExplosionPart offset="-20,-13,-15" scale=5 delay=1.8 minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
112        <ExplosionPart offset="-20,-13,-15" scale=5 delay=1.8 minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
113      </explosion>
114    </Pawn>
115
116    <!-- triggers when first quest is completed -->
117    <DistanceTrigger name="passedAsteroidFieldOne" beaconMode=identify position="0,0,3000" distance=1000 target="Pawn" targetname="CargoShip" />
118
119    <!-- triggers when first pirate wave is defeated -->
120
121    <Trigger name="firstPirateWaveKilled" mode="and">
122      <?lua
123        for n = 1, 3, 1 do
124          print("<EventTrigger activations=1 stayactive=true><events><trigger><EventListener event=p" .. n .. "/></trigger></events></EventTrigger>")
125        end
126      ?>
127      <!--EventTrigger activations="1" stayactive="true" >
128        <events>
129          <trigger>
130             <EventListener event="p1" />
131          </trigger>
132        </events>
133      </EventTrigger>
134      <EventTrigger activations="1" stayactive="true" >
135        <events>
136          <trigger>
137             <EventListener event="p2" />
138          </trigger>
139        </events>
140      </EventTrigger>
141      <EventTrigger activations="1" stayactive="true" >
142        <events>
143          <trigger>
144             <EventListener event="p3" />
145          </trigger>
146        </events>
147      </EventTrigger-->
148    </Trigger>
149
150    <!-- triggers when second pirate wave is defeated -->
151    <Trigger name="secondPirateWaveKilled" mode="and">
152      <?lua
153        for n = 1, 6, 1 do
154          print("<EventTrigger activations=1 stayactive=true><events><trigger><EventListener event=p1" .. n .. "/></trigger></events></EventTrigger>")
155        end
156      ?>
157      <!--EventTrigger activations="1" stayactive="true" >
158        <events>
159          <trigger>
160             <EventListener event="p11" />
161          </trigger>
162        </events>
163      </EventTrigger>
164      <EventTrigger activations="1" stayactive="true" >
165        <events>
166          <trigger>
167             <EventListener event="p12" />
168          </trigger>
169        </events>
170      </EventTrigger>
171      <EventTrigger activations="1" stayactive="true" >
172        <events>
173          <trigger>
174             <EventListener event="p13" />
175          </trigger>
176        </events>
177      </EventTrigger>
178      <EventTrigger activations="1" stayactive="true" >
179        <events>
180          <trigger>
181             <EventListener event="p14" />
182          </trigger>
183        </events>
184      </EventTrigger>
185      <EventTrigger activations="1" stayactive="true" >
186        <events>
187          <trigger>
188             <EventListener event="p15" />
189          </trigger>
190        </events>
191      </EventTrigger>
192      <EventTrigger activations="1" stayactive="true" >
193        <events>
194          <trigger>
195             <EventListener event="p16" />
196          </trigger>
197        </events>
198      </EventTrigger-->
199    </Trigger>
200
201    <!-- triggers some time after the second pirate wave was defeated -->
202    <Trigger name="thirdPirateWaveStarting" delay=15>
203      <EventTrigger activations="1" stayactive="true" >
204        <events>
205          <trigger>
206             <EventListener event="secondPirateWaveKilled" />
207          </trigger>
208        </events>
209      </EventTrigger>
210    </Trigger>
211
212    <!-- triggers when third pirate wave is defeated -->
213    <Trigger name="thirdPirateWaveKilled" mode="and" delay=5>
214      <?lua
215        for n = 1, 7, 1 do
216          print("<EventTrigger activations=1 stayactive=true><events><trigger><EventListener event=p2" .. n .. "/></trigger></events></EventTrigger>")
217        end
218      ?>
219      <!--EventTrigger activations="1" stayactive="true" >
220        <events>
221          <trigger>
222             <EventListener event="p21" />
223          </trigger>
224        </events>
225      </EventTrigger>
226      <EventTrigger activations="1" stayactive="true" >
227        <events>
228          <trigger>
229             <EventListener event="p22" />
230          </trigger>
231        </events>
232      </EventTrigger>
233      <EventTrigger activations="1" stayactive="true" >
234        <events>
235          <trigger>
236             <EventListener event="p23" />
237          </trigger>
238        </events>
239      </EventTrigger>
240      <EventTrigger activations="1" stayactive="true" >
241        <events>
242          <trigger>
243             <EventListener event="p24" />
244          </trigger>
245        </events>
246      </EventTrigger>
247      <EventTrigger activations="1" stayactive="true" >
248        <events>
249          <trigger>
250             <EventListener event="p25" />
251          </trigger>
252        </events>
253      </EventTrigger>
254      <EventTrigger activations="1" stayactive="true" >
255        <events>
256          <trigger>
257             <EventListener event="p26" />
258          </trigger>
259        </events>
260      </EventTrigger>
261      <EventTrigger activations="1" stayactive="true" >
262        <events>
263          <trigger>
264             <EventListener event="p27" />
265          </trigger>
266        </events>
267      </EventTrigger-->
268    </Trigger>
269
270    <Trigger name="succeedMission" delay=7>
271      <EventTrigger activations="1" stayactive="true" >
272        <events>
273          <trigger>
274             <EventListener event="thirdPirateWaveKilled" />
275          </trigger>
276        </events>
277      </EventTrigger>
278    </Trigger>
279
280      <EventTrigger activations="1" stayactive="true" name="failMission" delay=0.1>
281        <events>
282          <trigger>
283             <EventListener event="CargoShip" />
284          </trigger>
285        </events>
286      </EventTrigger>
287
288    <!-- create asteroids and pickups -->
289    <?lua
290      function asteroidMesh()
291        x = math.random(8)
292        if x < 7 then
293          return "ast" .. x .. ".mesh"
294        elseif x == 7 then
295          return "asteroid_ice.mesh"
296        else
297          return "asteroid_UV.mesh"
298        end
299      end
300
301      for count = 1, 30, 1 do
302        x = math.random(-1000, 1000)
303        y = math.random(-1000, 1000)
304        z = 125 * count + math.random(-250, 250)
305        vmax = 7
306        rx = math.random(-vmax, vmax)
307        ry = math.random(-vmax, vmax)
308        rz = math.random(-vmax, vmax)
309        vx = math.random(-vmax, vmax)
310        vy = math.random(-vmax, vmax)
311        vz = math.random(-vmax, vmax)
312        rr = math.random() * 10
313        print("<ShootableObstacle team=1 enablecollisiondamage=true collisiondamage=10 health=100 maxhealth=100 initialhealth=100 position=\"" .. x .. "," .. y .. "," .. z .. "\" direction=\"0,0,-1\" velocity=\"" .. vx .. "," .. vy .. "," .. vz .. "\"rotationaxis=\"" .. rx .. "," .. ry .. "," .. rz .. "\" rotationrate=" .. rr .. " collisionType=dynamic mass=1 name=asteroid radarname=Asteroid> <attached> <Model position=\"0,0,0\" mesh=\"" .. asteroidMesh() .. "\" scale3D=\"10,10,10\" /> </attached> <collisionShapes> <SphereCollisionShape position=\"0,0,0\" radius=5 /> </collisionShapes> <controller> <WaypointController team=1> </WaypointController> </controller> <explosion> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_flash2\" effect2=\"orxonox/explosion_flame2\" /> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_shockwave2\" effect2=\"orxonox/explosion_sparks2\" /> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_streak2\" effect2=\"orxonox/explosion_afterglow\" /> </explosion> </ShootableObstacle>")
314      end
315
316      for count = 1, 50, 1 do
317        x = math.random(-1000, 1000)
318        y = math.random(-1000, 1000)
319        z = 125 * count + math.random(-250, 250)
320        typenum = math.random(11)
321        type = ""
322        if typenum == 1 then
323          type = "smallmunition"
324        elseif typenum == 2 then
325          type = "mediummunition"
326        elseif typenum == 3 then
327          type = "hugemunition"
328        elseif typenum == 4 then
329          type = "smallhealth"
330        elseif typenum == 5 then
331          type = "mediumhealth"
332        elseif typenum == 6 then
333          type = "hugehealth"
334        elseif typenum == 7 then
335          type = "crazyhealth"
336        elseif typenum == 8 then
337          type = "smallshield"
338        elseif typenum == 9 then
339          type = "mediumshield"
340        elseif typenum == 10 then
341          type = "hugeshield"
342        else
343          type = "drone"
344        end
345        type = type .. "pickup"
346        print("<PickupSpawner pickup=\"" .. type .. "\" position=\"" .. x .. "," .. y .. "," .. z .. "\" triggerDistance=10 respawnTime=5 maxSpawnedItems=1 />")
347      end
348    ?>
349
350    <!-- start first quest -->
351    <QuestEffectBeacon times=1>
352      <effects>
353        <AddQuest questId="ProtectBoss.AsteroidField" />
354      </effects>
355      <events>
356        <execute>
357          <EventListener event=spawntrigger />
358        </execute>
359      </events>
360    </QuestEffectBeacon>
361
362    <!-- start second quest (doesn't work yet) -->
363    <QuestEffectBeacon times=1>
364      <effects>
365        <CompleteQuest questId="ProtectBoss.AsteroidField" />
366        <!--AddQuest questId="ProtectBoss.PirateAttack" /-->
367      </effects>
368      <events>
369        <execute>
370          <EventListener event=passedAsteroidFieldOne />
371        </execute>
372      </events>
373    </QuestEffectBeacon>
374
375    <SimpleNotification message="Protect the cargo ship! (Info: F3)" broadcast="true">
376        <events>
377            <trigger>
378                <EventListener event=spawntrigger />
379            </trigger>
380        </events>
381    </SimpleNotification>
382
383    <LocalQuest id="ProtectBoss.AsteroidField">
384        <QuestDescription title="Asteroid Field" description="The cargo ship in front of you is disabled and is drifting uncontrolled! Shoot the asteroids out of the way to protect it!" failmessage="The cargo ship has been hit!" completeMessage="" />
385        <complete-effects>
386            <AddQuest questId="ProtectBoss.PirateAttack" />
387        </complete-effects>
388    </LocalQuest>
389
390    <LocalQuest id="ProtectBoss.PirateAttack">
391      <QuestDescription title="Pirate Attack" description="Protect the cargo ship from the attacking pirates!" failmessage="The pirates boarded the cargo ship!" completeMessage="" />
392    </LocalQuest>
393
394    <SimpleNotification message="Pirates are attacking!" broadcast="true" >
395        <events>
396            <trigger>
397                <EventListener event="passedAsteroidFieldOne" />
398            </trigger>
399        </events>
400    </SimpleNotification>
401
402    <SimpleNotification message="The cargo ship got destroyed! Game over!" broadcast=true >
403      <events>
404            <trigger>
405                <EventListener event="CargoShip" />
406            </trigger>
407        </events>
408    </SimpleNotification>
409
410    <SimpleNotification message="A second pirate wave is approaching!" broadcast=true >
411      <events>
412            <trigger>
413                <EventListener event="firstPirateWaveKilled" />
414            </trigger>
415        </events>
416    </SimpleNotification>
417
418    <SimpleNotification message="The third and last pirate wave is preparing for attack! They will arrive soon!" broadcast=true >
419      <events>
420            <trigger>
421                <EventListener event="secondPirateWaveKilled" />
422            </trigger>
423        </events>
424    </SimpleNotification>
425
426    <SimpleNotification message="The pirates are attacking!" broadcast=true >
427      <events>
428            <trigger>
429                <EventListener event="thirdPirateWaveStarting" />
430            </trigger>
431        </events>
432    </SimpleNotification>
433
434    <SimpleNotification message="You defeated the pirates! The cargo ship is exiting the asteroid field. You made it!" broadcast=true >
435      <events>
436            <trigger>
437                <EventListener event="thirdPirateWaveKilled" />
438            </trigger>
439        </events>
440    </SimpleNotification>
441
442    <Script code="Mission endMission true" onLoad="false">
443        <events>
444            <trigger>
445                <EventListener event="succeedMission" />
446            </trigger>
447        </events>
448    </Script>
449
450    <Script code="Mission endMission false" onLoad="false">
451        <events>
452            <trigger>
453                <EventListener event="CargoShip" />
454            </trigger>
455        </events>
456    </Script>
457
458    <!-- A function to put pirates to a certain location -->
459    <?lua
460      function placePirate(posX, posY, posZ, name, trigger)
461        print("<SpaceShip mass=10 health=25 initialhealth=25 maxhealth=25 shieldhealth=10 maxshieldhealth=10 initialshieldhealth=10 shieldabsorption=0.3 shieldrechargerate=1 shieldrechargewaittime=1 primaryThrust=40 auxiliaryThrust=15 rotationThrust=10 boostpower=5 boostrate=2 boostCooldownDuration = 20 position=\"" .. posX .. "," .. posY .. "," .. posZ .. "\" name=\"" .. name .. "\" radarname=Pirate><events><visibility><EventListener event=\"" .. trigger .. "\"/></visibility><activity><EventListener event=\"" .. trigger .. "\"/></activity></events><templates><Template link=spaceshippirate /></templates><controller><WaypointPatrolController alertnessradius=3129 team=1 active=false><waypoints><Model mesh=\"cube.mesh\" scale=0 position=\"-1300,-600,900\" /><Model mesh=\"cube.mesh\" scale=0 position=\"0,0,0\" /></waypoints><events><activity><EventListener event=attack /></activity></events></WaypointPatrolController></controller></SpaceShip>")
462      end
463    ?>
464
465    <?lua
466      placePirate(0, 0, 3000, "p1", "passedAsteroidFieldOne")
467      placePirate(50, 0, 3500, "p2", "passedAsteroidFieldOne")
468      placePirate(0, 50, 4000, "p3", "passedAsteroidFieldOne")
469      placePirate(0, 0, 5500, "p11", "firstPirateWaveKilled")
470      placePirate(50, 0, 5600, "p12", "firstPirateWaveKilled")
471      placePirate(-50, 0, 5700, "p13", "firstPirateWaveKilled")
472      placePirate(0, 50, 5800, "p14", "firstPirateWaveKilled")
473      placePirate(0, -50, 5900, "p15", "firstPirateWaveKilled")
474      placePirate(0, 0, 6000, "p16", "firstPirateWaveKilled")
475      placePirate(0, 0, 7000, "p21", "thirdPirateWaveStarting")
476      placePirate(50, 0, 7100, "p22", "thirdPirateWaveStarting")
477      placePirate(-50, 0, 7200, "p23", "thirdPirateWaveStarting")
478      placePirate(0, 50, 7300, "p24", "thirdPirateWaveStarting")
479      placePirate(0, -50, 7400, "p25", "thirdPirateWaveStarting")
480      placePirate(50, 50, 7500, "p26", "thirdPirateWaveStarting")
481      placePirate(-50, -50, 7600, "p27", "thirdPirateWaveStarting")
482    ?>
483
484  </Scene>
485</Level>
486
Note: See TracBrowser for help on using the repository browser.