Jump to content

Custom maps: Difference between revisions

no edit summary
>Torchickens
No edit summary
>Torchickens
No edit summary
Line 16:
[[File:RB Subtile table1.png|400px]]
 
The little endian pointer to the top-left map block on the screen is stored at D35ED35F/D35FD360 (D35E/D35D/D35E in Yellow) and is adjusted when the player is walking around. This pointer can be changed to RAM by adjusting item 33 and item 33 quantity. This method while applying the changes while the menu is opened, does not immediately do so while the menu is closed (unless the player walks around to load the new data). However, the data can be applied by using glitch item [[ItemDex/Y:094|9F (0x5E)]] in English Yellow, or by swapping an X Attack x18 into item 41 in English Red/Blue (the latter forces the map script to load it).
 
Normally, D35ED35F/D360 points to RAM anyway and the game writes to the relevant address after a normal map is loaded. Hence, an alternative method for creating a custom map is to write to the intended RAM address (for example the region around C6F9+ in Pallet Town). To create a sense of permanency, the player can use a [[MetascriptDex|meta map script in RAM]] to call copydata to constantly write to this data, even after leaving and returning to the map (as long as the altered meta map script is kept).
 
Additional features to the map can be added by making the arbitrary code execution program alter the following addresses:
Line 25:
*D8A4 (or D8A3): The start of wild water Pokémon data. All maps use sub-tile 0x14 as the water-tile.
*D36C-D36D (or D36B-D36C): The text pointer table location for each NPC. This two byte pointer should point to an address itself a list of two byte pointers in the map's text box index number order (when reading a sign/talking to an NPC this is stored at FF8C).
*D36E-D36F (or D36D-D36F): The "level-script pointer". It is basically a little endian pointer to a script that is run continuously when the menu is closed (which is also an ideal arbitrary code execution method through adjusting item 41 in the expanded inventory). The bank of the script for pointers ranging between 4000-7FFF depends on the currently loaded map at D35E/D (see [[bp:List of locations by index number (Generation I)|this article on Bulbapedia for each map's bank]]).
*D35E/D: The currently stored map. Upon changing it, this will control the palette, Town Map name/position on map; however, this will not warp the player automatically (the player can however warp instantly using the previously mentioned 9F or X Attack x18 methods but data like coordinates D361-D362 (-1), coordinate block D363-D364 (-1) may have to be adjusted with it).
*D367 (or D366): "wCurMapTileset", although changes will not be applied to the tileset. This address however modifies field move permissions. 0x00 indicates that the player can Fly and Teleport away. 0x06 is used for buildings where it is impossible to escape with any field move. 0x11 is for dungeons/in-door places where it is possible to Dig or Escape Rope away.
*D35B/A: Music played on map. These changes are not automatic, so including code in the map script to play it may be a reasonable idea.{{elaborate}} A list of values can be found in the Pastebin paste [https://pastebin.com/1epAd2aT here]
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.