[Orxonox-commit 7067] r11684 - in code/branches/ScriptableController_HS17/data/levels: . scripts

kohlia at orxonox.net kohlia at orxonox.net
Sat Dec 16 20:52:37 CET 2017


Author: kohlia
Date: 2017-12-16 20:52:37 +0100 (Sat, 16 Dec 2017)
New Revision: 11684

Added:
   code/branches/ScriptableController_HS17/data/levels/scriptableControllerTest.oxw
   code/branches/ScriptableController_HS17/data/levels/scripts/
   code/branches/ScriptableController_HS17/data/levels/scripts/scriptableControllerTest.lua
Log:
Added test level/script



Added: code/branches/ScriptableController_HS17/data/levels/scriptableControllerTest.oxw
===================================================================
--- code/branches/ScriptableController_HS17/data/levels/scriptableControllerTest.oxw	                        (rev 0)
+++ code/branches/ScriptableController_HS17/data/levels/scriptableControllerTest.oxw	2017-12-16 19:52:37 UTC (rev 11684)
@@ -0,0 +1,42 @@
+<LevelInfo
+ name = "scriptableControllerTest"
+ description = "A level with absolutely nothing in it."
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+  include("templates/HeavyCruiser.oxt")
+?>
+
+<?lua
+  include("templates/spaceshipEscort.oxt")
+  include("templates/endurancetest_template.oxt")
+?>
+
+<Level script="scripts/scriptableControllerTest.lua">
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+
+  <Scene
+    ambientlight = "0.8, 0.8, 0.8"
+    skybox       = "Orxonox/Starbox"
+  >
+
+    <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"/>
+    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />
+
+    <ModularSpaceShip id="Station" velocity= "0,0,0" position="50000000,0,0" lookat= "0,0,0" health="500" maxhealth="500" initialhealth="500">
+      <templates>
+        <Template link=endurance />
+      </templates>
+    </ModularSpaceShip>
+    
+  </Scene>
+</Level>
+

Added: code/branches/ScriptableController_HS17/data/levels/scripts/scriptableControllerTest.lua
===================================================================
--- code/branches/ScriptableController_HS17/data/levels/scripts/scriptableControllerTest.lua	                        (rev 0)
+++ code/branches/ScriptableController_HS17/data/levels/scripts/scriptableControllerTest.lua	2017-12-16 19:52:37 UTC (rev 11684)
@@ -0,0 +1,51 @@
+
+rotate_factor = 0
+station_loc = 200
+station_speed = 0
+
+function spawn_station(obj)
+	orxPrint("Spawning station")
+	setPosition("Station", 500, 0, 0)
+	setOrientation("Station", 0, -1, 0, 0)
+end
+
+function rotate_faster(obj1, obj2, health, shield)
+	orxPrint("Rotating station faster")
+
+	rotate_factor = rotate_factor + 0.02
+	setAngularVelocity("Station", rotate_factor, 0, 0)
+end
+
+
+function kill_player()
+	orxPrint("Killing player")
+	killPawn("Player")
+end
+
+function kill_player_after_timeout(pawn)
+	orxPrint("Killing player after 5s")
+
+	registerAfterTimeout(kill_player, 5)
+end
+
+function next_station_loc(obj1, obj2)
+	orxPrint("Moving station")
+
+	station_loc = station_loc + 500
+	setPosition("Station", station_loc, 0, 0)
+
+	station_speed = station_speed + 5
+	setVelocity("Station", -station_speed, 0, 0)
+
+	registerAtNearObject(next_station_loc, "Player", "Station", 200)
+end
+
+orxPrint("Script started!")
+
+registerAtAreaLeave(spawn_station, "Player", -300, -100, -100, 200, 200, 200)
+registerAtPawnHit(rotate_faster, "Station")
+registerAtPawnKilled(kill_player_after_timeout, "Station")
+registerAtNearObject(next_station_loc, "Player", "Station", 200)
+
+setAngularVelocity("Station", 0, 0, 0)
+



More information about the Orxonox-commit mailing list