Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/Presentation_HS17_merge/data/levels/ProtectBoss.oxw @ 11765

Last change on this file since 11765 was 11765, checked in by landauf, 7 years ago

[ProtectBoss_HS17] fixed level and reverted unwanted changes from emptyLevel.oxw

File size: 16.1 KB
RevLine 
[11500]1<LevelInfo
2 name = "ProtectBoss"
3 description = "Protect a disabled cargo ship!"
[11672]4 tags = "mission"
[11500]5 screenshot = "emptylevel.png"
6/>
7
[11639]8
[11500]9<?lua
10  include("stats.oxo")
11  include("HUDTemplates3.oxo")
12  include("templates/lodInformation.oxt")
13  include("templates/HeavyCruiser.oxt")
[11604]14  include("templates/pickupRepresentationTemplates.oxt")
[11500]15?>
16
17<?lua
18  include("templates/spaceshipEscort.oxt")
19  include("templates/spaceshipAssff.oxt")
20  include("templates/endurancetest_template.oxt")
[11557]21  include("templates/spaceshipPirate.oxt")
[11500]22?>
23
24<Level gametype="Mission">
25  <templates>
26    <Template link=lodtemplate_default />
27  </templates>
28  <?lua include("includes/notifications.oxi") ?>
29
[11522]30  <NotificationQueueCEGUI
31    name="narrative"
32    targets="simpleNotification"
33    size=3
34    displayTime=7
35    position="0.2, 0, 0.1, 0"
36    fontSize="16"
37    fontColor="0.3, 1, 0.2, 0.8"
38    alignment="HorzCentred"
39    displaySize="0.6, 0, 0, 0"
40  />
41
[11500]42  <Scene
43    ambientlight = "0.8, 0.8, 0.8"
44    skybox       = "Orxonox/Starbox"
45  >
46
[11639]47    <?lua
48      include("includes/pickups.oxi")
49    ?>
50
[11500]51    <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" /> <!-- AlphaCentauri.ogg, Mars.ogg-->
52
53    <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"/>
[11557]54
[11522]55    <EventMultiTrigger name=spawntrigger>
56      <events>
57        <trigger>
58          <SpawnPoint team=0 position="0,0,1" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
59        </trigger>
60      </events>
61    </EventMultiTrigger>
[11557]62   
[11585]63    <Pawn
[11522]64        team      = 0
[11585]65        collisionType = kinematic
[11604]66        enablecollisiondamage=true
[11672]67        collisiondamage = 5
[11522]68        position  = "0,0,-2500"
[11604]69        mass      = 100000
[11672]70        health    = 2500 initialhealth=2500 maxhealth="2500"
[11585]71        direction = "1,0,0"
[11522]72        rotationaxis="0,0,1" rotationrate="4.5" velocity="0,0,30"
[11604]73        vulnerable=true
[11585]74        name      = "CargoShip"
75        radarname = "Cargo Ship" >
[11522]76      <attached>
[11542]77        <DistanceTriggerBeacon name="CargoShip" />
[11557]78        <Model mesh="escortShip.mesh" mass=10000 position="0,0,0" scale=100 />
[11522]79      </attached>
[11557]80      <collisionShapes>
81        <BoxCollisionShape position="0,0,0" halfExtents="300,100,200" /> <!-- laenge  ,   dicke    , breite -->
82        <BoxCollisionShape position="-100,-50,-280" halfExtents="220,70,100" />
83        <BoxCollisionShape position="-100,-50,280" halfExtents="220,70,100" />
[11522]84      </collisionShapes>
[11585]85      <explosion>
86        <ExplosionPart scale = 12 minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
87        <ExplosionPart scale = 12 minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
88        <ExplosionPart scale = 12 minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
89        <ExplosionPart offset="94,33,-50" delay=1 minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
90        <ExplosionPart offset="94,33,-50" delay=1 minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
91        <ExplosionPart offset="94,33,-50" delay=1 minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
92   
93        <ExplosionPart scale = 5 mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
94        <ExplosionPart scale = 5 mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
95        <ExplosionPart scale = 5 mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
96        <ExplosionPart scale = 5 mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
97        <ExplosionPart scale = 5 mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
98        <ExplosionPart scale = 5 mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
99        <ExplosionPart scale = 5 mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
100        <ExplosionPart scale = 5 mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
101        <ExplosionPart delay=0.8 scale = 2.5 mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
102        <ExplosionPart delay=0.8 scale = 2.5 mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
103        <ExplosionPart delay=0.8 scale = 2.5 mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
104        <ExplosionPart delay=0.8 scale = 2.5 mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
105       
106        <ExplosionPart offset="20,13,-15" scale=7 delay=1.3 minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
107        <ExplosionPart offset="30,13,-15" scale=7 delay=1.3 minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
108        <ExplosionPart offset="20,13,-15" scale=7 delay=1.3 minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
109        <ExplosionPart offset="-20,-13,-15" scale=5 delay=1.8 minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
110        <ExplosionPart offset="-20,-13,-15" scale=5 delay=1.8 minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
111        <ExplosionPart offset="-20,-13,-15" scale=5 delay=1.8 minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
112      </explosion>
113    </Pawn>
[11522]114
[11672]115    <!-- triggers some time after start -->
116    <DistanceTrigger name="someTimeAfterStart" beaconMode=identify position="0,0,1000" distance=1000 target="Pawn" targetname="CargoShip" />
117
[11557]118    <!-- triggers when first quest is completed -->
[11585]119    <DistanceTrigger name="passedAsteroidFieldOne" beaconMode=identify position="0,0,3000" distance=1000 target="Pawn" targetname="CargoShip" />
[11542]120
[11604]121    <!-- triggers when first pirate wave is defeated -->
[11639]122
[11604]123    <Trigger name="firstPirateWaveKilled" mode="and">
[11639]124      <?lua
125        for n = 1, 3, 1 do
126          print("<EventTrigger activations=1 stayactive=true><events><trigger><EventListener event=p" .. n .. "/></trigger></events></EventTrigger>")
127        end
128      ?>
129    </Trigger>
130
131    <!-- triggers when second pirate wave is defeated -->
132    <Trigger name="secondPirateWaveKilled" mode="and">
133      <?lua
134        for n = 1, 6, 1 do
135          print("<EventTrigger activations=1 stayactive=true><events><trigger><EventListener event=p1" .. n .. "/></trigger></events></EventTrigger>")
136        end
137      ?>
[11604]138    </Trigger>
139
[11639]140    <!-- triggers some time after the second pirate wave was defeated -->
141    <Trigger name="thirdPirateWaveStarting" delay=15>
142      <EventTrigger activations="1" stayactive="true" >
143        <events>
144          <trigger>
145             <EventListener event="secondPirateWaveKilled" />
146          </trigger>
147        </events>
148      </EventTrigger>
149    </Trigger>
150
151    <!-- triggers when third pirate wave is defeated -->
[11672]152    <Trigger name="thirdPirateWaveKilled" mode="and">
[11639]153      <?lua
154        for n = 1, 7, 1 do
155          print("<EventTrigger activations=1 stayactive=true><events><trigger><EventListener event=p2" .. n .. "/></trigger></events></EventTrigger>")
156        end
157      ?>
158    </Trigger>
159
[11672]160    <Trigger name="succeedMission" mode=and delay=1>
[11639]161      <EventTrigger activations="1" stayactive="true" >
162        <events>
163          <trigger>
164             <EventListener event="thirdPirateWaveKilled" />
165          </trigger>
166        </events>
167      </EventTrigger>
[11672]168      <EventTrigger activations="1" stayactive="false" name="cargoShipStillAlive" invert=true>
[11639]169        <events>
170          <trigger>
171             <EventListener event="CargoShip" />
172          </trigger>
173        </events>
174      </EventTrigger>
[11672]175    </Trigger>
[11639]176
[11672]177    <EventTrigger activations="1" stayactive="true" name="failMission" delay=0.1>
178      <events>
179        <trigger>
180           <EventListener event="CargoShip" />
181        </trigger>
182      </events>
183    </EventTrigger>
184
[11639]185    <!-- create asteroids and pickups -->
[11522]186    <?lua
[11604]187      function asteroidMesh()
188        x = math.random(8)
189        if x < 7 then
190          return "ast" .. x .. ".mesh"
191        elseif x == 7 then
192          return "asteroid_ice.mesh"
193        else
194          return "asteroid_UV.mesh"
195        end
196      end
197
[11672]198      for count = 1, 60, 1 do
[11522]199        x = math.random(-1000, 1000)
200        y = math.random(-1000, 1000)
201        z = 125 * count + math.random(-250, 250)
[11557]202        vmax = 7
[11672]203        if count > 30 then
204          vmax = 2
205        end
[11542]206        rx = math.random(-vmax, vmax)
207        ry = math.random(-vmax, vmax)
208        rz = math.random(-vmax, vmax)
209        vx = math.random(-vmax, vmax)
210        vy = math.random(-vmax, vmax)
211        vz = math.random(-vmax, vmax)
212        rr = math.random() * 10
[11639]213        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>")
[11522]214      end
[11604]215
[11672]216      for count = 1, 60, 1 do
[11604]217        x = math.random(-1000, 1000)
218        y = math.random(-1000, 1000)
[11672]219        z = 3000 + 125 * count + math.random(-250, 250)
[11639]220        typenum = math.random(11)
[11604]221        type = ""
222        if typenum == 1 then
223          type = "smallmunition"
224        elseif typenum == 2 then
225          type = "mediummunition"
226        elseif typenum == 3 then
227          type = "hugemunition"
228        elseif typenum == 4 then
229          type = "smallhealth"
230        elseif typenum == 5 then
231          type = "mediumhealth"
232        elseif typenum == 6 then
233          type = "hugehealth"
[11639]234        elseif typenum == 7 then
235          type = "crazyhealth"
236        elseif typenum == 8 then
237          type = "smallshield"
238        elseif typenum == 9 then
239          type = "mediumshield"
240        elseif typenum == 10 then
241          type = "hugeshield"
[11604]242        else
[11639]243          type = "drone"
[11604]244        end
245        type = type .. "pickup"
[11639]246        print("<PickupSpawner pickup=\"" .. type .. "\" position=\"" .. x .. "," .. y .. "," .. z .. "\" triggerDistance=10 respawnTime=5 maxSpawnedItems=1 />")
[11604]247      end
[11522]248    ?>
249
[11557]250    <!-- start first quest -->
[11522]251    <QuestEffectBeacon times=1>
252      <effects>
253        <AddQuest questId="ProtectBoss.AsteroidField" />
254      </effects>
255      <events>
[11542]256        <execute>
[11522]257          <EventListener event=spawntrigger />
258        </execute>
259      </events>
260    </QuestEffectBeacon>
261
[11557]262    <!-- start second quest (doesn't work yet) -->
263    <QuestEffectBeacon times=1>
264      <effects>
265        <CompleteQuest questId="ProtectBoss.AsteroidField" />
[11585]266        <!--AddQuest questId="ProtectBoss.PirateAttack" /-->
[11557]267      </effects>
268      <events>
269        <execute>
[11585]270          <EventListener event=passedAsteroidFieldOne />
[11557]271        </execute>
272      </events>
273    </QuestEffectBeacon>
274
[11522]275    <SimpleNotification message="Protect the cargo ship! (Info: F3)" broadcast="true">
276        <events>
277            <trigger>
278                <EventListener event=spawntrigger />
279            </trigger>
280        </events>
281    </SimpleNotification>
282
283    <LocalQuest id="ProtectBoss.AsteroidField">
[11672]284        <QuestDescription title="Protect the Cargo Ship" 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="" />
[11585]285        <complete-effects>
[11542]286            <AddQuest questId="ProtectBoss.PirateAttack" />
[11585]287        </complete-effects>
[11522]288    </LocalQuest>
[11542]289
290    <LocalQuest id="ProtectBoss.PirateAttack">
291      <QuestDescription title="Pirate Attack" description="Protect the cargo ship from the attacking pirates!" failmessage="The pirates boarded the cargo ship!" completeMessage="" />
292    </LocalQuest>
293
[11672]294    <SimpleNotification message="There are pirates around!" broadcast="true" >
[11542]295        <events>
296            <trigger>
[11672]297                <EventListener event="someTimeAfterStart" />
[11542]298            </trigger>
299        </events>
300    </SimpleNotification>
301
[11639]302    <SimpleNotification message="The cargo ship got destroyed! Game over!" broadcast=true >
[11585]303      <events>
304            <trigger>
305                <EventListener event="CargoShip" />
306            </trigger>
[11542]307        </events>
[11585]308    </SimpleNotification>
309
[11604]310    <SimpleNotification message="A second pirate wave is approaching!" broadcast=true >
311      <events>
312            <trigger>
313                <EventListener event="firstPirateWaveKilled" />
314            </trigger>
315        </events>
316    </SimpleNotification>
317
[11672]318    <SimpleNotification message="The third and last pirate wave is near!" broadcast=true >
[11639]319      <events>
320            <trigger>
321                <EventListener event="secondPirateWaveKilled" />
322            </trigger>
323        </events>
324    </SimpleNotification>
[11604]325
[11672]326    <SimpleNotification message="The cargo ship is out of danger. You made it!" broadcast=true >
[11639]327      <events>
328            <trigger>
[11672]329                <EventListener event="succeedMission" />
[11639]330            </trigger>
331        </events>
332    </SimpleNotification>
333
334    <!-- A function to put pirates to a certain location -->
[11585]335    <?lua
[11604]336      function placePirate(posX, posY, posZ, name, trigger)
[11672]337        print("<SpaceShip mass=10 health=25 initialhealth=25 maxhealth=25 shieldhealth=10 maxshieldhealth=10 initialshieldhealth=10 shieldabsorption=0.3 shieldrechargerate=1 shieldrechargewaittime=1 primaryThrust=20 auxiliaryThrust=5 rotationThrust=5 boostpower=2 boostrate=1 boostCooldownDuration = 50 accuracy=1 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=2700 attackradius=1850 team=1 active=true><waypoints><StaticEntity position=\"" .. posX .. "," .. posY .. "," .. posZ .. "\"/><StaticEntity position=\"" .. (posX + 100) .. "," .. posY .. "," .. posZ .. "\"/><!--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>")
[11585]338      end
339    ?>
340
341    <?lua
[11672]342      placePirate(0, 0, 4800, "p1", "passedAsteroidFieldOne")
343      placePirate(50, 0, 4900, "p2", "passedAsteroidFieldOne")
344      placePirate(0, 50, 5000, "p3", "passedAsteroidFieldOne")
345      placePirate(0, 0, 6500, "p11", "firstPirateWaveKilled")
346      placePirate(50, 0, 6600, "p12", "firstPirateWaveKilled")
347      placePirate(-50, 0, 6700, "p13", "firstPirateWaveKilled")
348      placePirate(0, 50, 6800, "p14", "firstPirateWaveKilled")
349      placePirate(0, -50, 6900, "p15", "firstPirateWaveKilled")
350      placePirate(0, 0, 7000, "p16", "firstPirateWaveKilled")
351      placePirate(0, 0, 8000, "p21", "thirdPirateWaveStarting")
352      placePirate(50, 0, 8100, "p22", "thirdPirateWaveStarting")
353      placePirate(-50, 0, 8200, "p23", "thirdPirateWaveStarting")
354      placePirate(0, 50, 8300, "p24", "thirdPirateWaveStarting")
355      placePirate(0, -50, 8400, "p25", "thirdPirateWaveStarting")
356      placePirate(50, 50, 8500, "p26", "thirdPirateWaveStarting")
357      placePirate(-50, -50, 8600, "p27", "thirdPirateWaveStarting")
[11585]358    ?>
359
[11500]360  </Scene>
361</Level>
362
Note: See TracBrowser for help on using the repository browser.