[Orxonox-commit 6165] r10823 - code/branches/campaignHS15/data/levels

paulsc at orxonox.net paulsc at orxonox.net
Sun Nov 22 15:07:53 CET 2015


Author: paulsc
Date: 2015-11-22 15:07:53 +0100 (Sun, 22 Nov 2015)
New Revision: 10823

Added:
   code/branches/campaignHS15/data/levels/expeditionSector.oxw
   code/branches/campaignHS15/data/levels/shuttleRetaliation.oxw
Modified:
   code/branches/campaignHS15/data/levels/Campaign1.oxw
Log:
Completed shuttle level (also added station names and such), added and templated prologue and epilogue levels.

Modified: code/branches/campaignHS15/data/levels/Campaign1.oxw
===================================================================
--- code/branches/campaignHS15/data/levels/Campaign1.oxw	2015-11-22 14:04:04 UTC (rev 10822)
+++ code/branches/campaignHS15/data/levels/Campaign1.oxw	2015-11-22 14:07:53 UTC (rev 10823)
@@ -1,6 +1,8 @@
+<!--TODO: Rename screenshot as soon as it is in data_extern branch -->
+<!--TODO: Shuttle and Stations -->
 <LevelInfo
-    name = "CampaignHS15 1"
-    description = "Protect the transporter!"
+    name = "Shuttle under Attack"
+    description = "The newly discovered hostile alien species is attacking one of our outset stations, Andromeda! There is no protecting it; you have to escort the escape shuttle to a safer location."
     tags = "mission"
     screenshot = "missionOne.png"
 />
@@ -82,7 +84,7 @@
     <!--QUEST DEFINITIONS-->
 
     <GlobalQuest id="quest1">
-        <QuestDescription title="Reach the Station A!" description="You need to get in contact with your base! Word is enemies are preparing to attack our people and goods! Be quick!" failMessage="" completeMessage="" />
+        <QuestDescription title="Reach Andromeda Station!" description="You need to get in contact with your base! Word is enemies are preparing to attack our people and goods! Be quick!" failMessage="" completeMessage="" />
         <hints>
         </hints>
         <complete-effects>
@@ -112,7 +114,7 @@
     </GlobalQuest>
 
     <GlobalQuest id="quest3">
-        <QuestDescription title="Fight the first Wave" description="Five enemies are approaching you! There main target is the transporter though, so destroy them - before the destroy the transporter with the valuebals goods (and of course the people aboard)!" failMessage="Oh no! You have to be better, they destroyed the transporter!" completeMessage="Good Job!" />
+        <QuestDescription title="Fight the first Wave" description="Five enemies are approaching you! There main target is the shuttle though, so destroy them - before the destroy the escape shuttle with the valuebals goods (and of course the people aboard)!" failMessage="Oh no! You have to be better, they destroyed the shuttle!" completeMessage="Good Job!" />
         <hints>
         </hints>
         <complete-effects>
@@ -128,10 +130,10 @@
         </hints>
         <subquests>
             <GlobalQuest id="quest4.1">
-                <QuestDescription title="> Get to the Defense Station" description="Fly to Station C, we will repair your spaceship while you will fight them with the Cannons." failMessage="" completeMessage="" />
+                <QuestDescription title="> Get to the Defense Station" description="Fly to the defense station, we will guard your spaceship while you will fight them with the Cannon Suit." failMessage="" completeMessage="" />
             </GlobalQuest>
             <GlobalQuest id="quest4.2">
-                <QuestDescription title="> Get into the Cannon Suit!" description="Dock to Station C, you will be able to contol the Cannons on top of the station, perfect for fighting off a hord of enemies!" failMessage="" completeMessage="" />
+                <QuestDescription title="> Get into the Cannon Suit!" description="Dock to the defense station, you will be able to contol the Cannon Suit on top of the station, perfect for fighting off a hord of enemies!" failMessage="" completeMessage="" />
             </GlobalQuest>
         </subquests>
         <complete-effects>
@@ -151,15 +153,15 @@
     </GlobalQuest>
 
     <GlobalQuest id="quest6">
