The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script How to check does a specific Pokemon in the party have a nickname?

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 July 14th, 2019 (6:18 AM). Edited July 15th, 2019 by STikER.
STikER's Avatar
STikER STikER is offline
 
Join Date: May 2014
Location: Ukraine
Age: 23
Gender: Male
Posts: 275
Okay, I found few posts saying that it is possible in FireRed by using special 0x7B, which is used in the Name Rater script. So, I found the analogous special in Emerald (special 0x7E). Then, I tested both of them and they DO NOT check if Pokemon has a nickname or not. They just check if a new given nickname is the same to the old one or not. So, does anyone know how to do it?
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old July 15th, 2019 (3:51 AM).
DrFuji's Avatar
DrFuji DrFuji is offline
Heiki Hecchara‌‌
 
Join Date: Sep 2009
Location: Aussie
Age: 30
Gender: Male
Nature: Jolly
Posts: 1,693
You can do this in a bit of a roundabout way. It isn't pretty, but it works. This is for FR:

Spoiler:
#dynamic 0x800000

#org @start
special 0x9F // Choose the Pokemon whose nickname you want to check, result stored in 0x8004
special 0x7C // Puts the chosen Pokemon's nickname in buffer 0x0
special2 0x8000 0xFF // Puts the chosen Pokemon's species ID in 0x8000
bufferpokemon 0x1 0x8000 // Loads the the species name of the species ID in 0x8000 into buffer 0x1
comparefarbytes 0x2021CD0 0x2021CF0 // Long list of checks, comparing each sequential byte of buffers 0x0 and 0x1
if 0x5 goto @Different // If any of the checked bytes aren't equal, the party Pokemon has a different name to its species name
comparefarbytes 0x2021CD1 0x2021CF1
if 0x5 goto @Different
comparefarbytes 0x2021CD2 0x2021CF2
if 0x5 goto @Different
comparefarbytes 0x2021CD3 0x2021CF3
if 0x5 goto @Different
comparefarbytes 0x2021CD4 0x2021CF4
if 0x5 goto @Different
comparefarbytes 0x2021CD5 0x2021CF5
if 0x5 goto @Different
comparefarbytes 0x2021CD6 0x2021CF6
if 0x5 goto @Different
comparefarbytes 0x2021CD7 0x2021CF7
if 0x5 goto @Different
comparefarbytes 0x2021CD8 0x2021CF8
if 0x5 goto @Different
comparefarbytes 0x2021CD9 0x2021CF9
if 0x5 goto @Different
msgbox @SameName 0x2
end

#org @Different
msgbox @DifferentName 0x2
end

#org @SameName
= Same

#org @DifferentName
= Different


Initially I tried to use comparebanks command but it always gave a false reading when comparing banks 0x0/ 0x1 and crashed the script whenever I tried to use bank 0x2. That's why it looks really ugly with all of the comparefarbyte commands ;_;

You can use a similar script for Emerald. Just change special 0x9F to 0xA2 (plus a waitstate), special 0x7C to 0x7F and special 0xFF to 0x149. The starting pointers to buffers 0x0 and 0x1 are 0x2021CC4 and 0x2021DC4 respectively - Just add one to each iteration until you've gone through all of the comparefarbyte commands.
__________________
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old July 15th, 2019 (10:43 AM). Edited July 15th, 2019 by STikER.
STikER's Avatar
STikER STikER is offline
 
Join Date: May 2014
Location: Ukraine
Age: 23
Gender: Male
Posts: 275
Quote:
Originally Posted by DrFuji View Post
You can do this in a bit of a roundabout way. It isn't pretty, but it works. This is for FR:

Spoiler:
#dynamic 0x800000

#org @start
special 0x9F // Choose the Pokemon whose nickname you want to check, result stored in 0x8004
special 0x7C // Puts the chosen Pokemon's nickname in buffer 0x0
special2 0x8000 0xFF // Puts the chosen Pokemon's species ID in 0x8000
bufferpokemon 0x1 0x8000 // Loads the the species name of the species ID in 0x8000 into buffer 0x1
comparefarbytes 0x2021CD0 0x2021CF0 // Long list of checks, comparing each sequential byte of buffers 0x0 and 0x1
if 0x5 goto @Different // If any of the checked bytes aren't equal, the party Pokemon has a different name to its species name
comparefarbytes 0x2021CD1 0x2021CF1
if 0x5 goto @Different
comparefarbytes 0x2021CD2 0x2021CF2
if 0x5 goto @Different
comparefarbytes 0x2021CD3 0x2021CF3
if 0x5 goto @Different
comparefarbytes 0x2021CD4 0x2021CF4
if 0x5 goto @Different
comparefarbytes 0x2021CD5 0x2021CF5
if 0x5 goto @Different
comparefarbytes 0x2021CD6 0x2021CF6
if 0x5 goto @Different
comparefarbytes 0x2021CD7 0x2021CF7
if 0x5 goto @Different
comparefarbytes 0x2021CD8 0x2021CF8
if 0x5 goto @Different
comparefarbytes 0x2021CD9 0x2021CF9
if 0x5 goto @Different
msgbox @SameName 0x2
end

#org @Different
msgbox @DifferentName 0x2
end

#org @SameName
= Same

#org @DifferentName
= Different


Initially I tried to use comparebanks command but it always gave a false reading when comparing banks 0x0/ 0x1 and crashed the script whenever I tried to use bank 0x2. That's why it looks really ugly with all of the comparefarbyte commands ;_;

You can use a similar script for Emerald. Just change special 0x9F to 0xA2 (plus a waitstate), special 0x7C to 0x7F and special 0xFF to 0x149. The starting pointers to buffers 0x0 and 0x1 are 0x2021CC4 and 0x2021DC4 respectively - Just add one to each iteration until you've gone through all of the comparefarbyte commands.
You're such a savior! Thank you very much! It works perfectly! ^__^
__________________

ORAS and Emerald combined! | Familiar, but renewed Kanto!
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.