Advertiser Content
Male
Seen 1 Day Ago
Posted 1 Week Ago
84 posts
5.3 Years
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?

DrFuji

Heiki Hecchara‌‌

Age 26
Male
Aussie
Seen 48 Minutes Ago
Posted 3 Hours Ago
1,602 posts
9.9 Years
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.
Male
Seen 1 Day Ago
Posted 1 Week Ago
84 posts
5.3 Years
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! ^__^

The Delta is coming...
Advertiser Content