Configuring 2D Map – DayZ
Overview
DayZ supports generating a 2D map from the terrain data, which means this map is always up-to-date and does not require any other maintenance. It supports any terrain (including community made) with the limitation of showing only the map of currently loaded terrain (world).
Base configuration
By default, the GUI map layout with MapWidgetClass is displayed after executing an action on the map item (ActionUnfoldMap) and the configuration is included on the map item (located at DZ\gear\navigation\config.cpp). Since update 1.06, map item has been made world independent with an ability to customise its visual look (as an item in 3D world) based on the currently loaded terrain. To configure this map item for your terrain, provide these paremeters in your world config:
class CfgWorlds
{
class CAWorld;
class YourTerrain: CAWorld
{
// map item name (default value is #STR_CfgVehicles_ChernarusMap0)
mapDisplayNameKey = "";
// map item description (default value is #STR_CfgVehicles_ChernarusMap1)
mapDescriptionKey = "";
// closed map item texture (default value is dz\gear\navigation\data\map_chernarus_co.paa)
mapTextureClosed = "";
// opened map item texture (check dz\structures\signs\tourist\data\karta_co.paa to see how it should look like)
mapTextureOpened = "";
// opened map item legend part (check dz\structures\signs\tourist\data\karta_side_co.paa to see how it should look like)
mapTextureLegend = "";
// 2D map overlay map for this world (see dz\gear\navigation\data\usermap for an example - it is basically same like proper satellite texture for the terrain just with different sort of info)
userMapPath = "";
};
};
After configuring this, you can freely use item called ChernarusMap (do not be confused by its name) on your terrain while using custom textures and text that fits your terrain.
The map UI can be also created independently of the map item, but then you will need to override in your mod a RscMapControl class (located in bin\config.cpp - it is recommended to base off the values that are at DZ\gear\navigation\config.cpp).
Location labels
Location labels is a feature of a 2D map, which is not tied to any specific map object and is defined within a CfgWorlds entry of a terrain (class Names). Following game config example shows how one can be configured:
class CfgWorlds
{
class CAWorld;
class YourTerrain: CAWorld
{
/* .. */
/* locations definition */
class Names
{
class location_name
{
name="LocationName";
position[]={11339.77,14391.05};
type="locationtype";
};
};
/* end of locations definition */
/* .. */
};
};
name parameter can be also a string from the stringtable database (can be localized). position is a 2D position, specified in meters. Please keep in mind that positioning multiple labels close to each other can lead in some not being visible at all. Available values for the type parameter are in the following table:
Name | Icon | Notes |
---|---|---|
Capital | none | Used for biggest settlements. |
City | none | Used for mid-sized settlements. |
Village | none | Used for small settlements. |
Local | none | Used for miscellaneous locations. |
Marine | none | Used for coastal locations (bays) or in-land water bodies. |
Ruin | DZ\gear\navigation\data\map_ruin_ca | Used for castles. |
Camp | DZ\gear\navigation\data\map_camp_ca | Used for summer camps. |
Hill | DZ\gear\navigation\data\map_hill_ca | Used for mountains. |
ViewPoint | DZ\gear\navigation\data\map_viewpoint_ca | Used for places with nice views (without text usually). |
RockArea | DZ\gear\navigation\data\map_rock_ca | Used for larger parts with lot of rocks around. |
RailroadStation | DZ\gear\navigation\data\map_station_ca | Used for rail stations. |
IndustrialSite | DZ\gear\navigation\data\map_factory_ca | Used for large industrial areas. |
LocalOffice | DZ\gear\navigation\data\map_govoffice_ca | Used for local offices (with Public Address System panels). |
BorderCrossing | DZ\gear\navigation\data\map_border_cross_ca | Used for border crossings. |
VegetationBroadleaf | DZ\gear\navigation\data\map_broadleaf_ca | Used for larger forest areas. |
VegetationFir | DZ\gear\navigation\data\map_fir_ca | Used for larger forest areas. |
VegetationPalm | DZ\gear\navigation\data\map_palm_ca | Used for larger forest areas. |
VegetationVineyard | DZ\gear\navigation\data\map_vineyard_ca | Used for vineyards. |
Changes in this config do not require map to be re-binarized.
Values for map property
Each map object (p3d) can contain a named property called map in geometry LOD. This defines how such object should look like on the 2D map. There can be 4 cases basically:
- hidden from the map
- icon only
- icon and bounding box
- special case (roads, railway)
If you do not specify this property, it is automatically assumed that object will not be visible = default value for this property is map=hide.
Name | Icon | Hides BBox | Notes |
---|---|---|---|
track | none | no | Width of the road included, color defined by the game config (class MapDefaults). |
road | none | no | Width of the road included, color defined by the game config (class MapDefaults). |
main road | none | no | Width of the road included, color defined by the game config (class MapDefaults). |
power lines | none | yes | Color defined by the game config (class MapDefaults). |
railway | none | yes | Color defined by the game config (class MapDefaults). |
house | none | no | Color derived from the geometry LOD. |
fence | none | no | Color derived from the geometry LOD. |
wall | none | no | Color derived from the geometry LOD. |
hide | none | yes | Use to hide object (default value). |
bush | dz\gear\navigation\data\map_bush_ca | yes | -No content provided- |
small tree | dz\gear\navigation\data\map_smalltree_ca | yes | Used for small trees (orchards). They do not form forests triangles. |
tree | dz\gear\navigation\data\map_tree_ca | yes | Used for solitary trees. Forest triangles are created (based on CfgWorlds parameter minTreesInForestSquare). |
rock | dz\gear\navigation\data\map_rock_ca | yes | Used on large rock cliffs. Rock triangles are created (based on CfgWorlds parameter minRocksInRockSquare). |
fuelstation | dz\gear\navigation\data\map_fuelstation_ca | yes | -No content provided- |
lighthouse | dz\gear\navigation\data\map_lighthouse_ca | yes | -No content provided- |
stack | dz\gear\navigation\data\map_stack_ca | yes | -No content provided- |
transmitter | dz\gear\navigation\data\map_transmitter_ca | yes | -No content provided- |
watertower | dz\gear\navigation\data\map_watertower_ca | yes | -No content provided- |
shipwreck | dz\gear\navigation\data\map_shipwreck_ca | yes | -No content provided- |
monument | dz\gear\navigation\data\map_monument_ca | yes | -No content provided- |
busstop | dz\gear\navigation\data\map_busstop_ca | yes | -No content provided- |
fountain | dz\gear\navigation\data\map_fountain_ca | yes | -No content provided- |
waterpump | dz\gear\navigation\data\map_waterpump_ca | yes | -No content provided- |
hospital | dz\gear\navigation\data\map_hospital_ca | no | -No content provided- |
store | dz\gear\navigation\data\map_store_ca | no | -No content provided- |
police | dz\gear\navigation\data\map_police_ca | no | Police department. |
firedep | dz\gear\navigation\data\map_firedep_ca | no | Fire department. |
tsign | dz\gear\navigation\data\map_tsign_ca | yes | Tourist directional sign. |
tshelter | dz\gear\navigation\data\map_tshelter_ca | yes | Tourist shelter. |
tourism | dz\gear\navigation\data\map_tourism_ca | yes | Usually used on pub-like objects. |
cross | dz\gear\navigation\data\map_cross_ca | yes | Solitary crosses. |
chapel | dz\gear\navigation\data\map_chapel_ca | no | Small churches - chapels. |
church | dz\gear\navigation\data\map_church_ca | no | Big churches. |
view-tower | dz\gear\navigation\data\map_viewtower_ca | yes | Used on small view-towers. |
quay | dz\gear\navigation\data\map_quay_ca | yes | Not used at the moment. Can be used for selected pier objects. |
bunker | dz\gear\navigation\data\map_bunker_ca | yes | Not used at the moment. |
fortress | dz\gear\navigation\data\map_fortress_ca | yes | Not used at the moment. |
rocks | dz\gear\navigation\data\map_rock_ca | yes | Not used at the moment. |
ruin | dz\gear\navigation\data\map_ruin_ca | no | Not used at the moment, it is recommended to use location type Ruin instead. |
Changes of the map property in the models require map to be re-binarized.