-        <QuestDescription title="Get back for the Showdown" description="Undock from Station C and get into your Spaceship!" failMessage="" completeMessage="" />
+        <QuestDescription title="Get back for the Showdown" description="Undock from the defense station and get into your Spaceship!" failMessage="" completeMessage="" />
         <hints>
         </hints>
         <subquests>
             <GlobalQuest id="quest6.1">
-                <QuestDescription title="> Collect the local Pickups" description="There are pickups scattered around Spacestation C, you can collect them if you want to, but it is advised to do so. They will support your task in destroying the enemies and make your life easier." failMessage="" completeMessage="" />
+                <QuestDescription title="> Collect the local Pickups" description="There is a box with pickups close to the station, you can collect them if you want to, but it is advised to do so. They will support your task in destroying the enemies and make your life easier." failMessage="" completeMessage="" />
             </GlobalQuest>
             <GlobalQuest id="quest6.2">
-                <QuestDescription title="> Get back to the Transporter" description="Fly to the transporter!" failMessage="" completeMessage="" />
+                <QuestDescription title="> Get back to the Shuttle" description="Fly to the Shuttle!" failMessage="" completeMessage="" />
             </GlobalQuest>
         </subquests>
         <complete-effects>
@@ -187,6 +189,8 @@
         _waveClear<k>
     -->
 
+
+
     <EventMultiTrigger name="spawntrigger">
         <events>
             <trigger>
@@ -197,7 +201,7 @@
 
     <DistanceTrigger name="reachedA" position="<?lua printC(cA) ?>" distance=1000 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true />
 
-    <!-- TODO: find out how to link an event to the COMPLETION of a dock. How is this not possible?? -->
+    <!-- HACK: just waited out 3sec for animation. Cannot link an event to the COMPLETION of a dock. How is this not possible?? -->
     <EventMultiTrigger name="dockedA" activations="1" stayactive="true" delay=3>
         <events>
             <trigger>
@@ -257,8 +261,7 @@
     <?lua enemies = enemies + enemiesIncrease ?>
     <?lua end ?>
 
-    <!-- This controls the ally AI controller so it is only active when active enemies are around!
-    TODO: Find a way to control the allies in another case (Multiple controllers are not allowed). -->
+    <!-- This controls the ally AI controller so it is only active when active enemies are around! -->
     <EventDispatcher name="allyControllerDispatcher">
       <targets>
         <EventTarget target="allyController" />
@@ -297,7 +300,6 @@
         </events>
     </DistanceTrigger>
 
-    <!-- TODO: find out how to link an event to the COMPLETION of a dock. How is this not possible?? -->
     <EventMultiTrigger name="dockedC" activations="1" stayactive="true" delay=3>
         <events>
             <trigger>
@@ -363,40 +365,36 @@
         </events>
     </Script>
 
-    <!-- See the MissionFailed DistanceTrigger attached to the shuttle here! !-->
+    <EventMultiTrigger name="missionFailed" activations="1" stayactive=true>
+        <events>
+            <trigger>
+                <EventListener event="transporter" />
+            </trigger>
+        </events>
+    </EventMultiTrigger>
 
-    <DistanceTrigger name="missionNotFailed" position="0,0,0" distance=100000 target="SpaceShip" beaconMode="identify" targetname="transporter" />
-
-    <!--FIXME: How does this work but the below does not?? -->
-
-    <SimpleNotification broadcast="true" message="TEST">
+    <EventMultiTrigger name="failMissionHelper" delay=4 stayactive=true>
         <events>
             <trigger>
-                <Trigger invert=true>
-                    <EventTrigger>
-                        <events>
-                            <trigger>
-                                <EventListener event="missionNotFailed" />
-                            </trigger>
-                        </events>
-                    </EventTrigger>
-                </Trigger>
+                <EventListener event="missionFailed" />
             </trigger>
         </events>
-    </SimpleNotification>
+    </EventMultiTrigger>
 
+    <DistanceTrigger active=false name="failMission" position="<?lua printC(cA) ?>" distance=100 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true>
+        <events>
+            <activity>
+                <EventListener event="failMissionHelper" />
+            </activity>
+        </events>
+    </DistanceTrigger>
+
+    <!--HACK: Ultimately settled on docking A to fail the mission... that makes a whole lot of sense. -->
+
     <Script code="Mission endMission fail" onLoad="false">
         <events>
             <trigger>
