[Orxonox-commit 6153] r10811 - code/branches/planetLevelHS15/data/levels
luhug at orxonox.net
luhug at orxonox.net
Mon Nov 16 16:23:12 CET 2015
Author: luhug
Date: 2015-11-16 16:23:12 +0100 (Mon, 16 Nov 2015)
New Revision: 10811
Added:
code/branches/planetLevelHS15/data/levels/luaTest.oxw
Log:
added luaTest.oxw to test random city generation
Added: code/branches/planetLevelHS15/data/levels/luaTest.oxw
===================================================================
--- code/branches/planetLevelHS15/data/levels/luaTest.oxw (rev 0)
+++ code/branches/planetLevelHS15/data/levels/luaTest.oxw 2015-11-16 15:23:12 UTC (rev 10811)
@@ -0,0 +1,76 @@
+<LevelInfo
+ name = "Lua Test"
+ description = "A level with absolutely nothing in it."
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+?>
+
+<?lua
+ include("templates/spaceshipAssff2.oxt")
+ include("templates/spaceshipPirate.oxt")
+ include("templates/spaceshipEscort.oxt")
+ include("templates/spaceshipRing.oxt")
+ include("templates/spaceshipSwallow.oxt")
+?>
+
+<!-- randomly generate houses -->
+<?lua
+ function randomHouses(x,y,cellSize)
+ returnString = ""
+ for currentX = 1, x, 1 do
+ for currentY = 1, y, 1 do
+ houseNr = math.floor(math.random()*4 + 1)
+ orientation = math.floor(math.random()*4)
+ if houseNr == 1 then
+ houseString = "PrimeTower"
+ houseHeight = 0
+ elseif houseNr == 2 then
+ houseString = "Glasstower1"
+ houseHeight = 0
+ elseif houseNr == 3 then
+ houseString = "ETH"
+ houseHeight = 0
+ elseif houseNr == 4 then
+ houseString = "Hausc1"
+ houseHeight = 0
+ elseif houseNr == 5 then
+ houseString = "haus5"
+ houseHeight = 0
+ elseif houseNr == 6 then
+ houseString = "haus1"
+ houseHeight = 0
+ end
+
+ returnString = returnString .. "<StaticEntity position=\"" .. (currentX - (cellSize/2)) .. "," .. (currentX - (cellSize/2)) .. "," .. (houseHeight/2) .. "\" direction=\"0,0,1\" pitch=\"0\" roll=\"0\" yaw=\"" .. (orientation*90) .. "\"> <attached> <Model position=\"0,0,0\" mesh=\"" .. houseString .. ".mesh\" scale3D=\"100\"/></attached></StaticEntity>\n\n"
+ end
+ end
+ return returnString
+ end
+
+?>
+
+<Level>
+ <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 />
+
+ <?lua print(randomHouses(5,5,500)) ?>
+
+ </Scene>
+</Level>
+
More information about the Orxonox-commit
mailing list