You are not logged in.
I always wondering why when i resize an outside map like New bark town, there will be a tree in the center of the town and i can't go to route 29 because there is a tree. I think this is because of the map connection. I've tried Megamap and Johtomap to edit it but always fails. So, i think editing it manually is the only way... But, can someone explain how they work and how to edit it? I really need help in doing this!
Last edited by Cloud (2011-03-24 00:32:58)
It's fine before i step in the connection. But,then...
I try to connect New Bark with Mahogany.
Last edited by Cloud (2011-02-03 10:03:31)
This is the information in JohtoMap:
Dest.bank = 02
Dest.map = 07
Width = 10
Height = 09
X = 09
Y = 04
OMDL = C730
CMPDL = C730
Dest.bank = 24
Dest.map = 04
Width = 10
Height = 09
X = 00
Y = 04
OMDL = C73D
CMPDL = C730
Umm, I'm not sure how to help you here. JohtoMap seems to miss the data pointer to the map's mapdata... At least it's not in the map connection dialog.
I'm guessing you got the map numbers right. Now, since this is a left-right connection, height is actually the height of the strip you see from the other map, so 0x09 seems fine here. Mahogany's width is 0x0A, so that seems fine. However, you mentioned that you resized New Bark Town, so the width might not be 0x0A anymore, screwing this up.
If the width still is 0x0A, we can go on:
Since both maps are 0x09 blocks in height and the exits match at Y = 0x00, your X and Y event lines for Mahogany should actually be X: 0x00; Y: 0x00, else you would have set New Bark Town 0x02 blocks above Mahogany (thus making events appear on the wrong location after changing maps again).
Now, since it's going to be a left connection from New Bark Town, the X event line should be (0x0A * 0x02) - 0x01 = 0x13, not 0x09. Since we don't want any block offset, Y line should be 0x00 again.
Now, OMDL is the target RAM location where the strip of the other map will be placed, starting from its top-left corner. Going left from New Bark Town:
0xC700 + (Width_of_current_Map + 0x06) * (Y_Offset_of_View_Strip_in_Blocks + 0x03).
As mentioned earlier we don't have a Y-offset. Width of New Bark Town is 0x0A, therefore: OMDL = 0xC700 + (0x0A + 0x06) * (0x00 + 0x03) = 0xC730, so that seems ok to me.
CMPDL is the top-left block you will see after changing the map. Since we use a left connection from New Bark Town's point of view, we will use this formula:
0xC706 + 0x02 * Width_of_connected_Map.
Width of Mahogany is 0x0A. Therefore OMDL = 0xC706 + 0x02 * 0x0A = 0xC71A != 0xC730, so I think your CMPDL is wrong. This means that after you've changed maps, blocks are going to start appearing as if you were lower on the map than you are.
Now for Mahogany:
Width of New Bark is 0x0A, or else all calculations are wrong anyway and you resized the map. Height of the view strip is 0x09, which is ok, since the map is 0x09 blocks high. X and Y event lines were dealt with above.
This is a right connection to New Bark Town from Mahogany's point of view, therefore for OMDL:
0xC6FD + (Width_of_current_Map + 0x06) * (Y_Offset_of_View_Strip_in_Blocks + 0x04)
OMDL = 0xC6FD + (0x0A + 0x06) * (0x00 + 0x04) = 0xC73D, which is what you put in there.
Now for after changing from Mahogany to New Bark Town:
We use 0xC707 + Width_of_connected_Map. CMPDL = 0xC707 + 0x0A = 0xC711 != 0xC730. Therefore, you will see blocks appearing as if you were lower on the New Bark Town map than you actually are and possibly as if you were outside of the map to the left.
This is shown very nicely in both of your pictures. Since the event lines were incorrect, too events will be loaded at the wrong spaces independently from blocks:
See this is exactly what happened. New Bark is treated to be lower and on the left of the map, while Mahogany is treated as you being to the lower and right-hand side of the map.
If you use the values in this thread and if you did not resize new Bark Town, you won't have any problem. The only thing to take care of is that you will have to calculate the view strip pointer manually and plug it in there, since JohtoMap seems to be missing a field for it.
Also, I want to mention that I object to these crass and inaccurate labels in JohtoMap, since they are very misleading.
Last edited by Tauwasser (2011-02-03 11:12:19)
I had this problem too when editing Viridian City. I always got trees blocking me from the routes.. o.O
Direction of the connection - Account for the correct value (Based on a connection at the edge of the current map)
Top 0xC703 + X displacement of the visible part in blocks
Below 0xC703 + (0x03 + Height of the current map) * (Width of the current map + 0x06) + X displacement of the visible part in blocks
Links 0xC700 + (0x06 + Width of the current map) * (Y shift of the visible part into blocks + 0x03)
Right 0xC6FD + (width of the current map + 0x06) * (Y shift of the visible part into blocks +0x04)
Last edited by Cloud (2011-03-25 00:28:24)
Y: Best (height of the attached map * 0x02) - 0x01 Below 0x00 Left / Right (Y shift of the visible part in blocks-0x02 *)
X: Up /Down (X shift of the visible part in blocks-0x02 *) links (X size of the attached Map * 0x02) - 0x01 Right 0x00
That actually answer all of my question. Thanks for the time.
Last edited by Cloud (2011-03-25 05:36:43)