Script Pokemon Emerald First Encounter With Norman
Binary ROM HackingNeed a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.
Okay so, I've been sitting on this for like 4 hours now and looked for help all around and nothing seems to fix my problem. (I'm using Pokemon Emerald)
My goal:
After the catching tutorial, I want the player to have a level 5 Ralts in his party, obtain the Pokedex, and Running shoes.
Note: The player begins the catching tutorial with 0 Pokemon and can't access the Pokemon menu.
What I tried:
I found out that in Norman's gym, on advanced map, header tab, script 3 is what happens after the catching tutorial. This is the original script
Spoiler:
'---------------
#org 0x2049A4
lockall
msgbox 0x8205B32 MSG_KEEPOPEN '"DAD: So, did it work out?"
msgbox 0x8205B4C MSG_KEEPOPEN '"WALLY: Thank you, yes, it did.\nHe..."
closeonkeypress
applymovement MOVE_PLAYER 0x82725AA
applymovement 0xA 0x82049EC
waitmovement 0x0
sound 0x9
hidesprite 0xA
setflag 0x2D6
pause 0x1E
applymovement MOVE_PLAYER 0x82725A6
waitmovement 0x0
msgbox 0x8205C40 MSG_KEEPOPEN '"DAD: Now[.]\p[player], if you want..."
setvar 0x4085 0x2
releaseall
end
'---------
' Strings
'---------
#org 0x205B32
= DAD: So, did it work out?
#org 0x205B4C
= WALLY: Thank you, yes, it did.\nHere's your POKéMON back.\p[player], thank you for coming along\nwith me.\pYou two are why I was able to catch\nmy POKéMON.\pI promise I'll take really good\ncare of it.\pOh! My mom's waiting for me,\nso I have to go!\pBye, [player]!
#org 0x205C40
= DAD: Now[.]\p[player], if you want to become a\nstrong TRAINER, here's my advice.\pHead for RUSTBORO CITY beyond this\ntown.\pThere, you should challenge\nthe GYM LEADER, ROXANNE.\pAfter her, go on to other POKéMON\nGYMS and defeat their LEADERS.\pCollect BADGES from them,\nunderstood?\pOf course, I'm a GYM LEADER, too.\nWe'll battle one day, [player].\pBut that's only after you become\nstronger.
'-----------
' Movements
'-----------
#org 0x2725AA
#raw 0x25 'Step on the Spot Down (Fastest)
#raw 0xFE 'End of Movements
#org 0x2049EC
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x14 'Delay5
#raw 0xFE 'End of Movements
#org 0x2725A6
#raw 0x26 'Step on the Spot Up (Fastest)
#raw 0xFE 'End of Movements
If I add this line in order to give the player the Ralts:
givepokemon 0x118 0x5 0x0 0x0 0x0 0x0
It deletes a few lines from the the end of the code, including the release and end lines, which means it loops. Also, for some reason, it says "added aqua grunt to pokenav" before looping to the text again.
I found the line:
bufferfirstpokemon 0x0
I assumed that this line makes it so you can see the Pokemon tab at your menu when you receive your first Pokemon (found it at Birch's lab) but no success there.
I thought that I'm overwriting some scripts, so, in the beginning of the code, I added the lines:
#freespace 0xFF
#dynamic 0xE3D221
#org @start
Of course, when I tried these, I deleted the first "#org @0x2049A4" line from the original code.
The results: Sometime I was able to compile, but results unchanged, and other times, it couldn't compile because no memory.
I've seen a bunch of tutorials, read a ton of guides at this forum and I'll admit I'm stuck. Gonna need someone to hold my hand through this one, or better yet, manage to explain to me what am I doing wrong.
Okay so, I've been sitting on this for like 4 hours now and looked for help all around and nothing seems to fix my problem. (I'm using Pokemon Emerald)
My goal:
After the catching tutorial, I want the player to have a level 5 Ralts in his party, obtain the Pokedex, and Running shoes.
Note: The player begins the catching tutorial with 0 Pokemon and can't access the Pokemon menu.
What I tried:
I found out that in Norman's gym, on advanced map, header tab, script 3 is what happens after the catching tutorial. This is the original script
Spoiler:
'---------------
#org 0x2049A4
lockall
msgbox 0x8205B32 MSG_KEEPOPEN '"DAD: So, did it work out?"
msgbox 0x8205B4C MSG_KEEPOPEN '"WALLY: Thank you, yes, it did.\nHe..."
closeonkeypress
applymovement MOVE_PLAYER 0x82725AA
applymovement 0xA 0x82049EC
waitmovement 0x0
sound 0x9
hidesprite 0xA
setflag 0x2D6
pause 0x1E
applymovement MOVE_PLAYER 0x82725A6
waitmovement 0x0
msgbox 0x8205C40 MSG_KEEPOPEN '"DAD: Now[.]\p[player], if you want..."
setvar 0x4085 0x2
releaseall
end
'---------
' Strings
'---------
#org 0x205B32
= DAD: So, did it work out?
#org 0x205B4C
= WALLY: Thank you, yes, it did.\nHere's your POKéMON back.\p[player], thank you for coming along\nwith me.\pYou two are why I was able to catch\nmy POKéMON.\pI promise I'll take really good\ncare of it.\pOh! My mom's waiting for me,\nso I have to go!\pBye, [player]!
#org 0x205C40
= DAD: Now[.]\p[player], if you want to become a\nstrong TRAINER, here's my advice.\pHead for RUSTBORO CITY beyond this\ntown.\pThere, you should challenge\nthe GYM LEADER, ROXANNE.\pAfter her, go on to other POKéMON\nGYMS and defeat their LEADERS.\pCollect BADGES from them,\nunderstood?\pOf course, I'm a GYM LEADER, too.\nWe'll battle one day, [player].\pBut that's only after you become\nstronger.
'-----------
' Movements
'-----------
#org 0x2725AA
#raw 0x25 'Step on the Spot Down (Fastest)
#raw 0xFE 'End of Movements
#org 0x2049EC
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x14 'Delay5
#raw 0xFE 'End of Movements
#org 0x2725A6
#raw 0x26 'Step on the Spot Up (Fastest)
#raw 0xFE 'End of Movements
If I add this line in order to give the player the Ralts:
givepokemon 0x118 0x5 0x0 0x0 0x0 0x0
It deletes a few lines from the the end of the code, including the release and end lines, which means it loops. Also, for some reason, it says "added aqua grunt to pokenav" before looping to the text again.
I found the line:
bufferfirstpokemon 0x0
I assumed that this line makes it so you can see the Pokemon tab at your menu when you receive your first Pokemon (found it at Birch's lab) but no success there.
I thought that I'm overwriting some scripts, so, in the beginning of the code, I added the lines:
#freespace 0xFF
#dynamic 0xE3D221
#org @start
Of course, when I tried these, I deleted the first "#org @0x2049A4" line from the original code.
The results: Sometime I was able to compile, but results unchanged, and other times, it couldn't compile because no memory.
I've seen a bunch of tutorials, read a ton of guides at this forum and I'll admit I'm stuck. Gonna need someone to hold my hand through this one, or better yet, manage to explain to me what am I doing wrong.
Thanks in advance(d map)
Actually, that's not the script you're looking for. The one you should be interested in is at 0x1DC32E. Decompiled via XSE:
Spoiler:
'---------------
#org 0x1DC32E
lockall
special 0x28 //save whole player party
special 0x12F //creates zigzagoon in user's party
applymovement 0x2 0x81DC451
applymovement 0xFF 0x81DC430
waitmovement 0x0
msgbox 0x81EC1F8 0x4 '"WALLY: [player][.]\nPOKéMON hide i..."
special 0xA0 //creates the whole battle
waitstate
msgbox 0x81EC271 0x4 '"WALLY: I did it[.] It's my[.]\nMy ..."
applymovementpos 0x2 0x82725A4 0x0 0x0
waitmovementpos 0x2 0x0 0x0
msgbox 0x81EC297 0x4 '"[player], thank you!\nLet's go bac..."
closeonkeypress
clearflag 0x4000
setvar 0x4057 0x3
fadedefault
clearflag 0x4001
special 0x29 //returns saved pokemon in special 0x28
setvar 0x4085 0x1
warp 0x8 0x1 0xFF 0x4 0x6C
waitstate
releaseall
end
'---------
' Strings
'---------
#org 0x1EC1F8
= WALLY: [player][.]\nPOKéMON hide in tall grass like this,\ldon't they?\pPlease watch me and see if I can\ncatch one properly.\p[.]Whoa!
#org 0x1EC271
= WALLY: I did it[.] It's my[.]\nMy POKéMON!
#org 0x1EC297
= [player], thank you!\nLet's go back to the GYM!
'-----------
' Movements
'-----------
#org 0x1DC451
#raw 0x13 'Delay4
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0x14 'Delay5
#raw 0x26 'Step on the Spot Up (Fastest)
#raw 0x14 'Delay5
#raw 0x14 'Delay5
#raw 0x28 'Step on the Spot Right (Fastest)
#raw 0xFE 'End of Movements
#org 0x1DC430
#raw 0x13 'Delay4
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x28 'Step on the Spot Right (Fastest)
#raw 0xFE 'End of Movements
#org 0x2725A4
#raw 0x27 'Step on the Spot Left (Fastest)
#raw 0xFE 'End of Movements
Also, a little tip for editing already existing scripts. It's mostly done this way:
1. Find where you want your script to edit.
2. Delete at least 5 bytes and replace it with goto to your custom script.
3. In your new script make sure to include the 5 bytes you erased earlier and add your new thing.
4. At the end of the script place a goto to somewhere in the old script or just end it.
Actually, that's not the script you're looking for. The one you should be interested in is at 0x1DC32E. Decompiled via XSE:
Spoiler:
'---------------
#org 0x1DC32E
lockall
special 0x28 //save whole player party
special 0x12F //creates zigzagoon in user's party
applymovement 0x2 0x81DC451
applymovement 0xFF 0x81DC430
waitmovement 0x0
msgbox 0x81EC1F8 0x4 '"WALLY: [player][.]\nPOKéMON hide i..."
special 0xA0 //creates the whole battle
waitstate
msgbox 0x81EC271 0x4 '"WALLY: I did it[.] It's my[.]\nMy ..."
applymovementpos 0x2 0x82725A4 0x0 0x0
waitmovementpos 0x2 0x0 0x0
msgbox 0x81EC297 0x4 '"[player], thank you!\nLet's go bac..."
closeonkeypress
clearflag 0x4000
setvar 0x4057 0x3
fadedefault
clearflag 0x4001
special 0x29 //returns saved pokemon in special 0x28
setvar 0x4085 0x1
warp 0x8 0x1 0xFF 0x4 0x6C
waitstate
releaseall
end
'---------
' Strings
'---------
#org 0x1EC1F8
= WALLY: [player][.]\nPOKéMON hide in tall grass like this,\ldon't they?\pPlease watch me and see if I can\ncatch one properly.\p[.]Whoa!
#org 0x1EC271
= WALLY: I did it[.] It's my[.]\nMy POKéMON!
#org 0x1EC297
= [player], thank you!\nLet's go back to the GYM!
'-----------
' Movements
'-----------
#org 0x1DC451
#raw 0x13 'Delay4
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0x14 'Delay5
#raw 0x26 'Step on the Spot Up (Fastest)
#raw 0x14 'Delay5
#raw 0x14 'Delay5
#raw 0x28 'Step on the Spot Right (Fastest)
#raw 0xFE 'End of Movements
#org 0x1DC430
#raw 0x13 'Delay4
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0x8 'Step Down (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x28 'Step on the Spot Right (Fastest)
#raw 0xFE 'End of Movements
#org 0x2725A4
#raw 0x27 'Step on the Spot Left (Fastest)
#raw 0xFE 'End of Movements
Also, a little tip for editing already existing scripts. It's mostly done this way:
1. Find where you want your script to edit.
2. Delete at least 5 bytes and replace it with goto to your custom script.
3. In your new script make sure to include the 5 bytes you erased earlier and add your new thing.
4. At the end of the script place a goto to somewhere in the old script or just end it.
I took the script you gave me
#org 0x1DC32E
lockall
special 0x28 //save whole player party
special 0x12F //creates zigzagoon in user's party
applymovement 0x2 0x81DC451
applymovement 0xFF 0x81DC430
waitmovement 0x0
msgbox 0x81EC1F8 0x4 '"WALLY: [player][.]\nPOKéMON hide i..."
special 0xA0 //creates the whole battle
waitstate
msgbox 0x81EC271 0x4 '"WALLY: I did it[.] It's my[.]\nMy ..."
applymovementpos 0x2 0x82725A4 0x0 0x0
waitmovementpos 0x2 0x0 0x0
msgbox 0x81EC297 0x4 '"[player], thank you!\nLet's go bac..." closeonkeypress //turned that into goto 0x86B4704
clearflag 0x4000
setvar 0x4057 0x3
fadedefault
clearflag 0x4001
special 0x29 //returns saved pokemon in special 0x28
setvar 0x4085 0x1
warp 0x8 0x1 0xFF 0x4 0x6C
waitstate
releaseall
end
Erased from "closeonkeypress" (bolded for reference) and wrote goto "0x86B4704"
In a completely different map, I created a person, and gave him the following script
'---------------
#org 0x6B4704
closeonkeypress
clearflag 0x4000
setvar 0x4057 0x3
fadedefault
clearflag 0x4001
special 0x29
setvar 0x4085 0x1
warp 0x8 0x1 0xFF 0x4 0x6C
waitstate
setflag 0x860
setflag 0x861
setflag 0x8C0
givepokemon 0x280 0x5 0x0 0x0 0x0 0x0
releaseall
end
Results: Nothing. It's working as if I've done nothing to change it.
Note: I tried both givepokemon 0x280..........(decimal) and givepokemon 0x118...........(hex)