Map Grid configs

ArmA editing, missions, modeling, textures, terrains

Moderators: Snake Man, Lone Wolf

Post Reply
Snake Man
Commander-In-Chief
Posts: 8553
Joined: 2000-07-31, 10:01:01 PM
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Map Grid configs

Post by Snake Man » 2009-03-14, 06:30:13 PM

Sorry for this messy post, it will be like online notepad, I'll update this first post frequently as I discover more information...

Map grid, when you look at M map view you see the grid and coordinates by default in letters and numbers.

This can be changed and we have long time done it in OFP mods to change the letter/number to a 6-digit military grid system.

class Zoom0 and Zoom1 etc - levels of the zoom.
offsetX - offsets to the lat & long values.

Below here is a six digit military grid config:

Code: Select all

		// 6 digit military grid
		class Grid
		{
			offsetX = 0;
			offsetY = 25600;

			class Zoom1
			{
				zoomMax = 0.2;
				format = "XY";
				formatX = "000";
				formatY = "000";
				stepX = 100;
				stepY = -100;
			};
			class Zoom2
			{
				zoomMax = 1;
				format = "XY";
				formatX = "00";
				formatY = "00";
				stepX = 1000;
				stepY = -1000;
			};
		};
Here is the whole documentation from WrpTool's manual.

CUSTOM MAP GRID

If you want to make your OFP map (map view, with M key, or mission editor) to have custom zoom levels or letters & digits in the grid coordinates, then you must tweak the island config.cpp to suit the needs or you can use the defaults provided in the Island Config.cpp part of this manual, also the same config.cpp files can be found on the Example_Configs directories.

This is the usual map view we have seen on the OFP mission editing and in game while playing and using M key to view the map. Btw don’t you hate when people call themselves “MAPPERS” when they do missions and call the missions a “MAPS”, heh always gives me laughs when I see these guys! But anyways…

The map grid coordinates tell you where you are in the island terrain, it is essential that these values are correctly setup in the config.cpp so there will be no errors while playing the game. It is possible to setup the config.cpp wrongly to give false readings or at least terribly confusing readings along the fact that the zoom level could be extremely limited.


Zoom Level Resolutions

In the zoom levels there are different resolutions, when these resolutions change you can see the effect on the map grid letters and digits related how the config.cpp has been written. The highest resolution or zoom level is called Zoom0 in the config.cpp, this zoom level allows a string of three characters to name the grid position. The Zoom class with the highest resolution must be the first in the class Grid part, the remaining lower level zoom classes must follow in descending order. There can be as many zoom level classes as needed.

Let’s see the basic zoom levels.

Code: Select all

class Grid
		{
			offsetX=0;
			offsetY=0;

			class Zoom1
			{
				zoomMax=0.200000;
				format="XY";
				formatX="Aa";
				formatY="00";
				stepX=128;
				stepY=128;
			};

			class Zoom2
			{
				zoomMax=1000000015047466219900000000000.000000;
				format="XY";
				formatX="A";
				formatY="0";
				stepX=1280;
				stepY=1280;
			};
		};
That is the most common setup for the class grid map zoom levels, two zooms. Here are some of them described better.


offsetX and offsetY

Offset of the whole grid system in meters, referred to the (North West) origin.


zoomMax

Point when the resolution switches from one class to the next one. Lowest value on top of the list and highest value in the bottom class. Values higher than 1 have no significant effect. Zoom classes, which do follow a Zoom class with ZoomMax still higher than 1, will be omitted.


format

Defines an orthogonal grid system (XY axis).


formatX and formatY

String to define the grid labels (grid counter). The counter accepts numbers and letters of any length and combinations. Special symbols are allowed as separators. Counter can be set to any start value. CONSTRAINT: The string length from the most upper Zoom class is limited to a number of three, when used with a speaker (else, running program may abort).


stepX and stepY

Defines the resolution (distance between grid lines) measured in meters
(example on how to reverse the northing: stepY = -1 * 100).


Example Four Level Zoom

This is nice and useful example of the four level zoom for map grids. It uses digits in the letters, but you can configure it as you please.

Code: Select all

class Grid

		{
			offsetX=0;
			offsetY=2800;

			class Zoom0
			{
				zoomMax=0.002;
				format="XY";
				formatX="000";
				formatY="000";
				stepX=1;
				stepY=-1*1;
			};

			class Zoom1
			{
				zoomMax=0.02;
				format="XY";
				formatX="000-";
				formatY="000-";
				stepX=10;
				stepY=-1*10;
			};

			class Zoom2
			{
				zoomMax=0.2;
				format="XY";
				formatX="00--";
				formatY="00--";
				stepX=100;
				stepY=-1*100;
			};

			class Zoom3
			{
				zoomMax=2.0;
				format="XY";
				formatX="0---";
				formatY="0---";
				stepX=1000;
				stepY=-1*1000;
			};

		};
When using this config, you get very tight zoom on the map, this kind of setup can be very useful on those larger 25km islands for example where you need to do lot of zooming to find interesting landmarks.


Map Grid Color

The normal OFP map grid color used for the grid lines and characters & digits is the grayish color. This can be changed from the config.cpp by using the following example.

Code: Select all

colorGrid[]={0,0,1,1};  
colorGridMap[]={0,0,1,1};
This is the common UTM grid color system, the blue color. (this custom map grid manual part is unfinished, please help to finish this, send info/corrections).
PMC since 1984

Editing knowledge, visit PMC Editing Wiki
Addon manuals, visit PMC addons/mods online manuals
View our videos in PMC Youtube channel.

PMC Tactical forum Advanced Search is power.

Snake Man
Commander-In-Chief
Posts: 8553
Joined: 2000-07-31, 10:01:01 PM
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Re: Map Grid configs

Post by Snake Man » 2009-03-28, 07:57:17 PM

I was experimenting with the map class grid and encountered a crash in about 1-5mins into a mission. Here is the class grid that caused the crashes.

CRASH CAUSING CLASS GRID, DO NOT USE IN YOUR ADDON!

Code: Select all

		class Grid
		{
			offsetX = 0;
			offsetY = 12800;

			class Zoom0
			{
				zoomMax = 0.03;
				format = "XY";
				formatX = "0000";
				formatY = "0000";
				stepX = 10;
				stepY = -1 * 10;
			};

			class Zoom1
			{
				zoomMax = 0.2;
				format = "XY";
				formatX = "000";
				formatY = "000";
				stepX = 100;
				stepY = -1 * 100; // 50
			};

			class Zoom2
			{
				zoomMax = 0.6;
				format = "XY";
				formatX = "00";
				formatY = "00";
				stepX = 500;
				stepY = -1 * 500; // 100
			};

			class Zoom3
			{
				zoomMax = 0.8;
				format = "XY";
				formatX = "00";
				formatY = "00";
				stepX = 1000;
				stepY = -1 * 1000; // 500
			};

			class Zoom4
			{
				zoomMax = 1;
				format = "XY";
				formatX = "0";
				formatY = "0";
				stepX = 4000;
				stepY = -1 * 4000;
			};
		};
CRASH CAUSING CLASS GRID, DO NOT USE IN YOUR ADDON!

Can anyone say what part of it caused the crashing, as it did not crash immediately when mapview (M) was brought up, it crashed without never even used map view (of course AI still uses the map grid coordinates etc so it doesn't matter if a player looks map or not).

Anyways, be cautious when making class grids and do NOT use the above bad bad code :)
PMC since 1984

Editing knowledge, visit PMC Editing Wiki
Addon manuals, visit PMC addons/mods online manuals
View our videos in PMC Youtube channel.

PMC Tactical forum Advanced Search is power.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest