Jump to content

Text move abuse: Difference between revisions

Line 7:
The following is an example to copy 0x15 (21 in decimal) to D059 (D058 in Yellow), resulting in a battle with Mew.
 
*On the current map, redirect wMapTextPtr (item 40 quantity and item 4140 quantity) (D36C-D in Red/Blue and D36B-C in Yellow) to another location. For this example, we will be using Repel (anyEscape item)Rope x29in andYellow) TM11 (x any)211 (1ED3 (1DD3 in Yellow); the first inventory item) and Route 1.
*At the new location, NPC 1 will be the first two-byte pointer (i.e. the item and quantity at 1ED3 (1DD3 in Yellow)), NPC 2 will be the second two-byte pointer (i.e. the item and quantity at 1FD3 (1ED3 in Yellow)), and so on. In this case, the NPC who gives the Potion is NPC 1; so 1ED3/1DD3 (item 1 and item 1 quantity) will represent the text <u>source</u> of NPC 1. For this example, have item 1 as Thunder Stone x 211 (22 D3 (Red/Blue) or 21 D3 (Yellow).
*At the text source for the given NPC; represent text which uses text command 03. (Great Ball at item 3 in this case). Follow this the desired destination pointer with 00, desired bytes (other than text control characters) and 57. The bytes repesenting the text will be moved to the destination pointer. As an example, 03 59 (58 in Yellow) D0 00 15 57 (Great Ball x88, TM08 x 0 and BoulderBadge x 87) will move a single 15 to D059 (D058 in Red/Blue) (instant encounter with a Pokémon); resulting in a battle with Mew. Add more data before the 57 to copy more bytes (e.g. 03 59 (58 in Yellow) D0 00 15 16 57 writes 15 to D059/8 and 16 to D05A/9. Text [[control character#in-text|control characters (in-text)]] cannot be copied, but for control characters that print text, the derived text will (e.g. control character 4A will copy E1 (Pk) and E2 (Mn). 03 59 (58 in Yellow) D0 00 15 57 is Great Ball x 89 (88 in Yellow), TM08 x 0, BoulderBadge x 87.
Cookies help us deliver our services. By using our services, you agree to our use of cookies.