]> icculus.org git repositories - divverent/nexuiz.git/blob - Docs/mapping.txt
bots now play CTF properly
[divverent/nexuiz.git] / Docs / mapping.txt
1 ==============\r
2 =Mapping Help=\r
3 ==============\r
4 \r
5 While I can't help you make a map, I can help you get it listed in the menu and\r
6 working in the maplist. :p  The central object is the .mapinfo file, but\r
7 there's much more available.\r
8 \r
9 Table of Contents\r
10 -----------------\r
11 I        Map Lists & Scripts\r
12          (get your map listed and working)\r
13   i.     mapinfo\r
14   ii.    mapname.cfg\r
15 \r
16 II       Map Image\r
17 \r
18 III      Domination\r
19 \r
20 IV       CTF\r
21 \r
22 V        Rune Match\r
23 \r
24 VI       Assault\r
25 \r
26 VII      Onslaught\r
27 \r
28 Appendix A - Advanced mapinfo\r
29 \r
30 Appendix B - Helpful extras\r
31   i.     Team Colors\r
32   ii.    Text Colors\r
33 \r
34 \r
35 ========================\r
36 =I. Map Lists & Scripts=\r
37 ========================\r
38 \r
39 There are actually 2 script/cfg options available to you, each serving a\r
40 different purpose and being executed at a different time during the map's life\r
41 cycle:\r
42 \r
43 1. mapname.mapinfo\r
44 2. mapname.cfg\r
45 \r
46 Of these, the mapinfo is the only one that's truely required - and the game is\r
47 even so nice that it automatically generates a draft of it for you.\r
48 \r
49 ------------------\r
50 -The mapinfo file-\r
51 ------------------\r
52 \r
53 *cue even more scary music*\r
54 \r
55 The mapinfo file is basically what gets your map listed in the menu, and sets\r
56 up the options needed to change to it. If no mapinfo file exists, the menu\r
57 will automatically generate a rough draft for you on game startup. It will get\r
58 stored into data/data/mapname.mapinfo.\r
59 \r
60 As an example, let's say I make a map called "wazat1.bsp". As long as I'm\r
61 fantasizing, I might as well say this map is so well done I'm actually willing\r
62 to release it for friends, neighbors, fellow forum visitors and other people\r
63 who like me to judge me by. Let's also assume that I want domination,\r
64 deathmatch/team deathmatch and runematch to all be playable on my map.\r
65 \r
66 This is very easy. First, I start the game and exit it again so the game writes\r
67 data/data/wazat1.mapinfo for me. The file may look like:\r
68 \r
69     title Wazat's Great Map\r
70     description Bleh.\r
71     author Unknown\r
72     _diameter 1966.839355\r
73     _spawnpoints 5\r
74     has weapons\r
75     type dm 30 20\r
76     type dom 200 20\r
77     type rune 200 20\r
78     type lms 9 20\r
79     type arena 10 20\r
80 \r
81 As I see, the menu autodetected that my map may be suitable for deathmatch,\r
82 domination, runematch, last man standing and arena. But I want the map to be\r
83 played in domination, deathmatch, team deathmatch, runematch only, and I also\r
84 want different timelimits/fraglimits, so I will change the "type" lines to:\r
85 \r
86     type dom 100 15\r
87     type rune 1000 25\r
88     type dm 40 15\r
89     type tdm 50 0 2\r
90 \r
91 Also, while I am at it, I should fix the placeholders in the map description lines:\r
92 \r
93     title Wibble\r
94     description A large multi level arena map\r
95     author Wazat\r
96 \r
97 Although not entirely necessary, I will now move the .mapinfo file from\r
98 data/data/maps/wazat1.mapinfo to data/maps/wazat1.mapinfo, so it is at the same\r
99 place as my map. Next time I start the game, my map will be shown supporting\r
100 the right game modes and with the right description in the menu.\r
101 \r
102 Also, note the "has weapons" line. If this line is not there (which happens if\r
103 the map contains no weapon entities other than the Nex), the map will run in\r
104 MinstaGib only and not be shown in the menu normally. So if you look for your\r
105 map and don't find it, add "has weapons" to the mapinfo file, and make sure you\r
106 have weapon entities placed.\r
107 \r
108 There's much more power in a mapinfo file. See Appendix A for more details.\r
109 \r
110 \r
111 -------------\r
112 -mapname.cfg-\r
113 -------------\r
114 \r
115 Unlike the mapinfo, which is processed by the server, the mapname.cfg file is\r
116 processed by the client, and therefore is used for client settings like fog or\r
117 the music to play.\r
118 \r
119 To make the mapname.cfg, make a file with the same name as your map's .bsp\r
120 file, except with a .cfg extension instead of .bsp. For example, my\r
121 "wazat1.bsp" map would use "wazat1.cfg". It uses the same name as your map,\r
122 thus the term mapname.cfg. It will typically only contain a single line:\r
123 \r
124     cd loop 6\r
125 \r
126 where 6 is the number or name of a track in sound/cdtracks/\r
127 \r
128 \r
129 ===============\r
130 =II. Map Image=\r
131 ===============\r
132 \r
133 So, you've got your map listed in the menu and it plays properly, but the menu\r
134 isn't showing your picture! Or the picture is scaled badly! What manner of man\r
135 would create such an accursed abomination?!\r
136 \r
137 Well... That sounds like something I'd do. :D\r
138 \r
139 And it is really easy: just make a screenshot of the map in action (preferably\r
140 with crosshair and HUD switched off), and place it next to the map as\r
141 mapname.jpg. For best rendering and file size, make the image in 4:3 aspect\r
142 ratio, but scale it to the resolution 256x256 or possibly 512x512. It will look\r
143 skewed in your image editing app, but the menu will show it right, and your\r
144 graphics card LOVES images of such dimension.\r
145 \r
146 \r
147 =================\r
148 =III. Domination=\r
149 =================\r
150 \r
151 In order to get Domination working well in your map, you need to place dom_team\r
152 and dom_controlpoint entites. You *must* have at least 3 dom_team entities - 2\r
153 minimum teams and one blank one (empty netname and no team). You can have up\r
154 to 4 teams (5 dom_team entities).\r
155 \r
156 Dom Team\r
157 --------\r
158 classname  dom_team\r
159 netname    name of team (Red Team). Set to "" or don't define for the required\r
160            blank team.\r
161 cnt        color of the team. See the "Helpful Extras" section for info.\r
162 model      When this team captures control points, the points turn to this\r
163            model. If this is the neutral team, points start out as this model.\r
164 noise      Sound to be played on the control point when it's captured. Only\r
165            players nearby will hear it.\r
166 noise1     Sound to be played to all players when the control point is\r
167            captured. Also good for an annoncer voice ("Red Team has captured a\r
168            control point")\r
169 \r
170 Control Points\r
171 --------------\r
172 classname  dom_controlpoint\r
173 message    message to be displayed to all players when this point is captured,\r
174            preceded by the team's name. This defaults to " has captured a control point".\r
175            You can specify different names for each point, for example " has captured the\r
176            Lava Room".\r
177 origin     where in the map this point is\r
178 wait       How often this point gives its controlling team frags.\r
179 frags      How many frags this point gives each wait cycle.\r
180 \r
181 Here is an example entry in a .ent file that includes colored text and 3 teams:\r
182 \r
183 {\r
184 "classname" "dom_team"\r
185 "netname" ""\r
186 "model" "models/domination/dom_unclaimed.md3"\r
187 }\r
188 {\r
189 "classname" "dom_team"\r
190 "netname" "^4Blue Team"\r
191 "cnt" "13"\r
192 "noise" ""\r
193 "noise1" "domination/claim.wav"\r
194 "model" "models/domination/dom_blue.md3"\r
195 }\r
196 {\r
197 "classname" "dom_team"\r
198 "netname" "^1Red Team"\r
199 "cnt" "4"\r
200 "noise" ""\r
201 "noise1" "domination/claim.wav"\r
202 "model" "models/domination/dom_red.md3"\r
203 }\r
204 {\r
205 "classname" "dom_team"\r
206 "netname" "^6Pink Team"\r
207 "cnt" "9"\r
208 "noise" ""\r
209 "noise1" "domination/claim.wav"\r
210 "model" "models/domination/dom_pink.md3"\r
211 }\r
212 {\r
213 "classname" "dom_team"\r
214 "netname" "^3Yellow Team"\r
215 "cnt" "12"\r
216 "noise" ""\r
217 "noise1" "domination/claim.wav"\r
218 "model" "models/domination/dom_yellow.md3"\r
219 }\r
220 {\r
221 "classname" "dom_controlpoint"\r
222 "message" " ^3has captured the ^1Hallways"\r
223 "origin" "-206.0 -488.8 -150.0"\r
224 "frags" "3"\r
225 "wait" "5"\r
226 "scale" "1.3"\r
227 }\r
228 {\r
229 "classname" "dom_controlpoint"\r
230 "message" " ^3has captured the ^1Lavaroom"\r
231 "origin" "1457.1  19.9 -110.0"\r
232 "frags" "1"\r
233 "wait" "5"\r
234 }\r
235 {\r
236 "classname" "dom_controlpoint"\r
237 "message" " ^3controls the ^1Nex & Strength"\r
238 "origin" "-259.8 299.3  5"\r
239 "frags" "1"\r
240 "wait" "5"\r
241 }\r
242 {\r
243 "classname" "dom_controlpoint"\r
244 "message" " ^3has captured the ^1Upper Platform"\r
245 "origin" "539.7 1206.0 182.0"\r
246 "frags" "1"\r
247 "wait" "5"\r
248 }\r
249 {\r
250 "classname" "dom_controlpoint"\r
251 "message" " ^3has captured the ^1Teleport Room"\r
252 "origin" "-1000.0 636.2 -16.0"\r
253 "frags" "1"\r
254 "wait" "5"\r
255 }\r
256 \r
257 \r
258 As you can see in the example, there are 5 dom_team ents: one blank, Red, Blue,\r
259 Pink and Yellow. Each control point has a different message (giving it a\r
260 special name), and the one in the hallways gives 3 frags every 5 seconds\r
261 instead of just one, making it more valuable.\r
262 \r
263 If your map contains the required entities for Domination, the menu will\r
264 automatically detect it for supporting Domination. To force the map to get\r
265 re-detected after you add such entities, delete the data/data/mapname.mapinfo\r
266 file - or simply edit it to add the "type dom" line.\r
267 \r
268 \r
269 ==========\r
270 =III. CTF=\r
271 ==========\r
272 \r
273 Capture the flag needs at least 1 CTF flag per team, and can also make use of\r
274 team spawnpoints.\r
275 \r
276 CTF Flags\r
277 ---------\r
278 classname  item_flag_team1 or item_flag_team2\r
279 angle      direction the flag will point\r
280 model      model of the flag (default: models/ctf/flag_red.md3 or\r
281            models/ctf/flag_blue.md3)\r
282 noise      sound played when flag is stolen (default: "ctf/take.wav")\r
283 noise1     sound played when flag is returned by a teammate (default:\r
284            "ctf/return.wav")\r
285 noise2     sound played when flag is captured (default: "ctf/capture.wav")\r
286 noise3     sound played when flag returns itself (default: "ctf/respawn.wav")\r
287 \r
288 Team Spawnpoints\r
289 ----------------\r
290 classname  info_player_team1 or info_player_team2\r
291 *note: These function just like info_player_deathmatch, but for one team only.\r
292 If you don't make team spawnpoints, info_player_deathmatch is used instead.\r
293 \r
294 If your map contains the required entities for CTF, the menu will automatically\r
295 detect it for supporting CTF. To force the map to get re-detected after you add\r
296 such entities, delete the data/data/mapname.mapinfo file - or simply edit it to\r
297 add the "type ctf" line.\r
298 \r
299 ================\r
300 =III. Runematch=\r
301 ================\r
302 \r
303 Runematch needs only one type of entity to work: rune spawn points. You will\r
304 need at least one for each rune (5 minimum at the time of this writing), though\r
305 you should probably have more than that in the map. Just give the points a\r
306 classname and origin.\r
307 \r
308 Rune Spawnpoints\r
309 ----------------\r
310 classname  runematch_spawn_point\r
311 \r
312 If your map contains the required entities for Runematch, the menu will automatically\r
313 detect it for supporting Runematch. To force the map to get re-detected after you add\r
314 such entities, delete the data/data/mapname.mapinfo file - or simply edit it to\r
315 add the "type rune" line.\r
316 \r
317 \r
318 =================================\r
319 =Appendix A - Advanced mapinfo  =\r
320 =================================\r
321 \r
322 You now know how to make a basic, bare-bones mapinfo to set up a couple options\r
323 and load your map. However, there's much more you can do!  Consider these\r
324 senarios:\r
325 \r
326 1. The laser has too high of a force for laser jumps and ruins CTF\r
327 2. I don't want players to start out with the shotgun, but with the machinegun\r
328    instead\r
329 3. The map takes so much server CPU performance that the anti-wallhack can't be\r
330    made active\r
331 \r
332 Each of these situations can be resolved with ease with a little work in the\r
333 mapinfo file.\r
334 \r
335 To do this, I can add the following lines to my mapinfo file:\r
336 \r
337     settemp_for_type ctf g_balance_laser_primary_force 200\r
338     settemp_for_type all g_start_weapon_shotgun 0\r
339     settemp_for_type all g_start_weapon_uzi 1\r
340     settemp_for_type all sv_cullentities_trace 0\r
341 \r
342 These "settemp" settings are automatically removed when the map is left and\r
343 another is loaded. As you can see, it is possible to make per-mode temporary\r
344 settings, and global ones.\r
345 \r
346 \r
347 ===============================\r
348 =Appendix B - Helpful Extras  =\r
349 ===============================\r
350 \r
351 ----------------\r
352 -i. Team Colors-\r
353 ----------------\r
354 When you need to set an entity's color or team, use these values:\r
355 \r
356 Red\r
357 ---\r
358 Team:      5\r
359 Color:     4\r
360 \r
361 Blue\r
362 ----\r
363 Team:      14\r
364 Color:     13\r
365 \r
366 Yellow\r
367 ------\r
368 Team:      13\r
369 Color:     12\r
370 \r
371 Pink\r
372 -----\r
373 Team:      10\r
374 Color:     9\r
375 \r
376 \r
377 ----------------\r
378 -i. Text Colors-\r
379 ----------------\r
380 Occasionally you may want to print text in color, such as team names. Here are your options:\r
381 \r
382 1  Red\r
383 2  Green\r
384 3  Yellow\r
385 4  Blue\r
386 5  Cyan\r
387 6  Magenta\r
388 7  White\r
389 8  Grey (transparent)\r
390 9  Grey (solid)\r
391 0  Black\r