ShroudDataWML
Contents
Making 'shroud_data'
As pointed out in SideWML you can add the key shroud_data to a [side] tag to describe what parts of the map should be shrouded for a side and what parts not. This comes in handy when you need to unshroud a large part of the map from the start of the game. When you would use the [remove_shroud] tag for that purpose (eg in the prestart event) you would have to a list of x,y coordinates and this can become somewhat lengthy, and it's difficult to find out what coordinates need to be set.
This tutorial is going to make a file containing the data that will unshroud those parts of the map you'd like to see unshrouded. All you need is:
- the wesnoth map editor
- your favorite text editor (with a search & replace function)
Making your map
First of all you will need a map. This can be made in the wesnoth map editor (see WesnothMapEditor and BuildingMaps for more information) Once you've got that, make a copy. If you like to, you can renaim this copy to eg MapName_Shroud to indicate this file will contain the shroud data.
Selecting what tiles will be unshrouded + flipping the map
(Open MapName_Shroud again in the editor if you closed it) You can now select the tiles in the editor you want to be unshrouded. Hold shift and click left to (un)select a single tile and hold shift+alt and click left to select adjecent terrain tiles of the same type. Now fill your selection with one terrain type, and then select all the other tiles and fill it with another type.
After all that is finished you have to flip the map. (I don't know about the editors before v1.3.3), you can do this by pressing alt+ctrl+f or by selecting the menu Edit->Flip Map. Do this twice, both for the x and y axis.
Once that's done, you can save again and quit the editor.
Rewriting the data of the map
Open MapName_Shroud in your text editor. Now you'll see a comma seperated text table containing the map data. You should see only two letter combinations are present, one for the shrouded part and one without. Use search and replace to search for the 'unshroud' letter combination (include leading and trailing spaces) and replace it with a '1' (without quotes). Then do the same for the 'shroud' combination and replace it with a '0'. Make sure no comma's or spaces seperate the zeros and ones. (You can either include them in search and replace strings above or replace appart) Once All that is done you only need to add a pipe in front of each line in this file. The result should look somthing like this:
|000000000000000000 |000000000000000000 |000000000000000000 |000001111111000000 |000001111111000000 |000001111111000000 |000001111111000000 |000001111111000000
Save the file and reference it in you scenario .cfg file like this (make sure the quotes are present, if not this will break the file):
[side] ... shroud_data="{@url/MapName_Shroud}" ... [/side]
Happy Unshrouding!