Page tree
Skip to end of metadata
Go to start of metadata

Introduction

Displays the game map in a user-dialog.

In V3.x only groups of the player's side are displayed on the map, in previous versions all groups were shown.

Related commands: Interactions - User Dialogs - Maps

Demo mission: Dialog DialogMap.zip

Properties

Only properties unique to this control type are listed. For general properties, see the Properties 3 page.
The 'Required' column shows in which versions of VBS the property must be defined.
If an entry is bold, then the property must exist, and is interpreted by the engine; if it isn't bold, then the property must exist, but is not interpreted.

Properties
NameTypeRequiredRemark
typeIntegerV1.x+must be 101 (or CT_MAP_MAIN, if using constants)
styleIntegerV1.x+must be 48 (or ST_PICTURE, if using constants)
showCountourIntervalBooleanV1.x+Whether the scaling information (box in the upper right corner) should be shown.
Background and object colors
colorBackgroundColorV1.x, V2.x+land color
colorTextColorV1.x+
textStringV1.x, V2.x+land color (combined with 'colorBackground')
colorSeaColorV1.x, V2.x+water color
colorForestColorV1.x+
colorRocksColorV1.x+
colorCountlinesColorV1.x, V2.x+major elevation lines when zoomed out, minor ones when zoomed in
colorMainCountlinesColorV1.x, V2.x+major elevation lines when zoomed in
colorCountlinesWaterColorV1.x, V2.x+major water depth lines when zoomed out, minor ones when zoomed in
colorMainCountlinesWaterColorV1.x, V2.x+major water depth lines when zoomed in
colorForestBorderColorV1.x, V2.x+
colorRocksBorderColorV1.x+
colorPowerLinesColorV1.x, V2.x+power lines
colorBuildingsColorV1.x, V2.x+rectangles indicating buildings
colorRailwayColorV1.x
colorNamesColorV1.x+
colorInactiveColorV1.x+
colorLevelsColorV1.x, V2.x+elevation labels
Font specs for labels
fontStringV1.x+
sizeExFloatV1.x+
fontLabelStringV1.x+
sizeExLabelFloatV1.x+
fontGridStringV1.x, V2.x+grid label font
sizeExGridFloatV1.x, V2.x+grid label size
fontUnitsStringV1.x+
sizeExUnitsFloatV1.x+
fontNamesStringV1.x+
sizeExNamesFloatV1.x+
fontInfoStringV1.x+
sizeExInfoFloatV1.x+
fontLevelStringV1.x, V2.x+elevation label font
sizeExLevelFloatV1.x, V2.x+elevation label size
Coefficients determining rendering density.
ptsPerSquareSeaFloatV1.x, V2.x+water
ptsPerSquareTxtFloatV1.xtextures
ptsPerSquareCLnFloatV1.x, V2.x+elevation/depth lines
ptsPerSquareExpFloatV1.x, V2.x+exposure
ptsPerSquareCostFloatV1.x, V2.x+cost
Coefficients determining rendering limit.
ptsPerSquareForFloatV1.x, V2.x+forest
ptsPerSquareForEdgeFloatV1.x, V2.x+forest edges
ptsPerSquareRoadFloatV1.x, V2.x+roads
ptsPerSquareObjFloatV1.x, V2.x+other objects



The following sub-classes have to be defined:

Properties
Class NameProperty NameTypeRemark
class LegendBox with scaling legend

colorBackgroundColorBackground color

colorColorText color

x,y,w,hFloatPosition and size information (as in all other Properties 3).

font,sizeExString, FloatFont face and size information (as in all other Properties 3).
class ActiveMarker(no function)

colorColor-

sizeFloat-


The following classes define the looks of certain map objects.
In V1.x they must exist for every map, in V2.x+ they only need to be defined if a respective objects exist on the map (otherwise the object will be indicated by a green square).

ClassProperties that exist for all object classes
  • Bunker
  • Bush
  • BusStop
  • Chapel
  • Church
  • Command
  • Cross
  • Fortress
  • Fountain
  • Fuelstation
  • Hospital
  • Lighthouse
  • Quay
  • Rock
  • Ruin
  • SmallTree
  • Stack
  • Tourism
  • Transmitter
  • Tree
  • ViewTower
  • Watertower
  • Waypoint
  • WaypointCompleted
NameTypeRemark
colorColorColor that is applied to the icon. (Color values will be multiplied, so there will be no visible effect on black areas of an icon, and the most obvious effect on white ones.)
iconStringTexture to display.
Can be a PAA image or a Procedural Textures, and must be square.
sizeFloatSize of icon. Typical sizes are between 8 and 20 (to fill the whole screen height, a size of about 2,000 would be required).
importanceFloatMaximum ctrlMapScale of map, at which the icon should be displayed - maximum is 0.3. (The higher the map scale, the further it is zoomed out.)
An easy method of calculating a maximum level is shown in the examples at the bottom of the page, where the nominal size of the icon is multiplied by .05, and then multiplied by an "importance factor" (between .2 and 3). The higher this factor is, the further the map can be zoomed out, and the icon will still be visible.
coefMinFloatUsed together with the 'ptsPerSquare*' properties, to determine the size of the icon. (Formula unknown at this point.)
coefMaxFloatUsed together with the 'ptsPerSquare*' properties, to determine the size of the icon. (Formula unknown at this point.)


