The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Can someone help me locate the offset for the old man script in Viridian City.

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 May 24th, 2019 (7:51 AM).
SorasNobody's Avatar
SorasNobody SorasNobody is offline
 
Join Date: May 2019
Posts: 38
Im guessing his sprite is invisible by default because he doesn't show on advanced map but it has 9 person events and one 8 visiple sprites (as far as i can tell). Makes it hard for a noob like me to find the script. I am just looking to move him to the middle of the street as i moved it over to the left one so i must move the old man to the left one as well. I'm pretty sure I can copy/edit the script and find new space for it but any help would be appreciated. Pic for attention.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old May 24th, 2019 (3:01 PM).
DrFuji's Avatar
DrFuji DrFuji is offline
Heiki Hecchara‌‌
 
Join Date: Sep 2009
Location: Aussie
Age: 30
Gender: Male
Nature: Jolly
Posts: 1,693
The old man is an interesting event as it uses a feature that not many people know of. In Advance Map, he is person event number four - You can find him by clicking at the coordinates 0x15, 0x6 and you'll see that he's using picture number 240 rather than 32 like he should. This picture number is special as any OW with that as their picture number will change to a completely different OW based on the value of variable 0x4010. Another instance of this effect occurring is in Fuchsia City, where the Pokemon in the top-left Pokemon pen will be a Kabuto/ Omanyte depending on which Fossil you took back in Mount Moon. While that doesn't help move him like you want it too, it does help to explain parts of his script that I'll go over.

The old man's position is changed thanks to a level script in Viridian City which starts at 0x1658D9. Here's what it looks like and I've added some comments:

Code:
'---------------
#org 0x1658D9
setworldmapflag 0x891 // Allows you to fly to Viridian City when you meet the requirements
compare 0x4051 0x0 // Checks if you've delivered Oak's Parcel/ got the Pokedex
if 0x1 call 0x8165920
compare 0x4051 0x1 // Checks if you haven't been offered to learn how to catch Pokemon by the Old Man when leaving Viridian
if 0x1 call 0x816590F
compare 0x4051 0x2 // Checks if you have been offered to learn how to catch Pokemon by the Old Man when leaving Viridian
if 0x4 call 0x8165909
compare 0x405A 0x0 // Checks if Viridian Gym is open - Variable is actually set in this script
if 0x1 call 0x8165931
end

'---------------
#org 0x165920
setvar 0x4010 0x22 // Changes the OW to the Old Man lying down
movesprite2 0x4 0x15 0xB // Moves him to the spot closer to his daughter
spritebehave 0x4 0x8 // Makes him look down
return

'---------------
#org 0x16590F
setvar 0x4010 0x20 // Changes the OW to the Old Man standing up
movesprite2 0x4 0x15 0x8 // Moves him between his daughter and the exit to Route 2
spritebehave 0x4 0x1 // Makes him look around (this is redundant as he's set to look around anyway)
return

'---------------
#org 0x165909
setvar 0x4010 0x20// Changes the OW to the Old Man standing up
return

'---------------
#org 0x165931
checkflag 0x821
if 0x0 goto 0x81A77A9
checkflag 0x822
if 0x0 goto 0x81A77A9
checkflag 0x823
if 0x0 goto 0x81A77A9
checkflag 0x824
if 0x0 goto 0x81A77A9
checkflag 0x825
if 0x0 goto 0x81A77A9
checkflag 0x826
if 0x0 goto 0x81A77A9
setvar 0x405A 0x1 // Deactivates the script blocking Viridian Gym and gives the nearby Old Man different dialogue
return

'---------------
#org 0x1A77A9
return
You don't need to rewrite this level script or anything, you just need to change the 'movesprite2' commands so that the Old Man is shifted one tile to the left. You can then place his actual OW wherever you want and it will appear there once he's offered to teach you how to catch Pokemon.
__________________
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old May 28th, 2019 (11:36 AM). Edited May 30th, 2019 by DrFuji.
SorasNobody's Avatar
SorasNobody SorasNobody is offline
 
Join Date: May 2019
Posts: 38
Quote:
Originally Posted by DrFuji View Post
The old man is an interesting event as it uses a feature that not many people know of. In Advance Map, he is person event number four - You can find him by clicking at the coordinates 0x15, 0x6 and you'll see that he's using picture number 240 rather than 32 like he should. This picture number is special as any OW with that as their picture number will change to a completely different OW based on the value of variable 0x4010. Another instance of this effect occurring is in Fuchsia City, where the Pokemon in the top-left Pokemon pen will be a Kabuto/ Omanyte depending on which Fossil you took back in Mount Moon. While that doesn't help move him like you want it too, it does help to explain parts of his script that I'll go over.

The old man's position is changed thanks to a level script in Viridian City which starts at 0x1658D9. Here's what it looks like and I've added some comments:

Code:
'---------------
#org 0x1658D9
setworldmapflag 0x891 // Allows you to fly to Viridian City when you meet the requirements
compare 0x4051 0x0 // Checks if you've delivered Oak's Parcel/ got the Pokedex
if 0x1 call 0x8165920
compare 0x4051 0x1 // Checks if you haven't been offered to learn how to catch Pokemon by the Old Man when leaving Viridian
if 0x1 call 0x816590F
compare 0x4051 0x2 // Checks if you have been offered to learn how to catch Pokemon by the Old Man when leaving Viridian
if 0x4 call 0x8165909
compare 0x405A 0x0 // Checks if Viridian Gym is open - Variable is actually set in this script
if 0x1 call 0x8165931
end

'---------------
#org 0x165920
setvar 0x4010 0x22 // Changes the OW to the Old Man lying down
movesprite2 0x4 0x15 0xB // Moves him to the spot closer to his daughter
spritebehave 0x4 0x8 // Makes him look down
return

'---------------
#org 0x16590F
setvar 0x4010 0x20 // Changes the OW to the Old Man standing up
movesprite2 0x4 0x15 0x8 // Moves him between his daughter and the exit to Route 2
spritebehave 0x4 0x1 // Makes him look around (this is redundant as he's set to look around anyway)
return

'---------------
#org 0x165909
setvar 0x4010 0x20// Changes the OW to the Old Man standing up
return

'---------------
#org 0x165931
checkflag 0x821
if 0x0 goto 0x81A77A9
checkflag 0x822
if 0x0 goto 0x81A77A9
checkflag 0x823
if 0x0 goto 0x81A77A9
checkflag 0x824
if 0x0 goto 0x81A77A9
checkflag 0x825
if 0x0 goto 0x81A77A9
checkflag 0x826
if 0x0 goto 0x81A77A9
setvar 0x405A 0x1 // Deactivates the script blocking Viridian Gym and gives the nearby Old Man different dialogue
return

'---------------
#org 0x1A77A9
return
You don't need to rewrite this level script or anything, you just need to change the 'movesprite2' commands so that the Old Man is shifted one tile to the left. You can then place his actual OW wherever you want and it will appear there once he's offered to teach you how to catch Pokemon.
Thank you thank you thank you! I'm glad you went into detail I appreciate that a ton. I'm gonna go do that and i'll post a pic when i get it right! And thank you again!

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

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:19 AM.