Coordinates.
I can manage to understand how coordinates are for BA.
I've an example:
the map says at the:
bottom left: 16, 16
top, left: 65, 16
bottom right: 16, 49
top, right: 65, 49
Width = GetMapWidth();
Height = GetMapHeight();
Width = 82
Height = 66
Coordinates
Moderators: Slitherine Core, BA Moderators
-
pipfromslitherine
- Site Admin

- Posts: 9928
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Coordinates
There is a 16 tile border around all maps.
Cheers
Pip
Cheers
Pip
Re: Coordinates
Yes but the Width and Height you get with the GetMapWidth call, are not the width or height of the play map, neither the width or height of the play map.
I see that Width = GetMapWidth() return the width of the play map more 17 (no more 34 (16 tile border around all maps)) and same with the height, very bizarre system.
I see that Width = GetMapWidth() return the width of the play map more 17 (no more 34 (16 tile border around all maps)) and same with the height, very bizarre system.
-
pipfromslitherine
- Site Admin

- Posts: 9928
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Coordinates
If the map width is 82, then the tiles are numbered from 0 to 81 inclusive. The playable area will be tiles 16 to 65 inclusive. Similar for the vertical ordinates. The map is exactly the size returned by the functions - the playable area is exactly 16 in along each edge.
Cheers
Pip
Cheers
Pip
Re: Coordinates
enric - what are you trying to get at?
Re: Coordinates
Well, now it works (x), even with the … coordinates system.buffpilot wrote:enric - what are you trying to get at?
I'll add to all my scenarios the text that indicates, in every border map, the compass (North, South, etc.)
This come to me when I wrote a AAR and I found complicated referring to something in the board without compass. (i.e Sherman attack comes from SW)
Now I've a functions that places, in the middle of every map border the corresponding compass coordinate.
Re: Coordinates
Neat - can you post the code?
-
pipfromslitherine
- Site Admin

- Posts: 9928
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Coordinates
We can pretty easily add a compass to the minimap or screen if it's something people think they would use a lot? Or I can just expose the camera facing via the scripting, and you can add whatever onscreen compass you like then
.
Cheers
Pip
Cheers
Pip
Re: Coordinates
It'll be included in every new scenario we are working.buffpilot wrote:Neat - can you post the code?
//******************************************************************************
// * PlaceCompass
// ******************************************************************************
FUNCTION PlaceCompass (rotate)
{
int Nx;
int Ny;
int Sx;
int Sy;
int Ex;
int Ey;
int Wx;
int Wy;
int dummyX;
int dummyY;
int Width;
int Height;
Width = GetMapWidth();
Height = GetMapHeight();
Nx = Width/2;
Ny = 16;
Sx = Nx;
Sy = Height-17;
Ex = Width-17;
EY = Height/2;
Wx = 16;
Wy = Ey;
if ( rotate == 1)
{
DummyX = Nx;
DummyY = Ny;
Nx = Wx;
Ny = Wy;
Wx = Sx;
Wy = Sy;
Sx = Ex;
Sy = Ey;
Ex = DummyX;
Ey = DummyY;
}
if ( rotate == 2 )
{
DummyX = Nx;
DummyY = Ny;
Nx = Sx;
Ny = Sy;
Sx = DummyX;
Sy = DummyY;
DummyX = Ex;
DummyY = Ey;
Ex = Wx;
Ey = Wy;
Wx = DummyX;
Wy = DummyY;
}
if ( rotate == 3)
{
DummyX = Nx;
DummyY = Ny;
Nx = Ex;
Ny = Ey;
Ex = Sx;
Ey = Sy;
Sx = Wx;
Sy = Wy;
Wx = DummyX;
Wy = DummyY;
}
ShowTextMarker(1, Nx, Ny, "IDS_LOC_NORTH", 0, "FFFFFF", 1);
ShowTextMarker(2, Sx, Sy, "IDS_LOC_SOUTH", 0, "FFFFFF", 1);
ShowTextMarker(3, Ex, Ey, "IDS_LOC_EAST", 0, "FFFFFF", 1);
ShowTextMarker(4, Wx, Wy, "IDS_LOC_WEST", 0, "FFFFFF", 1);
}

