Page 1 of 1
Coordinates
Posted: Mon Oct 22, 2012 5:41 pm
by enric
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
Re: Coordinates
Posted: Mon Oct 22, 2012 6:08 pm
by pipfromslitherine
There is a 16 tile border around all maps.
Cheers
Pip
Re: Coordinates
Posted: Mon Oct 22, 2012 7:43 pm
by enric
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.
Re: Coordinates
Posted: Mon Oct 22, 2012 10:37 pm
by pipfromslitherine
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
Re: Coordinates
Posted: Wed Oct 24, 2012 2:57 am
by buffpilot
enric - what are you trying to get at?
Re: Coordinates
Posted: Wed Oct 24, 2012 7:01 am
by enric
buffpilot wrote:enric - what are you trying to get at?
Well, now it works (x), even with the … coordinates system.
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
Posted: Fri Oct 26, 2012 4:09 am
by buffpilot
Neat - can you post the code?
Re: Coordinates
Posted: Fri Oct 26, 2012 5:08 am
by pipfromslitherine
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
Re: Coordinates
Posted: Fri Oct 26, 2012 6:08 am
by enric
buffpilot wrote:Neat - can you post the code?
It'll be included in every new scenario we are working.
//******************************************************************************
// * 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);
}