Seeing as the thread where we figured out how to get this feature working is a little cluttered, I thought I might throw this together. In this guide, I'm going to assume you know how to enable edit mode, how to use the scene editor, and how to compile a module.
Step One - Adding your map
First things first, you're going to need the Module System; so if you don't have it, now is a good time to download it.
Next you're going to need to get the terrain code. If you're making a map, you'll need to generate one. This can be done by starting a single-player game with edit mode enabled; then while on the world map, clicking on the 'terrain' button. If you are using a map made by someone else (with their permission of course ) then make sure they give you the terrain code!
Once you have the terrain code, open up module_scenes.py and look for the multiplayer maps*. Most of them will have names that look like 'multi_scene_#' or 'random_multi_something.' Next you'll have to create a new scene entry. At the top of the file, there is a breakdown on how to do this, but I prefer to simply copy and paste an existing multiplayer map's entry and change the necessary items. You'll want to put this new entry between the entry for 'random_multi_steppe_large' and 'multiplayer_maps_end' Make sure to change the scene's name and put in the terrain code you got earlier (it's the really long hexidecimal number). Below is a sample of what you need to do.
Once you have your map entry created, take notice of the last part of the scene entry. You'll see in the example it says 'outer_scene_plain.' This describes how the outside of the map will look (the part that is blocked off).
There are a few choices:
[*]"outer_terrain_plain" - the classic green plains everyone knows and loves
[*]"outer_terrain_steppe" - the steppe nomads favorite--a steppe!
[*]"outer_terrain_desert" - hot desert sands; almost as dry as my humor
[*]"outer_terrain_snow" - a white, powdery delight reminiscent of the Nordic homelands, ie. snow.
[*]"outer_terrain_beach" - plains on three sides and water on the fourth--perfect for a port or beach map!
[*] 0 - nothing, nada, nil; good for island maps**.
Notes
* - you can quickly find the multiplayer maps by searching for 'multiplayer_maps_end'
** - aside from 0, all other outer terrain flags MUST be surrounded by quotes!
You do not have to start the name of your map with 'multi_' but I like to do it anyway so I can keep things in order.
Step Two - Setting the map's display name
Now you're going to designate the name that will show up in the server browser and the admin panel, so save your module_scenes.py and open module_strings.py. Look again for the multiplayer maps. The entries should have exactly the same name as they did in module_scenes*. You'll want to create an entry between 'multi_scene_15' and 'multi_scene_end.' The first part of the entry is the EXACT name you put in module_scenes, the second part is the name you want to display, surrounded by quotes. Below is an example of what you should do.
Notes
*For those of you who already know your way around the module system, take note that you should not put the prefix 'scn_' in front of the map name!
Step Three - Designating game type(s)
Now you're going to tell Warband what game types your maps can be played on. So save module_strings and open up module_scripts.py Look for the script 'multiplayer_fill_map_game_types.'
Now this step is a little complicated. You should see quite a few entries that start with '(troop_set_slot,' separated by '(else_try),' and an entry checking for game type*. Pick out which game mode(s) you want your map to be played on and copy and paste one of those entries that start with '(troop_set_slot,' BELOW the last entry for that game type, but BEFORE the entry that looks like '(assign, ":num_maps", some_number). 'Next change the map name of that entry to the one you used in module_scenes with the prefix 'scn_' added to it. Then change the number in the field that looks like 'multi_data_maps_for_game_type_begin + some_number' to ONE MORE than the number in the entry above. Finaly, for the '(assign, ":num_maps", some_number)' entry for that game type, INCREMENT the number there by ONE**.
If you have your map made to be playable on more than one game type, you'll have to repeat this step for that game type. Below is an example of what you should do if you wanted to add your map to the list of Battle maps.
Notes
* - Deathmatch, Duel, and Team Deathmatch maps are all under the same category.
** - This number should be ONE greater than the number in the entry for the last map of that game type.
Conclusion
Okay Folks, all you need to do now is save your files and compile your module. If you want to see your maps in the admin panel yourself, you'll need to replace your Native module with this one (keep the folder name the same and BE SURE TO BACK UP). Likewise, the name of the module MUST be Native (or whatever mod you're using) on the server! If you need to edit you're scene in-game, now is a good time to do so; otherwise you are set!
Also note, that if you want to add more than one map, you MUST add them in THE SAME ORDER in each file. Doing otherwise can mess up how Warband displays the maps name, mess up what game type the map is on, or even cause all clients to crash after download!
Thank you all for reading this; I hope it was helpful. If I missed something or messed something up, let me know here or via PM. If you have any questions, feel free to do the same.
-Madoc
Step One - Adding your map
First things first, you're going to need the Module System; so if you don't have it, now is a good time to download it.
Next you're going to need to get the terrain code. If you're making a map, you'll need to generate one. This can be done by starting a single-player game with edit mode enabled; then while on the world map, clicking on the 'terrain' button. If you are using a map made by someone else (with their permission of course ) then make sure they give you the terrain code!
Once you have the terrain code, open up module_scenes.py and look for the multiplayer maps*. Most of them will have names that look like 'multi_scene_#' or 'random_multi_something.' Next you'll have to create a new scene entry. At the top of the file, there is a breakdown on how to do this, but I prefer to simply copy and paste an existing multiplayer map's entry and change the necessary items. You'll want to put this new entry between the entry for 'random_multi_steppe_large' and 'multiplayer_maps_end' Make sure to change the scene's name and put in the terrain code you got earlier (it's the really long hexidecimal number). Below is a sample of what you need to do.
Code:
("random_multi_plain_large",sf_generate|sf_randomize|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x000000013a001853000aa6a40004406900002920001e4f81",
[],[], "outer_terrain_plain"),
("random_multi_steppe_medium", sf_generate|sf_randomize|sf_auto_entry_points, "none", "none", (0,0),(100, 100), -0.5, "0x0000000128601ae300063d8f0004406900002920001e4f81",
[],[], "outer_terrain_steppe"),
("random_multi_steppe_large", sf_generate|sf_randomize|sf_auto_entry_points, "none", "none", (0,0),(100, 100), -0.5, "0x000000012a00d8630009fe7f0004406900002920001e4f81",
[],[], "outer_terrain_steppe"),
###ENTER YOUR NEW MAPS _AFTER_ THIS POINT###
("multi_my_new_map",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013002e0b20005154500006e540000235600007b55",
[],[],"outer_terrain_plain"),
###ENTER YOUR NEW MAPS _BEFORE_ THIS POINT###
("multiplayer_maps_end",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000001300389800003a4ea000058340000637a0000399b",
[],[],"outer_terrain_plain"),
Once you have your map entry created, take notice of the last part of the scene entry. You'll see in the example it says 'outer_scene_plain.' This describes how the outside of the map will look (the part that is blocked off).
There are a few choices:
[*]"outer_terrain_plain" - the classic green plains everyone knows and loves
[*]"outer_terrain_steppe" - the steppe nomads favorite--a steppe!
[*]"outer_terrain_desert" - hot desert sands; almost as dry as my humor
[*]"outer_terrain_snow" - a white, powdery delight reminiscent of the Nordic homelands, ie. snow.
[*]"outer_terrain_beach" - plains on three sides and water on the fourth--perfect for a port or beach map!
[*] 0 - nothing, nada, nil; good for island maps**.
Notes
* - you can quickly find the multiplayer maps by searching for 'multiplayer_maps_end'
** - aside from 0, all other outer terrain flags MUST be surrounded by quotes!
You do not have to start the name of your map with 'multi_' but I like to do it anyway so I can keep things in order.
Step Two - Setting the map's display name
Now you're going to designate the name that will show up in the server browser and the admin panel, so save your module_scenes.py and open module_strings.py. Look again for the multiplayer maps. The entries should have exactly the same name as they did in module_scenes*. You'll want to create an entry between 'multi_scene_15' and 'multi_scene_end.' The first part of the entry is the EXACT name you put in module_scenes, the second part is the name you want to display, surrounded by quotes. Below is an example of what you should do.
Code:
("multi_scene_19", "Mahdaar Castle"), #Castle 5
("multi_scene_12", "Random Plains (Medium)"),
("multi_scene_13", "Random Plains (Large)"),
("multi_scene_14", "Random Steppe (Medium)"),
("multi_scene_15", "Random Steppe (Large)"),
###ADD YOUR MAPS AFTER THIS POINT###
("multi_my_new_map", "My New Map"),
###ADD YOUR MAPS BEFORE THIS POINT###
("multi_scene_end", "multi_scene_end"),
Notes
*For those of you who already know your way around the module system, take note that you should not put the prefix 'scn_' in front of the map name!
Step Three - Designating game type(s)
Now you're going to tell Warband what game types your maps can be played on. So save module_strings and open up module_scripts.py Look for the script 'multiplayer_fill_map_game_types.'
Now this step is a little complicated. You should see quite a few entries that start with '(troop_set_slot,' separated by '(else_try),' and an entry checking for game type*. Pick out which game mode(s) you want your map to be played on and copy and paste one of those entries that start with '(troop_set_slot,' BELOW the last entry for that game type, but BEFORE the entry that looks like '(assign, ":num_maps", some_number). 'Next change the map name of that entry to the one you used in module_scenes with the prefix 'scn_' added to it. Then change the number in the field that looks like 'multi_data_maps_for_game_type_begin + some_number' to ONE MORE than the number in the entry above. Finaly, for the '(assign, ":num_maps", some_number)' entry for that game type, INCREMENT the number there by ONE**.
If you have your map made to be playable on more than one game type, you'll have to repeat this step for that game type. Below is an example of what you should do if you wanted to add your map to the list of Battle maps.
Code:
(else_try),
(eq, ":game_type", multiplayer_game_type_battle),
(troop_set_slot, "trp_multiplayer_data", multi_data_maps_for_game_type_begin, "scn_multi_scene_1"),
(troop_set_slot, "trp_multiplayer_data", multi_data_maps_for_game_type_begin + 1, "scn_multi_scene_2"),
(troop_set_slot, "trp_multiplayer_data", multi_data_maps_for_game_type_begin + 2, "scn_multi_scene_4"),
(troop_set_slot, "trp_multiplayer_data", multi_data_maps_for_game_type_begin + 3, "scn_multi_scene_7"),
(troop_set_slot, "trp_multiplayer_data", multi_data_maps_for_game_type_begin + 4, "scn_multi_scene_9"),
(troop_set_slot, "trp_multiplayer_data", multi_data_maps_for_game_type_begin + 5, "scn_multi_scene_11"),
(troop_set_slot, "trp_multiplayer_data", multi_data_maps_for_game_type_begin + 6, "scn_multi_scene_12"),
(troop_set_slot, "trp_multiplayer_data", multi_data_maps_for_game_type_begin + 7, "scn_multi_scene_14"),
(troop_set_slot, "trp_multiplayer_data", multi_data_maps_for_game_type_begin + 8, "scn_random_multi_plain_medium"),
(troop_set_slot, "trp_multiplayer_data", multi_data_maps_for_game_type_begin + 9, "scn_random_multi_plain_large"),
(troop_set_slot, "trp_multiplayer_data", multi_data_maps_for_game_type_begin + 10, "scn_random_multi_steppe_medium"),
(troop_set_slot, "trp_multiplayer_data", multi_data_maps_for_game_type_begin + 11, "scn_random_multi_steppe_large"),
###ADD YOUR MAP BELOW THIS POINT###
(troop_set_slot, "trp_multiplayer_data", multi_data_maps_for_game_type_begin + 12, "scn_multi_my_new_map"),
###ADD YOUR MAP ABOVE THIS POINT###
(assign, ":num_maps", 13),
(else_try),
Notes
* - Deathmatch, Duel, and Team Deathmatch maps are all under the same category.
** - This number should be ONE greater than the number in the entry for the last map of that game type.
Conclusion
Okay Folks, all you need to do now is save your files and compile your module. If you want to see your maps in the admin panel yourself, you'll need to replace your Native module with this one (keep the folder name the same and BE SURE TO BACK UP). Likewise, the name of the module MUST be Native (or whatever mod you're using) on the server! If you need to edit you're scene in-game, now is a good time to do so; otherwise you are set!
Also note, that if you want to add more than one map, you MUST add them in THE SAME ORDER in each file. Doing otherwise can mess up how Warband displays the maps name, mess up what game type the map is on, or even cause all clients to crash after download!
Thank you all for reading this; I hope it was helpful. If I missed something or messed something up, let me know here or via PM. If you have any questions, feel free to do the same.
-Madoc