ok, I'm having no luck getting the same answer that I get from Taco's Tool.
The in-game map has x-coordinates from;
Code:
80 to -140 left to right
and y-coordinates from;
Code:
-80 to 140 top to bottom
my map is;
Code:
1000 pixels wide, and 966 pixels high
I'm just going to work the x-axis and hopefully someone will tell me what's wrong here.
From Bobbles post I get the following variables from the map info;
Code:
LOC_Ax = 80
LOC_Bx = -140
MAP_Ax = 0
MAP_Bx = 1000
So to get wdpp_x;
Code:
LOC_Bx - LOC_Ax
wdpp_x = --------------------
MAP_Bx - MAP_Ax
-140 - 80 -220
wdpp_x = ----------- = ------ = -0.22
1000 - 0 1000
Ok, so according to Bobble MAP_0x is 0.
So, all I need now are LOC_0x and LOC_x.
LOC_x in this example will be 0 and 40 (2 different examples)
to get LOC_0x, we do;
Code:
LOC_0x = LOC_Bx - (wdpp_x * (MAP_Bx - MAP_0x) )
LOC_0x = -140 - (-0.22 * (1000 - 0) )
LOC_0x = 80
Ok, so to get my x-coordinate as far as I understand it, I just have to plug my numbers into this formula;
Code:
(LOC_0x + LOC_x)
MAP_x = ---------------- + Map_0x - (IconW / 2)
wdpp_x
for x = 0
(80 + 0)
MAP_x = ---------------- + 0 - (2)
-0.22
MAP_x = -366 and Taco Program gives me an x-coordinate of 356.
Barring +/- sign, pretty close.
and for x = 40
(80 + 40)
MAP_x = ---------------- + 0 - (2)
-0.22
MAP_x = -547 and Taco Program gives me an x-coordinate of 178.
Anyone know what I'm missing, not understanding, or just plain screwing up?