MapDisplayUIControl: Difference between revisions
No edit summary |
No edit summary |
||
Line 17: | Line 17: | ||
script CAMPAIGN.BSF | script CAMPAIGN.BSF | ||
handler QUESTHANDLER</nowiki> | handler QUESTHANDLER</nowiki> | ||
Note the file MAP.DAT entry. This is placeholder for data we will generate later, The control will load the default files when this is missing. | |||
== Adding Borders == | |||
To add borders you can either enter them by hand (not recommended!), or edit them ingame using the control itself. To do this you must be in debug mode and then hit CTRL+E. You will see the control provide feedback that you are in the editor state. The editor has two modes, Border and Region. In Border mode you can edit, drag, remove, etc points which make up the borders of each territory. Use the LMB to add a point, and the RMB to stop editing the current territory ready to begin a new one (or edit an old one). The backspace key deletes points. To save your progress use CTRL+S (currently this will save to DATA/UI/MAP.DAT in the current campaign. The ability to choose the file to save is TBD). | |||
The I key toggles between Border mode and Region mode, where the territory borders can be viewed as they appear ingame. | |||
== Attaching Data == | |||
The simplest way to attach data to your map is using the |
Revision as of 18:04, 31 May 2016
Map Display UI Control
The key items for using a control are:
The Height Map
This is a 32 bit TGA texture. The blue channel is used for the height information, for ease of use it is recommended that the heightmap be greyscale. The default name for this should be HEIGHT.TGA and it should live in the DATA/UI/TEXTURES folder (generally this will be in the local campaign folder).
The Map Image
This image is used to texture the map, and can be any valid image format. The default name is MAP.TGA (or DDS, etc). It should be in the DATA/UI/TEXTURES folder also. Note that these texture names are customisable if needed using the scenario file (see below).
Using a Map Display
Once you have a heightmap and a map image, you can see the map ingame. Add the control to a UI txt file as normal - the below example could be the base for a custom campaign screen:
[CAMPAIGNDISPLAY] level 4 type mapdisplay file MAP.DAT x 0 y 0 width 1024 height 768 script CAMPAIGN.BSF handler QUESTHANDLER
Note the file MAP.DAT entry. This is placeholder for data we will generate later, The control will load the default files when this is missing.
Adding Borders
To add borders you can either enter them by hand (not recommended!), or edit them ingame using the control itself. To do this you must be in debug mode and then hit CTRL+E. You will see the control provide feedback that you are in the editor state. The editor has two modes, Border and Region. In Border mode you can edit, drag, remove, etc points which make up the borders of each territory. Use the LMB to add a point, and the RMB to stop editing the current territory ready to begin a new one (or edit an old one). The backspace key deletes points. To save your progress use CTRL+S (currently this will save to DATA/UI/MAP.DAT in the current campaign. The ability to choose the file to save is TBD).
The I key toggles between Border mode and Region mode, where the territory borders can be viewed as they appear ingame.
Attaching Data
The simplest way to attach data to your map is using the