The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Script where Professor Birch gives you the Pokedex

Notices
For all updates, view the main page.

Binary ROM Hacking Need 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.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old January 15th, 2019 (7:00 PM). Edited January 24th, 2019 by Avara.
Hillsy13's Avatar
Hillsy13 Hillsy13 is offline
 
Join Date: Aug 2016
Gender: Male
Posts: 157
Hacking Emerald, wanting to make Professor Birch give you the National dex at instead of the regular dex at the start of the game. Only problem is, I haven't been able to find the script where he gives it to you. I have checked the levels scripts for his lab, along with all scripts for person events in his lab. If knows anything that might help me find it I'd really appreciate it!
__________________
Pokémon Emerald Genesis [Beta 2.0]
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old January 16th, 2019 (10:54 AM). Edited January 16th, 2019 by SkyVortex.
SkyVortex's Avatar
SkyVortex SkyVortex is offline
 
Join Date: Jan 2017
Location: Ice Path
Gender: Male
Nature: Mild
Posts: 228
Hey man I think I've found where the scripts are. What I did was convert the beginning lines of dialogue to the game's alphabet in hex, and searched it up in HxD. Then I looked for any traces/pointers to the text to figure out what script calls the 'msgbox'. Next I used XSE to kind of trial-and-error it by decompiling the offsets repeatedly, counting backwards by 1 each time so I could locate the beginning of the main scripts. Eventually the scripts appeared with a normal structure, which is shown below. To be safe, I counted even further back when decompiling to make sure that they actually start at the offsets I found, so I'm almost completely sure these are their actual offsets. Only problem is that I don't know how they 'connect' to one another (as in after the first script is over the second starts with no break), only that each part of that dialogue begins with these offsets:

Script that runs immediately after exiting house post-game:
Spoiler:
//---------------
#org 0x1E7FB1
lockall
sound 0x15
applymovement 0x8 0x8272598
waitmovement 0x0
pause 0x50
msgbox 0x81E8DA2 MSG_KEEPOPEN //"PROF. BIRCH: Well, well, [player]\..."
closeonkeypress
clearflag 0x31A
clearflag 0x31B
pause 0x14
clearflag 0x4000
warp 0x1 0x4 0xFF 0x6 0x5
waitstate
releaseall
end


//---------
// Strings
//---------
#org 0x1E8DA2
= PROF. BIRCH: Well, well, [player]\v\h05!\nThat was good work out there!\pI knew there was something special\nabout you when I first saw you,\lbut I never expected this.\pOh, yes. Do you still have the POKéDEX\nI gave you?\pI have something to show you.\nLet's go to my LAB.


//-----------
// Movements
//-----------
#org 0x272598
#raw 0x56 //Exclamation Mark (!)
#raw 0xFE //End of Movements


Once the previous script warps you to the lab:
Spoiler:
//---------------
#org 0x1F9E80
lockall
pause 0x1E
msgbox 0x81FB16D MSG_KEEPOPEN //"PROF. BIRCH: Now[.]\p[player]\v\h0..."
closeonkeypress
applymovement 0x2 0x81F9F46
waitmovement 0x0
pause 0x14
sound 0x24
pause 0xA
sound 0x24
pause 0xA
sound 0x24
pause 0xA
sound 0x24
pause 0x14
applymovement 0x3 0x82725A8
applymovement MOVE_PLAYER 0x82725A4
waitmovement 0x0
checkgender
compare LASTRESULT 0x0
if 0x1 call 0x81F9F32
compare LASTRESULT 0x1
if 0x1 call 0x81F9F3C
sound 0x4
checksound
pause 0x14
applymovement 0x2 0x81F9F58
waitmovement 0x0
applymovement 0x3 0x82725A6
applymovement MOVE_PLAYER 0x82725A6
waitmovement 0x0
msgbox 0x81FB419 MSG_KEEPOPEN //"PROF. BIRCH: Okay, all done!"
fanfare 0x172
preparemsg 0x81FB436 //"[player]'s POKéDEX was upgraded\nt..."
waitmsg
waitfanfare
setflag 0x896
special 0x1F3
msgbox 0x81FB466 MSG_KEEPOPEN //"PROF. BIRCH: But listen.\nYou've b..."
closeonkeypress
setflag 0x31B
setflag 0x31A
setvar 0x40D3 0x2
setvar 0x40F5 0x0
setflag 0x72
releaseall
end