Example

The example definition below contains all the default values that are normally used within VBS:

class Dlg {
  idd = 20000;
  movingEnable = 1;
  
  class controls {
    class MAP {
      idc = 20000;
      type = 101; // CT_MAP_MAIN
      style = 48; // ST_PICTURE
      x = .1; y = .1;
      w = .8; h = .8;
    
      showCountourInterval = 1; 
    
      colorBackground[] = {1, 1, 1, 1}; 
      text = "#(argb,8,8,3)color(1,1,1,1,co)";
      colorText[] = {0, 0, 0, 1};  
      font = "NewsGothicCn";
      sizeEx = 0.104;
      colorSea[] = {0.56, 0.80, 0.98, 0.50};
      colorForest[] = {0.60, 0.80, 0.20, 0.50};  
      colorRocks[] = {0.60, 0.45, 0.27, 0.40}; 
      colorCountlines[] = {0,0,0, 0.60};
      colorMainCountlines[] = {0,0,0, 1};
      colorCountlinesWater[] = {0,0,0, 0.60};
      colorMainCountlinesWater[] = {0,0,0, 1};
      colorForestBorder[] = {1, 0, 0, 1};
      colorRocksBorder[] = {1, 0, 0, 1};
      colorPowerLines[] = {0, 0, 0, 1};
      colorBuildings[] = {0, 0, 0, 0.50};
      colorRailway[] = {0, 0, 0, 1};
      colorNames[] = {0, 0, 0, 1};
      colorInactive[] = {0, 0, 0, 0.50};
      colorLevels[] = {0,0,0, 1};
    
      fontLabel = "NewsGothicB";
      sizeExLabel = .01;
      fontGrid = "NewsGothicB";
      sizeExGrid = 0.0180;
      fontUnits = "NewsGothicB";
      sizeExUnits = 0.04;
      fontNames = "NewsGothicB";
      sizeExNames = 0.04;
      fontInfo = "NewsGothicB";
      sizeExInfo = 0.04;
      fontLevel = "NewsGothicB";
      sizeExLevel = 0.0180;
    
      ptsPerSquareSea = 0.1;
      ptsPerSquareTxt = 8;  
      ptsPerSquareCLn = 8;  
      ptsPerSquareExp = 8;  
      ptsPerSquareCost = 8; 
    
      ptsPerSquareFor = 1;     
      ptsPerSquareForEdge = 10;
      ptsPerSquareRoad = 0.1;
      ptsPerSquareObj = 5;
    
      class Legend {
        colorBackground[] = {0.9, 0.9, 0.9, 0.80};
        color[] = {0, 0, 0, 1};
        x = 0.8; y = 0.02;
        w = 0.18; h = 0.1;
        font = "TahomaB";
        sizeEx = 0.02;
      };
      class ActiveMarker {
        color[] = {0.3, 0.1, 0.9, 1};
        size = 50;
      };
    
