• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Script] NPC Requests to See a Specific Pokemon Script?

7
Posts
4
Years
Hey guys,

I've been looking everywhere to try and figure out how I can implement a simple script into my Rom Hack that would play out like this, for example:

NPC: "I think Onix is the coolest! If you show me one, I'll give you something special."

*Player has Onix in party*

NPC: "Oh, wow, an Onix, thanks! Here you go, as promised!"

*NPC gives player Metal Coat or other item*

I'm fairly certain that these types of scripts exist even in the base game (Fire Red), and I've tried looking at some of the scripts in Pokemon Gaia, but they're already compiled and it's hard for me to make sense of them. Can anyone explain how to implement this and give me an example to go with it? I would really appreciate it.
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
In FR, the command 'special2 0xYYYY 0x147' will return the ID number of a Pokemon in your party to variable 0xYYYY. It takes the value of 0x8004, ranging between values 0x0 and 0x5 to determine which party member's ID number it should return. Knowing this, you can make a script with a simple loop which will gradually increment the value of 0x8004 until it has checked every party member's ID and branch out when the game finds an Onix. Here's a quick one that I whipped up for you with some comments to explain how it works:

Spoiler:


Hopefully that helps.
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
Yup, in Emerald special 0x149 works in exactly the same way as 0x147 in FR.
 
124
Posts
8
Years
  • Age 38
  • Seen Apr 5, 2024
Now i understand thats how it checks a pkmn in ur party...but how would it check if i caught it, and not in my party?

For FR, please
 
7
Posts
4
Years
In FR, the command 'special2 0xYYYY 0x147' will return the ID number of a Pokemon in your party to variable 0xYYYY. It takes the value of 0x8004, ranging between values 0x0 and 0x5 to determine which party member's ID number it should return. Knowing this, you can make a script with a simple loop which will gradually increment the value of 0x8004 until it has checked every party member's ID and branch out when the game finds an Onix. Here's a quick one that I whipped up for you with some comments to explain how it works:

Spoiler:


Hopefully that helps.

Sorry for the late reply, but holy shit, thank you! This was extremely helpful, I appreciate it so much!
 
Back
Top