//---------------
#org 0x1F9F32
msgbox 0x81FB30F MSG_KEEPOPEN //"MAY: Eheheh!\pIt's so cool that ev..."
closeonkeypress
return

//---------------
#org 0x1F9F3C
msgbox 0x81FB38E MSG_KEEPOPEN //"BRENDAN: I went out all over HOENN..."
closeonkeypress
return


//---------
// Strings
//---------
#org 0x1FB16D
= PROF. BIRCH: Now[.]\p[player]\v\h05 and [rival], I've had the two\nof you help me study POKéMON.\pThanks to your help, new facts\nare coming to light.\pIt appears that in the HOENN region,\nthere are also POKéMON from other\lregions.\pIt goes to show how rich and varied\nthe natural environments of HOENN\lhappen to be.\pThat's why I think it's necessary for\nme to upgrade your POKéDEX to\lthe NATIONAL Mode.\pHere, let me see your POKéDEX units.

#org 0x1FB419
= PROF. BIRCH: Okay, all done!

#org 0x1FB436
= [player]'s POKéDEX was upgraded\nto the NATIONAL Mode!

#org 0x1FB466
= PROF. BIRCH: But listen.\nYou've become the CHAMPION,\lbut your POKéMON journey isn't over.\pThere is no end to the road\nthat is POKéMON.\pSomewhere, there is a grassy patch\nthat's waiting for you!

#org 0x1FB30F
= MAY: Eheheh!\pIt's so cool that even my POKéDEX\nis getting updated!\pIt's because you went out and caught\nso many POKéMON, [player]\v\h05!

#org 0x1FB38E
= BRENDAN: I went out all over HOENN\nand checked out POKéMON.\pYou can thank me for getting\nthe NATIONAL Mode POKéDEX.\pYep, you're lucky, [player]!


//-----------
// Movements
//-----------
#org 0x1F9F46
#raw 0xA //Step Left (Normal)
#raw 0x25 //Step on the Spot Down (Fastest)
#raw 0x14 //Delay5
#raw 0x14 //Delay5
#raw 0xB //Step Right (Normal)
#raw 0x25 //Step on the Spot Down (Fastest)
#raw 0x14 //Delay5
#raw 0x14 //Delay5
#raw 0xB //Step Right (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 0x26 //Step on the Spot Up (Fastest)
#raw 0xFE //End of Movements

#org 0x2725A8
#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

#org 0x1F9F58
#raw 0xA //Step Left (Normal)
#raw 0xA //Step Left (Normal)
#raw 0xA //Step Left (Normal)
#raw 0x9 //Step Up (Normal)
#raw 0x9 //Step Up (Normal)
#raw 0x9 //Step Up (Normal)
#raw 0x9 //Step Up (Normal)
#raw 0xA //Step Left (Normal)
#raw 0x25 //Step on the Spot Down (Fastest)
#raw 0xFE //End of Movements

#org 0x2725A6
#raw 0x26 //Step on the Spot Up (Fastest)
#raw 0xFE //End of Movements
__________________