      class Bunker {
        color[] = {0, 0, 0, 1};
        icon = "\vbs2\ui\data\map\map_bunker_ca.paa";
        size = 14;
        importance = "1.5 * 14 * 0.05";
        coefMin = 0.25;
        coefMax = 4;
      };
      class Bush {
        color[] = {0.55, 0.64, 0.43, 1};
        icon = "\vbs2\ui\data\map\map_bush_ca.paa";
        size = 14;
        importance = "0.2 * 14 * 0.05";
        coefMin = 0.25;
        coefMax = 4;
      };
      class BusStop {
        color[] = {0, 0, 1, 1};
        icon = "\vbs2\ui\data\map\map_busstop_ca.paa";
        size = 10;
        importance = "1 * 10 * 0.05";
        coefMin = 0.25;
        coefMax = 4;
      };
      class Chapel {
        color[] = {0, 0, 0, 1};
        icon = "\vbs2\ui\data\map\map_chapel_ca.paa";
        size = 16;
        importance = "1 * 16 * 0.05";
        coefMin = 0.25;
        coefMax = 4;
      };
      class Church {
        color[] = {0, 0, 0, 1};
        icon = "\vbs2\ui\data\map\map_church_ca.paa";
        size = 16;
        importance = "2 * 16 * 0.05";
        coefMin = 0.25;
        coefMax = 4;
      };
      class Command {
        color[] = {0, 0.9, 0, 1};
        icon = "#(argb,8,8,3)color(1,1,1,1,co)";
        size = 18;
        importance = 1;
        coefMin = 1; 
        coefMax = 1; 
      };
      class Cross {
        color[] = {0, 0, 0, 1};
        icon = "\vbs2\ui\data\map\map_cross_ca.paa";
        size = 16;
        importance = "0.7 * 16 * 0.05";
        coefMin = 0.25;
        coefMax = 4;
      };
      class Fortress {
        color[] = {0, 0, 0, 1};
        icon = "\vbs2\ui\data\map\map_bunker_ca.paa";
        size = 16;
        importance = "2 * 16 * 0.05";
        coefMin = 0.25;
        coefMax = 4;
      };
      class Fountain {
        color[] = {0, 0.35, 0.70, 1};
        icon = "\vbs2\ui\data\map\map_fountain_ca.paa";
        size = 12;
        importance = "1 * 12 * 0.05";
        coefMin = 0.25;
        coefMax = 4;
      };
      class Fuelstation {
        color[] = {0, 0, 0, 1};
        icon = "\vbs2\ui\data\map\map_fuelstation_ca.paa";
        size = 16;
        importance = "2 * 16 * 0.05";
        coefMin = 0.25;
        coefMax = 4;
      };
      class Hospital {
        color[] = {0.78, 0, 0.05, 1};
        icon = "\vbs2\ui\data\map\map_hospital_ca.paa";
        size = 16;
        importance = "2 * 16 * 0.05";
        coefMin = 0.25;
        coefMax = 4;
      };
      class Lighthouse {
        color[] = {0.78, 0, 0.05, 1};
        icon = "\vbs2\ui\data\map\map_lighthouse_ca.paa";
        size = 20;
        importance = "3 * 16 * 0.05";
        coefMin = 0.25;
        coefMax = 4;
      };
      class Quay {
        color[] = {0, 0, 0, 1};
        icon = "\vbs2\ui\data\map\map_quay_ca.paa";
        size = 16;
        importance = "2 * 16 * 0.05";
        coefMin = 0.25;
        coefMax = 4;
      };
      class Rock {
        color[] = {0, 0, 0, 1};
        icon = "\vbs2\ui\data\map\map_rock_ca.paa";
        size = 12;
        importance = "0.5 * 12 * 0.05";
        coefMin = 0.25;
        coefMax = 4;
      };
      class Ruin {
        color[] = {0.78, 0, 0.05, 1};
        icon = "\vbs2\ui\data\map\map_ruin_ca.paa";
        size = 16;
        importance = "1.2 * 16 * 0.05";
        coefMin = 0.25;
        coefMax = 4;
      };
      class SmallTree {
        color[] = {0.55, 0.64, 0.43, 1};
        icon = "\vbs2\ui\data\map\map_smalltree_ca.paa";
        size = 8;
        importance = "0.6 * 12 * 0.05";
        coefMin = 0.0010;
        coefMax = 4;
      };
      class Stack {
        color[] = {0, 0, 1, 1};
        icon = "\vbs2\ui\data\map\map_stack_ca.paa";
        size = 20;
        importance = "2 * 16 * 0.05";
        coefMin = 0.25;
        coefMax = 4;
      };
      class Tourism {
        color[] = {0.78, 0, 0.05, 1};
        icon = "\vbs2\ui\data\map\map_tourism_ca.paa";
        size = 16;
        importance = "1 * 16 * 0.05";
        coefMin = 0.25;
        coefMax = 8;
      };
      class Transmitter {
        color[] = {0, 0, 1, 1};
        icon = "\vbs2\ui\data\map\map_transmitter_ca.paa";
        size = 20;
        importance = "2 * 16 * 0.05";
        coefMin = 0.25;
        coefMax = 4;
      };
      class Tree {
        color[] = {0.55, 0.64, 0.43, 1};
        icon = "\vbs2\ui\data\map\map_tree_ca.paa";
        size = 8;
        importance = "0.9 * 16 * 0.05";
        coefMin = 0.0010;
        coefMax = 8;
      };
      class ViewTower {
        color[] = {0, 0, 0, 1};
        icon = "\vbs2\ui\data\map\map_viewtower_ca.paa";
        size = 16;
        importance = "2.5 * 16 * 0.05";
        coefMin = 0.25;
        coefMax = 4;
      };
      class Watertower {
        color[] = {0, 0.35, 0.70, 1};
        icon = "\vbs2\ui\data\map\map_watertower_ca.paa";
        size = 32;
        importance = "1.2 * 16 * 0.05";
        coefMin = 0.25;
        coefMax = 4;
      };
      class Waypoint {
        color[] = {0, 0, 0, 1};
        size = 24;
        importance = 1;
        coefMin = 1;
        coefMax = 1;
        icon = "\vbs2\ui\data\map\map_waypoint_ca.paa";
      };
      class WaypointCompleted {
        color[] = {0, 0, 0, 1};
        size = 24;
        importance = 1;
        coefMin = 1;
        coefMax = 1;
        icon = "\vbs2\ui\data\map\map_waypoint_completed_ca.paa";
      };
    };
  };
};