Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/planetLevelHS15/data/levels/luaTest.oxw @ 10860

Last change on this file since 10860 was 10860, checked in by luhug, 9 years ago

updated luaTest.oxw

File size: 2.8 KB
Line 
1<LevelInfo
2 name = "Lua Test"
3 description = "A level with absolutely nothing in it."
4 tags = "test"
5 screenshot = "emptylevel.png"
6/>
7
8<?lua
9  include("stats.oxo")
10  include("HUDTemplates3.oxo")
11  include("templates/lodInformation.oxt")
12?>
13
14<?lua
15  include("templates/spaceshipAssff2.oxt")
16  include("templates/spaceshipPirate.oxt")
17  include("templates/spaceshipEscort.oxt")
18  include("templates/spaceshipRing.oxt")
19  include("templates/spaceshipSwallow.oxt")
20?>
21
22<!-- randomly generate houses -->
23<?lua
24function randomHouses(x,y,cellSize)
25    returnString = ""
26    for currentX = 1, x, 1 do
27      for currentY = 1, y, 1 do
28        houseNr = math.floor(math.random()*4 + 1)
29        orientation = math.floor(math.random()*4)
30        houses = {"Glasstower1","ETH","Hausc1","PrimeTower"}
31        scales = {100,100,100,7}
32        collisionShapes = {"","","<BoxCollisionShape position=\"0,0,+50\" halfExtents=\"100, 100, 50\" /><BoxCollisionShape position=\"-50,50,200\" halfExtents=\"50, 50, 100\" scale=\"1.4286\"/><BoxCollisionShape      position=\"50,0,300\" halfExtents=\"50, 100, 200\" scale=\"1.4286\"/><BoxCollisionShape      position=\"50,50,600\" halfExtents=\"50, 50, 100\" scale=\"1.4286\"/><BoxCollisionShape      position=\"-25,-25,150\" halfExtents=\"25, 25, 50\" scale=\"1.4286\"/><BoxCollisionShape      position=\"-25,+75,350\" halfExtents=\"25, 25, 50\" scale=\"1.4286\"/><BoxCollisionShape      position=\"75,-25,550\" halfExtents=\"25, 25, 50\" scale=\"1.4286\"/>","",""}
33        returnString = returnString .. "<StaticEntity collisionType=\"static\" position=\"" .. (currentX*cellSize - (cellSize/2)) .. "," .. (currentY*cellSize - (cellSize/2)) .. ",0\" direction=\"0,1,0\" pitch=\"0\" roll=\"0\" yaw=\"" .. (orientation*90) .. "\">  <attached> <Model position=\"0,0,0\" mesh=\"" .. houses[houseNr] .. ".mesh\" scale=\"" .. scales[houseNr] .. "\"/></attached><collisionShapes>" .. collisionShapes[houseNr] .. "</collisionShapes></StaticEntity>\n\n"
34      end
35    end
36    return returnString
37end
38
39?>
40
41<Level>
42  <templates>
43    <Template link=lodtemplate_default />
44  </templates>
45  <?lua include("includes/notifications.oxi") ?>
46
47  <Scene
48    ambientlight = "0.8, 0.8, 0.8"
49    skybox       = "Orxonox/Starbox"
50  >
51
52   
53    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort direction="0,1,0" />
54
55    <?lua print(randomHouses(2,2,1000)) ?>
56  <StaticEntity position="0,0,0" direction="0,0,0" collisionType=static mass=0 friction=0.01 yaw=90 roll=90 >
57    <attached>
58        <Model position="0,0,0" mesh="skyboxHoenggerberg.mesh" scale3D="1000000,1000000,1000000" lodLevel="0"/>
59        <--!<PortalEndPoint position="0,0,0" id="1" distance="40" target="Pawn" design="PortalDefault"/>-->
60        <Light type="point" position="0,0,0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
61    </attached>
62</StaticEntity>  </Scene>
63</Level>
64
Note: See TracBrowser for help on using the repository browser.