Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/resource2/data/levels/waypoints.oxw @ 5706

Last change on this file since 5706 was 5654, checked in by rgrieder, 15 years ago
  • Implemented file management via resource manager and loading of resource locations via XML. Changes made:
    • SoundManager loads via memory stream rather than via file
    • Loader uses LuaState::includeFile() to load an XML file and passes the lua tag remover function to its LuaState.
    • ConfigFileManager still loads with hard paths because the files are required before Ogre gets created
  • Renamed LuaBind to LuaState, deSingletonised it and added new features:
    • doFile(), doString(), includeFile(), includeString() where include will preparse the string with a function provided with LuaState::setIncludeParser
    • Moved lua tags replace function to Loader (since it's actually an XML related task)
    • Using data_path/lua/LuaInitScript.lua to provide the following functions
      • logMessage(level, message)
      • doFile, dofile, include (all working with relative paths but within the same resource group)
  • Modified Script class to work with LuaState and fixed its XML Loader
  • Adjusted all level and include files (both "include" and "dofile" lua commands)
  • Property svn:eol-style set to native
File size: 5.0 KB
Line 
1<?lua
2  include("hudtemplates3.oxo")
3  include("stats.oxo")
4  include("templates/spaceship_assff.oxt")
5  include("templates/spaceship_H2.oxt")
6  include("templates/spaceship_pirate.oxt")
7?>
8
9<Level
10 name         = "Waypoints"
11 description  = "Testing waypoings for AI controlled spaceships."
12>
13  <Scene
14   ambientlight = "0.5, 0.5, 0.5"
15   skybox       = "Orxonox/skypanoramagen1"
16  >
17    <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" />
18
19    <SpawnPoint position="0,0,0" direction="1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
20
21    <SpaceShip position="0,2000,200" lookat="0,0,0">
22      <templates>
23        <Template link=spaceshipassff />
24      </templates>
25      <controller>
26        <WaypointPatrolController alertnessradius=1000 team=10>
27          <waypoints>
28            <Model mesh="cube.mesh" scale=8 position="  0,2000,-200" />
29            <Model mesh="cube.mesh" scale=8 position="  0,2000,-700" />
30            <Model mesh="cube.mesh" scale=8 position="500,2000,-700" />
31            <Model mesh="cube.mesh" scale=8 position="500,2000,-200" />
32          </waypoints>
33        </WaypointPatrolController>
34      </controller>
35    </SpaceShip>
36    <SpaceShip position="0,2000,400" lookat="0,0,0">
37      <templates>
38        <Template link=spaceshipassff />
39      </templates>
40      <controller>
41        <WaypointPatrolController alertnessradius=1000 team=10>
42          <waypoints>
43            <Model mesh="cube.mesh" scale=8 position="  0,2000,-200" />
44            <Model mesh="cube.mesh" scale=8 position="  0,2000,-700" />
45            <Model mesh="cube.mesh" scale=8 position="500,2000,-700" />
46            <Model mesh="cube.mesh" scale=8 position="500,2000,-200" />
47          </waypoints>
48        </WaypointPatrolController>
49      </controller>
50    </SpaceShip>
51
52    <SpaceShip position="1500,2000,200" lookat="0,0,0">
53      <templates>
54        <Template link=spaceshipassff />
55      </templates>
56      <controller>
57        <WaypointPatrolController alertnessradius=1000 team=11>
58          <waypoints>
59            <Model mesh="cube.mesh" scale=8 position="1500,2000,-200" />
60            <Model mesh="cube.mesh" scale=8 position="1500,2000,-700" />
61            <Model mesh="cube.mesh" scale=8 position="1000,2000,-700" />
62            <Model mesh="cube.mesh" scale=8 position="1000,2000,-200" />
63          </waypoints>
64        </WaypointPatrolController>
65      </controller>
66    </SpaceShip>
67
68    <SpaceShip position="1500,-2000,200" lookat="0,0,0" name=polonaise1>
69      <templates>
70        <Template link=spaceshipassff />
71      </templates>
72      <controller>
73        <WaypointPatrolController alertnessradius=1000 team=12>
74          <waypoints>
75            <Model mesh="cube.mesh" scale=8 position="1500,-2000,-200" />
76<!--
77            <Attacher target=polonaise6 deletewithparent=false />
78            <Model mesh="cube.mesh" scale=8 position="1500,-2000,-700" />
79            <Model mesh="cube.mesh" scale=8 position="1000,-2000,-700" />
80            <Model mesh="cube.mesh" scale=8 position="1000,-2000,-200" />
81-->
82          </waypoints>
83        </WaypointPatrolController>
84      </controller>
85    </SpaceShip>
86
87<?lua
88for i = 1, 5, 1
89do ?>
90    <SpaceShip position="1500,<?lua print(-2000 + 50*i) ?>,200" lookat="0,0,0" name=polonaise<?lua print(i+1) ?> >
91      <templates>
92        <Template link=spaceshipassff />
93      </templates>
94      <controller>
95        <WaypointPatrolController alertnessradius=1000 team=12>
96          <waypoints>
97            <Attacher target=polonaise<?lua print(i) ?> deletewithparent=false />
98          </waypoints>
99        </WaypointPatrolController>
100      </controller>
101    </SpaceShip>
102<?lua
103end
104?>
105
106
107    <SpaceShip position="-1500,-2000,200" lookat="0,0,0" name=attack1>
108      <templates>
109        <Template link=spaceshipassff />
110      </templates>
111      <controller>
112        <WaypointPatrolController alertnessradius=1000 team=13>
113          <waypoints>
114            <Model mesh="cube.mesh" scale=8 position="1500,-2000,-200" />
115          </waypoints>
116        </WaypointPatrolController>
117      </controller>
118    </SpaceShip>
119
120<?lua
121for i = 1, 5, 1
122do ?>
123    <SpaceShip position="-1500,<?lua print(-2000 + 50*i) ?>,200" lookat="0,0,0" name=attack<?lua print(i+1) ?> >
124      <templates>
125        <Template link=spaceshipassff />
126      </templates>
127      <controller>
128        <WaypointPatrolController alertnessradius=1000 team=13>
129          <waypoints>
130            <Attacher target=attack<?lua print(i) ?> deletewithparent=false />
131          </waypoints>
132        </WaypointPatrolController>
133      </controller>
134    </SpaceShip>
135<?lua
136end
137?>
138
139<!--
140<?lua
141for i = 1, 50, 1
142do ?>
143    <SpaceShip position="<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>" lookat="0,0,0" >
144      <templates>
145        <Template link=spaceshipassff />
146      </templates>
147      <controller>
148        <AIController />
149      </controller>
150    </SpaceShip>
151<?lua
152end
153?>
154-->
155
156  </Scene>
157</Level>
Note: See TracBrowser for help on using the repository browser.