-                <Trigger invert=true>
-                    <EventTrigger>
-                        <events>
-                            <trigger>
-                                <EventListener event="missionNotFailed" />
-                            </trigger>
-                        </events>
-                    </EventTrigger>
-                </Trigger>
+                <EventListener event="failMission" />
             </trigger>
         </events>
     </Script>
@@ -529,7 +527,7 @@
 
     <!--NOTIFICATIONS -->
 
-    <SimpleNotification broadcast="true" message="Welcome, Commander. Please report at Station A.">
+    <SimpleNotification broadcast="true" message="Welcome, Commander. Please report at Andromeda Station.">
         <events>
             <trigger>
                 <EventTrigger stayactive="true" delay=4 >
@@ -571,7 +569,7 @@
         </events>
     </SimpleNotification>
 
-    <SimpleNotification broadcast="true" message="Welcome to Station A, Commander.">
+    <SimpleNotification broadcast="true" message="Welcome to Andromeda, Commander.">
         <events>
             <trigger>
                 <EventListener event="reachedA" />
@@ -640,7 +638,7 @@
         </events>
     </SimpleNotification>
 
-    <SimpleNotification broadcast="true" message="But it's not over yet! Get to Station C and dock!">
+    <SimpleNotification broadcast="true" message="But it's not over yet! Get to the defense station and dock!">
         <events>
             <trigger>
                 <EventTrigger stayactive="true" delay=4 >
@@ -722,7 +720,7 @@
         </events>
     </SimpleNotification>
 
-    <SimpleNotification broadcast="true" message="Get over to Station B to take a break.">
+    <SimpleNotification broadcast="true" message="Get over to the safe base to take a break.">
         <events>
             <trigger>
                 <EventTrigger stayactive="true" delay=4 >
@@ -736,7 +734,7 @@
         </events>
     </SimpleNotification>
 
-    <SimpleNotification broadcast="true" message="It's over... we failed. Retreat!">
+    <SimpleNotification broadcast="true" message="It's over... we failed. Retreat to Andromeda!">
         <events>
             <trigger>
                 <EventListener event="missionFailed" />
@@ -775,7 +773,7 @@
     </Template>
 
     <!-- A, Coordinates are approx. (cos(29pi/16), sin(29pi/16), 0)*3000 -->
-    <Pawn name="statA" team=0 radarname="Station A" position="<?lua printC(cA) ?>" direction="<?lua printC(dStation) ?>" yaw=-50 initialhealth=10000 maxhealth=10000>
+    <Pawn name="statA" team=0 radarname="Andromeda Station" position="<?lua printC(cA) ?>" direction="<?lua printC(dStation) ?>" yaw=-50 initialhealth=10000 maxhealth=10000>
         <templates>
             <Template link="station" />
         </templates>
@@ -802,7 +800,7 @@
     </Pawn>
 
     <!-- B, Coordinates are approx. (-cos(29pi/16), sin(29pi/16), 0)*3000 -->
-    <Pawn name="statB" team=0 radarname="Station B" position="<?lua printC(cB) ?>" direction="<?lua printC(dStation) ?>" yaw=210 initialhealth=10000 maxhealth=10000>
+    <Pawn name="statB" team=0 radarname="Safe Base" position="<?lua printC(cB) ?>" direction="<?lua printC(dStation) ?>" yaw=210 initialhealth=10000 maxhealth=10000>
         <templates>
             <Template link="station" />
         </templates>
@@ -829,7 +827,7 @@
     </Pawn>
 
     <!-- C -->
-    <Pawn name="statC" team=0 radarname="Station C" position="<?lua printC(cC) ?>" direction="<?lua printC(dStation) ?>" initialhealth=10000 maxhealth=10000>
+    <Pawn name="statC" team=0 radarname="Defense Station" position="<?lua printC(cC) ?>" direction="<?lua printC(dStation) ?>" initialhealth=10000 maxhealth=10000>
         <templates>
             <Template link="station" />
         </templates>