My Twitch.TV Channel
My YouTube Channel
My AdventureQuest/BattleOn character (best viewed with a Flash Player extension enabled)
My OldSchool RuneScape character (if I'm online in-game, feel free to send me a message)

My Tutorials:
Stabilizing Pokemon Emerald (Preventing Corruption)
[Emerald] Controlling Trainer Battle Music... Without ASM
How to Fix the 64K Save 'White-Screen' in VBA Without Save-States

My ROM Hack:
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old January 16th, 2019 (12:10 PM). Edited January 16th, 2019 by Avara.
Avara's Avatar
Avara Avara is offline
 
Join Date: Dec 2011
Gender: Female
Nature: Relaxed
Posts: 1,305
Use special 0x1F3 to activate the national Dex in Emerald, like this:

Quote:
Originally Posted by Avara
#org @main
lock
faceplayer
special 0x1F3
msgbox @msg1 0x6
release
end

#org @msg1
= Your Pokédex was updated!
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old January 16th, 2019 (7:45 PM).
Hillsy13's Avatar
Hillsy13 Hillsy13 is offline
 
Join Date: Aug 2016
Gender: Male
Posts: 157
Quote:
Originally Posted by SkyVortex View Post
Hey man I think I've found where the scripts are. What I did was convert the beginning lines of dialogue to the game's alphabet in hex, and searched it up in HxD. Then I looked for any traces/pointers to the text to figure out what script calls the 'msgbox'. Next I used XSE to kind of trial-and-error it by decompiling the offsets repeatedly, counting backwards by 1 each time so I could locate the beginning of the main scripts. Eventually the scripts appeared with a normal structure, which is shown below. To be safe, I counted even further back when decompiling to make sure that they actually start at the offsets I found, so I'm almost completely sure these are their actual offsets. Only problem is that I don't know how they 'connect' to one another (as in after the first script is over the second starts with no break), only that each part of that dialogue begins with these offsets:

Script that runs immediately after exiting house post-game:
Spoiler:
//---------------
#org 0x1E7FB1
lockall
sound 0x15
applymovement 0x8 0x8272598
waitmovement 0x0
pause 0x50
msgbox 0x81E8DA2 MSG_KEEPOPEN //"PROF. BIRCH: Well, well, [player]\..."
closeonkeypress
clearflag 0x31A
clearflag 0x31B
pause 0x14
clearflag 0x4000
warp 0x1 0x4 0xFF 0x6 0x5
waitstate
releaseall
end


//---------
// Strings
//---------
#org 0x1E8DA2
= PROF. BIRCH: Well, well, [player]\v\h05!\nThat was good work out there!\pI knew there was something special\nabout you when I first saw you,\lbut I never expected this.\pOh, yes. Do you still have the POKéDEX\nI gave you?\pI have something to show you.\nLet's go to my LAB.


//-----------
// Movements
//-----------
#org 0x272598
#raw 0x56 //Exclamation Mark (!)
#raw 0xFE //End of Movements


Once the previous script warps you to the lab:
Spoiler:
//---------------
#org 0x1F9E80
lockall
pause 0x1E
msgbox 0x81FB16D MSG_KEEPOPEN //"PROF. BIRCH: Now[.]\p[player]\v\h0..."
closeonkeypress
applymovement 0x2 0x81F9F46
waitmovement 0x0
pause 0x14
sound 0x24
pause 0xA
sound 0x24
pause 0xA
sound 0x24
pause 0xA
sound 0x24
pause 0x14
applymovement 0x3 0x82725A8
applymovement MOVE_PLAYER 0x82725A4
waitmovement 0x0
checkgender
compare LASTRESULT 0x0
if 0x1 call 0x81F9F32
compare LASTRESULT 0x1
if 0x1 call 0x81F9F3C
sound 0x4
checksound
pause 0x14
applymovement 0x2 0x81F9F58
waitmovement 0x0
applymovement 0x3 0x82725A6
applymovement MOVE_PLAYER 0x82725A6
waitmovement 0x0
msgbox 0x81FB419 MSG_KEEPOPEN //"PROF. BIRCH: Okay, all done!"
fanfare 0x172
preparemsg 0x81FB436 //"[player]'s POKéDEX was upgraded\nt..."
waitmsg
waitfanfare
setflag 0x896
special 0x1F3
msgbox 0x81FB466 MSG_KEEPOPEN //"PROF. BIRCH: But listen.\nYou've b..."
closeonkeypress
setflag 0x31B
setflag 0x31A
setvar 0x40D3 0x2
setvar 0x40F5 0x0
setflag 0x72
releaseall
end

//---------------
#org 0x1F9F32
msgbox 0x81FB30F MSG_KEEPOPEN //"MAY: Eheheh!\pIt's so cool that ev..."
closeonkeypress
return

//---------------
#org 0x1F9F3C
msgbox 0x81FB38E MSG_KEEPOPEN //"BRENDAN: I went out all over HOENN..."
closeonkeypress
return


//---------
// Strings
//---------
#org 0x1FB16D
= PROF. BIRCH: Now[.]\p[player]\v\h05 and [rival], I've had the two\nof you help me study POKéMON.\pThanks to your help, new facts\nare coming to light.\pIt appears that in the HOENN region,\nthere are also POKéMON from other\lregions.\pIt goes to show how rich and varied\nthe natural environments of HOENN\lhappen to be.\pThat's why I think it's necessary for\nme to upgrade your POKéDEX to\lthe NATIONAL Mode.\pHere, let me see your POKéDEX units.

#org 0x1FB419
= PROF. BIRCH: Okay, all done!

#org 0x1FB436
= [player]'s POKéDEX was upgraded\nto the NATIONAL Mode!

#org 0x1FB466
= PROF. BIRCH: But listen.\nYou've become the CHAMPION,\lbut your POKéMON journey isn't over.\pThere is no end to the road\nthat is POKéMON.\pSomewhere, there is a grassy patch\nthat's waiting for you!

#org 0x1FB30F
= MAY: Eheheh!\pIt's so cool that even my POKéDEX\nis getting updated!\pIt's because you went out and caught\nso many POKéMON, [player]\v\h05!

#org 0x1FB38E
= BRENDAN: I went out all over HOENN\nand checked out POKéMON.\pYou can thank me for getting\nthe NATIONAL Mode POKéDEX.\pYep, you're lucky, [player]!


//-----------
// Movements
//-----------
#org 0x1F9F46
#raw 0xA //Step Left (Normal)
#raw 0x25 //Step on the Spot Down (Fastest)
#raw 0x14 //Delay5
#raw 0x14 //Delay5
#raw 0xB //Step Right (Normal)
#raw 0x25 //Step on the Spot Down (Fastest)
#raw 0x14 //Delay5
#raw 0x14 //Delay5
#raw 0xB //Step Right (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 0x26 //Step on the Spot Up (Fastest)
#raw 0xFE //End of Movements

#org 0x2725A8
#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

#org 0x1F9F58
#raw 0xA //Step Left (Normal)
#raw 0xA //Step Left (Normal)
#raw 0xA //Step Left (Normal)
#raw 0x9 //Step Up (Normal)
#raw 0x9 //Step Up (Normal)
#raw 0x9 //Step Up (Normal)
#raw 0x9 //Step Up (Normal)
#raw 0xA //Step Left (Normal)
#raw 0x25 //Step on the Spot Down (Fastest)
#raw 0xFE //End of Movements

#org 0x2725A6
#raw 0x26 //Step on the Spot Up (Fastest)
#raw 0xFE //End of Movements
Thanks for this! Do you happen to know the offset for the script where the player initially receives the hoenn pokedex as well?
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old January 16th, 2019 (7:46 PM).
Hillsy13's Avatar
Hillsy13 Hillsy13 is offline
 
Join Date: Aug 2016
Gender: Male
Posts: 157
Quote:
Originally Posted by Avara View Post
Use special 0x1F3 to activate the national Dex in Emerald, like this:
Thanks!
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old August 9th, 2019 (11:09 AM).
sweetcow3 sweetcow3 is offline
 
Join Date: Jul 2019
Posts: 1
I see that I'm half a year late but I found this thread because I was googling this problem myself. I too couldn't find where he gave the dex. I don't know if OP still needs it but I found it at 0x1FA2FB.
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 9:14 AM.