Configuring 2D Map – DayZ
Lou Montana (talk | contribs) m (Fix hl template issue) |
Lou Montana (talk | contribs) m (Fix hl template issue) |
||
Line 1: | Line 1: | ||
{{TOC|side}} | {{TOC|side}} | ||
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). | |||
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 == | == 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 | |||
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 {{GVI|dayz|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: | |||
<syntaxhighlight lang="c++"> | <syntaxhighlight lang="c++"> | ||
Line 11: | Line 13: | ||
{ | { | ||
class CAWorld; | class CAWorld; | ||
class YourTerrain: CAWorld | class YourTerrain : CAWorld | ||
{ | { | ||
// map item name (default value is #STR_CfgVehicles_ChernarusMap0) | // map item name (default value is #STR_CfgVehicles_ChernarusMap0) | ||
Line 38: | Line 40: | ||
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: | 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: | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="cpp"> | ||
class CfgWorlds | class CfgWorlds | ||
{ | { | ||
class CAWorld; | class CAWorld; | ||
class YourTerrain: CAWorld | class YourTerrain : CAWorld | ||
{ | { | ||
/* .. */ | /* .. */ | ||
Line 50: | Line 52: | ||
class location_name | class location_name | ||
{ | { | ||
name="LocationName"; | name = "LocationName"; | ||
position[]={11339.77,14391.05}; | position[] = { 11339.77, 14391.05 }; | ||
type="locationtype"; | type = "locationtype"; | ||
}; | }; | ||
}; | }; | ||
Line 61: | Line 63: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
'''name''' parameter can be also a string from the stringtable database (can be | '''name''' parameter can be also a string from the stringtable database (can be localised). | ||
'''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. | '''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: | Available values for the '''type''' parameter are in the following table: | ||
{| class="wikitable" style="width:100%;" | <div class="noresize"> | ||
{| class="wikitable" style="width: 100%;" | |||
|- | |- | ||
! Name !! Icon !! Notes | ! Name !! Icon !! Notes | ||
Line 105: | Line 108: | ||
| VegetationVineyard || DZ\gear\navigation\data\map_vineyard_ca || Used for vineyards. | | VegetationVineyard || DZ\gear\navigation\data\map_vineyard_ca || Used for vineyards. | ||
|} | |} | ||
</div> | |||
Changes in this config do not require map to be re- | Changes in this config do not require map to be re-binarised. | ||
== Values | == Map Property Values == | ||
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: | 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 | * hidden from the map | ||
* icon only | * icon only | ||
Line 116: | Line 123: | ||
* special case (roads, railway) | * 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. | 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. | ||
{| class="wikitable" style="width:100% | <div class="noresize"> | ||
{| class="wikitable" style="width: 100%" | |||
|- | |- | ||
! Name !! Icon !! Hides BBox !! Notes | ! Name !! Icon !! Hides BBox !! Notes | ||
Line 199: | Line 207: | ||
| ruin || dz\gear\navigation\data\map_ruin_ca || no || Not used at the moment, it is recommended to use location type Ruin instead. | | ruin || dz\gear\navigation\data\map_ruin_ca || no || Not used at the moment, it is recommended to use location type Ruin instead. | ||
|} | |} | ||
</div> | |||
Changes of the map property in the models require map to be re- | Changes of the map property in the models require map to be re-binarised. | ||
{{GameCategory|dayz|Terrain Editing}} | {{GameCategory|dayz|Terrain Editing}} |
Revision as of 23:26, 22 May 2025
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 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 localised). 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-binarised.
Map Property Values
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 | |
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 | |
lighthouse | dz\gear\navigation\data\map_lighthouse_ca | yes | |
stack | dz\gear\navigation\data\map_stack_ca | yes | |
transmitter | dz\gear\navigation\data\map_transmitter_ca | yes | |
watertower | dz\gear\navigation\data\map_watertower_ca | yes | |
shipwreck | dz\gear\navigation\data\map_shipwreck_ca | yes | |
monument | dz\gear\navigation\data\map_monument_ca | yes | |
busstop | dz\gear\navigation\data\map_busstop_ca | yes | |
fountain | dz\gear\navigation\data\map_fountain_ca | yes | |
waterpump | dz\gear\navigation\data\map_waterpump_ca | yes | |
hospital | dz\gear\navigation\data\map_hospital_ca | no | |
store | dz\gear\navigation\data\map_store_ca | no | |
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-binarised.