Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/presentation2/data/levels/presentationHS09b.oxw @ 6342

Last change on this file since 6342 was 6342, checked in by decapitb, 14 years ago

added Transporter to the level, not too happy with the result yet

File size: 4.4 KB
Line 
1<?lua
2  include("stats.oxo")
3  include("hudtemplates3.oxo")
4?>
5
6<?lua
7  include("templates/spaceship_assff.oxt")
8  include("templates/spaceship_pirate.oxt")
9  include("templates/spaceship_ghost.oxt")
10  include("templates/spaceship_HXY.oxt")
11  include("templates/spaceship_Transporter.oxt")
12?>
13
14<Level
15 name         = "Sample"
16 description  = "Just a few tests"
17>
18  <Scene
19    ambientlight = "0.8, 0.8, 0.8"
20    skybox       = "Orxonox/Starbox"
21  >
22
23   
24        <AmbientSound ambientSource="Mars.ogg" loop="true" play="true" />
25
26   <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" />
27   <?lua
28   elements = {"asteroid_UV.mesh"
29--, "asteroid_ice.mesh"
30--, "ast1.mesh", "ast2.mesh", "ast3.mesh", "ast4.mesh", "ast5.mesh", "ast6.mesh"
31}
32   elements.length = function()
33        return table.getn(elements)
34   end
35   for i = 1, 100, 1
36   do
37   x = math.random() * 200  + (i) * 200
38   y = math.random() * 3000 - 1500
39   z = math.random() * 3000 - 1500 + (i-100) * 10
40   s = math.random() * 100 + 50
41   e = math.floor(math.random()*elements.length()+1)
42   ?>
43   
44    <MovableEntity collisiontype=dynamic mass=<?lua print(s*10)?> position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.01 angularDamping=0 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 100 - 15) ?>">
45      <attached>
46        <Model position="0,0,0" scale=<?lua print(s) ?> mesh="<?lua print(elements[e])?>" />
47      </attached>
48        <collisionShapes>
49                <SphereCollisionShape radius="<?lua if e==0 then print(s*0.9) end if e==1 then print(s*0.3) end if e==2 or e==3 or e==4 or e==5 or e==6 or e==7 then print(s*2) end ?>" />
50        </collisionShapes>
51    </MovableEntity>
52<?lua
53end
54?>
55
56<?lua
57for i = 1, 200, 1
58do
59x = math.random() * 100 + i*100
60y = math.random() * 3000 - 1500
61z = math.random() * 3000 - 1500 + (i-100) * 10
62?>
63
64 <ParticleSpawner position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" source="Orxonox/Steam" lifetime=3.0 loop=1 />
65<!--
66<Billboard material="Test/Fog" position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>"  color="1, 1, 1, 0.01" scale="20" />
67-->
68<?lua
69end
70?>
71
72<?lua
73elements = {"BodyDebris1.mesh", "CockpitDebris.mesh", "LightningGun.mesh", "WingDebris1.mesh", "WingDebris2.mesh", "satellitedish.mesh", "Thruster.mesh"}
74sizes = {4, 4, 4, 4, 4, 10, 20}
75elements.length = function()
76    return table.getn(elements)
77end
78for i = 1, 100, 1
79do
80x = math.random() * 750 - 4500
81y = math.random() * 1000 + 2000
82z = math.random() * 500 + 1000
83e = math.floor(math.random()*elements.length()+1)
84?>
85   
86    <MovableEntity mass=90000 position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.8 angularDamping=0.8 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30- 15) ?>">
87      <attached>
88        <Model position="0,0,0" scale="<?lua print(sizes[e]) ?>" mesh="<?lua print( elements[e]) ?>" />
89      </attached>
90    </MovableEntity>
91        <?lua
92        end
93        ?>
94<?lua
95for i = 1,5, 1
96do
97?>
98    <SpaceShip position="2000,0,0" >
99      <templates>
100        <Template link=spaceshipHXY />
101      </templates>
102      <controller>
103        <WaypointPatrolController name=HXY target=pirate alertnessradius=1000 team=0 active=true>
104          <waypoints>
105            <StaticEntity position="0,0,0" />
106          </waypoints>
107        </WaypointPatrolController>
108      </controller>
109    </SpaceShip>
110<?lua
111end
112?>
113<SpaceShip position="2000,0,0" >
114      <templates>
115        <Template link=spaceshipTransporter />
116      </templates>
117      <controller>
118        <WaypointPatrolController name=ghost target=pirate alertnessradius=1000 team=0 active=true>
119          <waypoints>
120            <StaticEntity position="0,0,0" />
121          </waypoints>
122        </WaypointPatrolController>
123      </controller>
124</SpaceShip>
125<AmbientSound ambientSource="Earth.ogg" loop="true" play="false">
126       <events>
127          <activity>
128             <DistanceTrigger position="2000,0,0" distance=500 target="Camera" />
129          </activity>
130       </events>
131    </AmbientSound>
132
133    <SpawnPoint position="0,0,100" spawnclass=SpaceShip pawndesign=spaceshipHXY  />
134  </Scene>
135</Level>
Note: See TracBrowser for help on using the repository browser.