Kind of what the title says. How does it work?
How do you add custom maps into native and make them downloadable for people that don't have them?
I tried adding the maps like when you do when you add custom maps to a mod but that didn't work.
I tried to add just the map into the scnobj folder. No luck!
Ofcourse I have added them into the server ini file or what you call it, where you manage the mode of the server and maps etc.
So... Does anybody know how it works? Somebody does, cus I just played on helms deep with my Native module
Thanks in advance
Nagl
SOLUTIONS:
How do you add custom maps into native and make them downloadable for people that don't have them?
I tried adding the maps like when you do when you add custom maps to a mod but that didn't work.
I tried to add just the map into the scnobj folder. No luck!
Ofcourse I have added them into the server ini file or what you call it, where you manage the mode of the server and maps etc.
So... Does anybody know how it works? Somebody does, cus I just played on helms deep with my Native module
Thanks in advance
Nagl
SOLUTIONS:
Stryker said:SOLVED!
Creating your own maps and adding them to the server is actually remarkably easy--I was pleasantly surprised. There are four phases to the process:
[list type=decimal]
[*]Create the map
[*]Add the .sco to the Modules/<modulename>/SceneObj folder in the server
[*]Add the scene to the Modules/<modulename>/scenes.txt file in the server
[*]Add the scene to the server's startup list
[/list]
First off, create a map as normal. I named mine pom_castle, as I'm building a castle for my clan. There are plenty of tutorials about how to do go about creating a map, so I won't cover that here. I'd recommend creating a "playground" mod to build scenes in, as we'll be copying strings between .txt files later. Creating a copy also avoids contaminating your Native module.
When you're done creating your map, you'll have two parts: the .sco file and an entry in your scenes.txt file. First, copy the .sco from your playground module's SceneObj folder to <server folder>/Modules/<modulename>/SceneObj/. This .sco (in my case scn_pom_castle.sco) contains item placements for everything on the map, as well as terrain changes from the generator code.
Next, find the entry in your playground module's scenes.txt. The easiest way to find it is to hit ctrl-f to do a search, then enter the name of your map. Copy the map entry to the server module's scenes.txt file. The entry will look something like this:
Code:scn_pom_castle pom_castle 256 none none 0.000000 0.000000 100.000000 100.000000 -100.000000 0x0000000033aaf74900025896000008370000659800000ab1 0 0 outer_terrain_snow
Your new map is now installed in the server's module. However, your server won't load it yet, or put it in the map rotation. Obviously, this is a problem. To put the map in the server's rotation, you'll need to modify the startup .txt. Put the map's title (pom_castle is the identifier, in my case) in the map load sequence. The code I used to add the POM castle to the test server's startup routine is below (in context).
Code:set_max_players 32 32 set_num_bots_voteable 20 set_map pom_castle add_map multi_scene_2 add_map multi_scene_4 add_map multi_scene_7 add_map multi_scene_9 add_map multi_scene_11 add_map multi_scene_12 add_map random_multi_plain_medium add_map random_multi_plain_large add_map random_multi_steppe_medium add_map random_multi_steppe_large
IT WORKS!
When you attempt to join the server from another location using an unmodified copy of M&B, it downloads the scene's .sco and generator code automatically. I believe (though I haven't verified) that this should work equally well for any mod you can create scenes for.
Limitations
You can't poll for the newly-added map, and I doubt that you can select it from the remote administrator panel in-game (though I haven't verified this). The map is only available via the server's normal map rotation.
Enjoy! I hope we'll start seeing new maps popping up on the POM servers sometime this week.
Turanien said:Listen Up!
I've just done some quick testing with the module system. In order to get a custom map in-game and working functionally, you need to do the following:
Edit:
module_scenes.py - Add your map entry with correct terrain code. Example:
Code:("my_map_1",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000002002c8250004992700006e54000007fe00001fd2", [],[],"outer_terrain_steppe"),
module_scripts.py - Add your map entry to reflect the map name on your admin/poll panel. Example:
Code:("my_map_1", "My Map 1"), ("my_map_2", "My Map 2"),
module_strings.py - Add your map entry to the correct gametypes. This must be done so that it appears under the various gametypes. Example:
Code:(troop_set_slot, "trp_multiplayer_data", multi_data_maps_for_game_type_begin + 8, "scn_my_map_1"),
Once I edited these three files, I ran the batch file and copied the new .txt files over my native 1866 ones. I placed the new scene in the SceneObj folder and then quickly hosted a server on my machine. Lo and behold! Several people joined and confirmed that they had downloaded my map. We played a few rounds bug-free. There is however one problem; the map is not available as a poll option for those without the updated .txt files (Presentations). It is however fully selectable as an admin in the poll panel and in the administration panel.