@@ -913,7 +911,6 @@
             <Billboard position="320,50,320" material="Flares/ringflare2" colour="0.2,0.4,0.8" />
     	    <DistanceTrigger position="320,50,320" distance="50" target="Pawn" beaconMode="identify" targetname="fpsPlayer" name="undockC" stayactive=true />
             <ForceField active=false position="0,0,0" mode="homogen" diameter="600" forcedirection = "0,-500,0" />
-            <!-- TODO: Invisible boundaries to prevent falling off platform -->
         </attached>
         <collisionShapes>
             <BoxCollisionShape position="0,0,0" halfExtents="400,25,400" />
@@ -992,8 +989,7 @@
         asteroidBelt(cPlanet2[1], cPlanet2[2], cPlanet2[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
     ?>
 
-    <!-- Box with Pickups. TODO: Pickups! -->
-    <SpaceShip team=0 name="gotPickups" health=30 position="<?lua print((cC[1]+600) .. ',' .. cC[2] .. ',' .. (cC[3]-600)) ?>" direction="0,-1,0" collisionType=dynamic mass=1000 radarname="Supplies" >
+    <Pawn team=0 health=30 position="<?lua print((cC[1]+600) .. ',' .. cC[2] .. ',' .. (cC[3]-600)) ?>" direction="0,-1,0" collisionType=dynamic mass=1000 radarname="Supplies" name="gotPickups">
         <events>
             <visibility>
                 <EventListener event="readyAfterWave2" />
@@ -1008,7 +1004,7 @@
         <collisionShapes>
             <BoxCollisionShape position="0,0,0" halfExtents="30,30,30" />
         </collisionShapes>
-    </SpaceShip>
+    </Pawn>
 
     <?lua
         include("includes/pickups.oxi")
@@ -1122,14 +1118,14 @@
     end ?>
 
     <!-- Transporter, starting Point is near A, end Point near B, the circle parameters for the waypoints are: Center = (0, -887, 0), r = 2613 -->
-    <SpaceShip position="<?lua printC(cA) ?>" lookat="<?lua printC(cB) ?>" team=0 name="transporter" radarname="Shuttle">
+    <SpaceShip position="<?lua printC(cA) ?>" lookat="<?lua printC(cB) ?>" team=0 name="transporter" radarname="Shuttle" >
         <templates>
             <Template link="spaceshipShuttle" />
         </templates>
         <attached>
             <DistanceTriggerBeacon name="NPC" />
             <DistanceTriggerBeacon name="transporter" />
-            <DistanceTrigger active=false name="reachedShuttle" position="0,0,0" distance=400 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true>
+            <DistanceTrigger active=false name="reachedShuttle" position="0,0,0" distance=400 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true initialhealth=1000 maxhealth=1000>
                 <events>
                     <activity>
                         <EventListener event="readyAfterWave2" />

Added: code/branches/campaignHS15/data/levels/expeditionSector.oxw
===================================================================
--- code/branches/campaignHS15/data/levels/expeditionSector.oxw	                        (rev 0)
+++ code/branches/campaignHS15/data/levels/expeditionSector.oxw	2015-11-22 14:07:53 UTC (rev 10823)
@@ -0,0 +1,225 @@
+<!--TODO: Rename screenshot as soon as it is in data_extern branch -->
+<LevelInfo
+    name = "Expedition to Sector 5C"
+    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!"
+    tags = "mission"
+    screenshot = "missionOne.png"
+/>
+
+<?lua
+    include("stats.oxo")
+    include("HUDTemplates3.oxo")
+    include("templates/lodInformation.oxt")
+
+    include("templates/spaceshipAssff.oxt")
+    include("templates/spaceshipPirate.oxt")
+    include("templates/spaceshipEscort.oxt")
+    include("templates/spaceshipShuttle.oxt")
+    include("templates/FPS.oxt")
+    include("templates/pickupRepresentationTemplates.oxt")
+?>
+
+<Level gametype = "Mission">
+    <templates>
+        <Template link="lodtemplate_default" />
+    </templates>
+
+    <?lua include("includes/notifications.oxi") ?>
+
+    <NotificationQueueCEGUI
+        name="narrative"
+        targets="simpleNotification"
+        size=3
+        displayTime=3.9
+        position="0.15, 0, 0.1, 0"
+        fontSize="15"
+        fontColor="0.3, 1, 0.2, 0.8"
+        alignment="HorzCentred"
+        displaySize="0.7, 0, 0, 0"
+    />
+
+    <!-- GLOBAL LUA VARIABLES -->
+    <?lua
+
+        --[[ Coordinates in (y,z,x). NOTE: Indexing starts at 1 in lua! Don´t forget to adapt the for loops, too! ]]--
+        cCenter = {0, 0, 0}
+        cSpawn = {-50, 0, 0}
+
+        cField1 = {400, 0, 2500}
+        cField2 = {400, 0, -2500}
+        cPlanet1 = {8000, -2000, 15000}
+        cPlanet2 = {-20000, 4000, -1000}
+
+        --[[ Function to print Coordinates. Quotes not included! ]]--
+        function printC(coord)
+          print(coord[1] .. [[,]] .. coord[2] .. [[,]] .. coord[3])
+        end
+    ?>
+
+    <Scene
+        ambientlight = "0.8, 0.8, 0.8"
+        skybox = "Orxonox/skyBoxMoreNebula"
+        hasPhysics = true
+    >
+
+    <SpawnPoint name="playerSpawn" team=0 position="<?lua printC(cSpawn) ?>" lookat="<?lua printC(cCenter) ?>" spawnclass=SpaceShip pawndesign=spaceshipescort />
+
+    <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" />
+
+    <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"/>
+
+    <!--QUEST DEFINITIONS-->
+
+    <GlobalQuest id="quest1">
+        <QuestDescription title="Quest 1" description="" failMessage="" completeMessage="" />
+        <hints>
+        </hints>
+        <complete-effects>
+            <AddQuest questId="quest2" />
+        </complete-effects>
+    </GlobalQuest>
+
+    <!--EVENTS AND TRIGGERS
+        Usable events and triggers:
+        spawntrigger
+    -->
+
+    <EventMultiTrigger name="spawntrigger">
+        <events>
+            <trigger>
+                <EventListener event="playerSpawn" />
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <!--TODO: Complete the DistanceTriggers for completing/succeeding correctly! -->
+
+    <DistanceTrigger active=false name="missionComplete" position="2000,0,0" distance=100 target="SpaceShip" stayactive=true>
+        <events>
+            <activity>
+                <EventListener event="missionCompletePrereq" />
+            </activity>
+        </events>
+    </DistanceTrigger>
+
+    <Script code="Mission endMission true" onLoad="false">
+        <events>
+            <trigger>
+                <EventListener event="missionComplete" />
+            </trigger>
+        </events>
+    </Script>
+
+    <DistanceTrigger active=false name="missionFailed" position="2000,0,0" distance=100 target="SpaceShip" stayactive=true>
+        <events>
+            <activity>
+                <EventListener event="missionFailedPrereq" />
+            </activity>
+        </events>
+    </DistanceTrigger>
+
+    <Script code="Mission endMission fail" onLoad="false">
+        <events>
+            <trigger>
+                <EventListener event="failMission" />
+            </trigger>
+        </events>
+    </Script>
+
+    <!--QUEST EFFECT BEACONS -->
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <AddQuest questId="quest1" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="spawntrigger" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <!--NOTIFICATIONS -->
+
+    <SimpleNotification broadcast="true" message="Welcome, Commander.">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=4 >
+                   <events>
+                      <trigger>
+                         <EventListener event="spawntrigger" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <!--STATIONS -->
+
+    <!--ELEMENTS -->
+
+    <!-- Planets from the shuttle defense Level. Remove or keep at will. -->
+
+    <Planet
+        position="<?lua printC(cPlanet1) ?>"
+        scale="2000"
+        collisionType="dynamic"
+        linearDamping="0.8"
+        angularDamping="0"
+        mass="5000000"
+        pitch="0"
+        mesh="planets/muunilinst.mesh"
+        atmosphere="atmosphere1"
+        rotationaxis="1,0,0"
+        rotationrate="1.0"
+        atmospheresize="80.0f"
+        imagesize="1024.0f"
+        collisiondamage = 2
+        enablecollisiondamage = true
+      >
+      <attached>
+        <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
+        </attached>
+          <collisionShapes>
+            <SphereCollisionShape radius="2000" position="0,0,0" />
+      </collisionShapes>
+    </Planet>
+
+    <?lua
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(cPlanet1[1], cPlanet1[2], cPlanet1[3], 30, 0, 30, 20, 40, 2800, 3000, 200, 1)
+    ?>
+
+    <Planet
+        position="<?lua printC(cPlanet2) ?>"
+        scale="3000"
+        collisionType="dynamic"
+        linearDamping="0.8"
+        angularDamping="0"
+        mass="5000000"
+        pitch="0"
+        mesh="planets/planet3.mesh"
+        atmosphere="atmosphere1"
+        rotationaxis="1,0,0"
+        rotationrate="1.0"
+        atmospheresize="80.0f"
+        imagesize="1024.0f"
+        collisiondamage = 2
+        enablecollisiondamage = true
+      >
+      <attached>
+        <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
+        </attached>
+          <collisionShapes>
+            <SphereCollisionShape radius="3000" position="0,0,0" />
+      </collisionShapes>
+    </Planet>
+
+    <?lua
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(cPlanet2[1], cPlanet2[2], cPlanet2[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
+    ?>
+
+    </Scene>
+</Level>

Added: code/branches/campaignHS15/data/levels/shuttleRetaliation.oxw
===================================================================
--- code/branches/campaignHS15/data/levels/shuttleRetaliation.oxw	                        (rev 0)
+++ code/branches/campaignHS15/data/levels/shuttleRetaliation.oxw	2015-11-22 14:07:53 UTC (rev 10823)
@@ -0,0 +1,225 @@
+<!--TODO: Rename screenshot as soon as it is in data_extern branch -->
+<LevelInfo
+    name = "Retaliation"
+    description = "This attack cannot be met with no consequences! Commander, we order you to get back to sector 5C and erradicate the alien menace at once!"
+    tags = "mission"
+    screenshot = "missionOne.png"
+/>
+
+<?lua
+    include("stats.oxo")
+    include("HUDTemplates3.oxo")
+    include("templates/lodInformation.oxt")
+
+    include("templates/spaceshipAssff.oxt")
+    include("templates/spaceshipPirate.oxt")
+    include("templates/spaceshipEscort.oxt")
+    include("templates/spaceshipShuttle.oxt")
+    include("templates/FPS.oxt")
+    include("templates/pickupRepresentationTemplates.oxt")
+?>
+
+<Level gametype = "Mission">
+    <templates>
+        <Template link="lodtemplate_default" />
+    </templates>
+
+    <?lua include("includes/notifications.oxi") ?>
+
+    <NotificationQueueCEGUI
+        name="narrative"
+        targets="simpleNotification"
+        size=3
+        displayTime=3.9
+        position="0.15, 0, 0.1, 0"
+        fontSize="15"
+        fontColor="0.3, 1, 0.2, 0.8"
+        alignment="HorzCentred"
+        displaySize="0.7, 0, 0, 0"
+    />
+
+    <!-- GLOBAL LUA VARIABLES -->
+    <?lua
+
+        --[[ Coordinates in (y,z,x). NOTE: Indexing starts at 1 in lua! Don´t forget to adapt the for loops, too! ]]--
+        cCenter = {0, 0, 0}
+        cSpawn = {-50, 0, 0}
+
+        cField1 = {400, 0, 2500}
+        cField2 = {400, 0, -2500}
+        cPlanet1 = {8000, -2000, 15000}
+        cPlanet2 = {-20000, 4000, -1000}
+
+        --[[ Function to print Coordinates. Quotes not included! ]]--
+        function printC(coord)
+          print(coord[1] .. [[,]] .. coord[2] .. [[,]] .. coord[3])
+        end
+    ?>
+
+    <Scene
+        ambientlight = "0.8, 0.8, 0.8"
+        skybox = "Orxonox/skyBoxMoreNebula"
+        hasPhysics = true
+    >
+
+    <SpawnPoint name="playerSpawn" team=0 position="<?lua printC(cSpawn) ?>" lookat="<?lua printC(cCenter) ?>" spawnclass=SpaceShip pawndesign=spaceshipescort />
+
+    <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" />
+
+    <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"/>
+
+    <!--QUEST DEFINITIONS-->
+
+    <GlobalQuest id="quest1">
+        <QuestDescription title="Quest 1" description="" failMessage="" completeMessage="" />
+        <hints>
+        </hints>
+        <complete-effects>
+            <AddQuest questId="quest2" />
+        </complete-effects>
+    </GlobalQuest>
+
+    <!--EVENTS AND TRIGGERS
+        Usable events and triggers:
+        spawntrigger
+    -->
+
+    <EventMultiTrigger name="spawntrigger">
+        <events>
+            <trigger>
+                <EventListener event="playerSpawn" />
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <!--TODO: Complete the DistanceTriggers for completing/succeeding correctly! -->
+
+    <DistanceTrigger active=false name="missionComplete" position="2000,0,0" distance=100 target="SpaceShip" stayactive=true>
+        <events>
+            <activity>
+                <EventListener event="missionCompletePrereq" />
+            </activity>
+        </events>
+    </DistanceTrigger>
+
+    <Script code="Mission endMission true" onLoad="false">
+        <events>
+            <trigger>
+                <EventListener event="missionComplete" />
+            </trigger>
+        </events>
+    </Script>
+
+    <DistanceTrigger active=false name="missionFailed" position="2000,0,0" distance=100 target="SpaceShip" stayactive=true>
+        <events>
+            <activity>
+                <EventListener event="missionFailedPrereq" />
+            </activity>
+        </events>
+    </DistanceTrigger>
+
+    <Script code="Mission endMission fail" onLoad="false">
+        <events>
+            <trigger>
+                <EventListener event="failMission" />
+            </trigger>
+        </events>
+    </Script>
+
+    <!--QUEST EFFECT BEACONS -->
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <AddQuest questId="quest1" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="spawntrigger" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <!--NOTIFICATIONS -->
+
+    <SimpleNotification broadcast="true" message="Welcome, Commander.">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=4 >
+                   <events>
+                      <trigger>
+                         <EventListener event="spawntrigger" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <!--STATIONS -->
+
+    <!--ELEMENTS -->
+
+    <!-- Planets from the shuttle defense Level. Remove or keep at will. -->
+
+    <Planet
+        position="<?lua printC(cPlanet1) ?>"
+        scale="2000"
+        collisionType="dynamic"
+        linearDamping="0.8"
+        angularDamping="0"
+        mass="5000000"
+        pitch="0"
+        mesh="planets/muunilinst.mesh"
+        atmosphere="atmosphere1"
+        rotationaxis="1,0,0"
+        rotationrate="1.0"
+        atmospheresize="80.0f"
+        imagesize="1024.0f"
+        collisiondamage = 2
+        enablecollisiondamage = true
+      >
+      <attached>
+        <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
+        </attached>
+          <collisionShapes>
+            <SphereCollisionShape radius="2000" position="0,0,0" />
+      </collisionShapes>
+    </Planet>
+
+    <?lua
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(cPlanet1[1], cPlanet1[2], cPlanet1[3], 30, 0, 30, 20, 40, 2800, 3000, 200, 1)
+    ?>
+
+    <Planet
+        position="<?lua printC(cPlanet2) ?>"
+        scale="3000"
+        collisionType="dynamic"
+        linearDamping="0.8"
+        angularDamping="0"
+        mass="5000000"
+        pitch="0"
+        mesh="planets/planet3.mesh"
+        atmosphere="atmosphere1"
+        rotationaxis="1,0,0"
+        rotationrate="1.0"
+        atmospheresize="80.0f"
+        imagesize="1024.0f"
+        collisiondamage = 2
+        enablecollisiondamage = true
+      >
+      <attached>
+        <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
+        </attached>
+          <collisionShapes>
+            <SphereCollisionShape radius="3000" position="0,0,0" />
+      </collisionShapes>
+    </Planet>
+
+    <?lua
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(cPlanet2[1], cPlanet2[2], cPlanet2[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
+    ?>
+
+    </Scene>
+</Level>




More information about the Orxonox-commit mailing list