• 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] Check if a type's in the team

Elfyer

Veteran
15
Posts
16
Days
  • Age 28
  • Seen yesterday
Hi everyone!
After many years far from pokémon hacking, I was wondering: is there a script/mod/engine that can make a npc check if a certain type or pokémon is in the player's team?
I'd like to make a rom with specific trait: to become the very best you need to master every type of Pokémon, so you can fight gym leaders of a type only with Pokémons of that type. Let's suppose you wanna fight Brock/Takeshi: you need to have only rock type on your team (or, of course, Pokémon that are 2-types, one being rock).
Is there anything that can do something useful for this purpose?

I'm talking about LF/FR, but I'd hack even other games if it's possible only on them.

Thanks y'all, even if you just read my post (there's a piece of my heart inside, be careful not to bring it with you)
 
1,770
Posts
15
Years
An inefficient and highly conditional method for this would be:

If it's early enough in the game, you'll know what Pokemon are available to the player, so you can simply check if any of those Pokemon (that happen to be of a specific type) are in the player's party.

Of course, it'd be much more efficient to check for a specific type in the party. Off the top of my head, I can't think of any instances in the 3rd gen games where an NPC checks for a specific type in your party… in theory it's simple enough that it should be possible, but I'm unsure if there are any existing commands for it.
 

Elfyer

Veteran
15
Posts
16
Days
  • Age 28
  • Seen yesterday
An inefficient and highly conditional method for this would be:

If it's early enough in the game, you'll know what Pokemon are available to the player, so you can simply check if any of those Pokemon (that happen to be of a specific type) are in the player's party.

Of course, it'd be much more efficient to check for a specific type in the party. Off the top of my head, I can't think of any instances in the 3rd gen games where an NPC checks for a specific type in your party… in theory it's simple enough that it should be possible, but I'm unsure if there are any existing commands for it.
Thank you very much for your reply! I thought exactly the same thing.
1) I can't think of any occurrences with an npc controlling the type of Pokémon either, unfortunately.
2) I imagined you could check the Pokémon on the team (e.g. if there's a Ponyta or the like), but can you put that many Pokémon among the checks? If so, what's the script?
 
1,770
Posts
15
Years
Thank you very much for your reply! I thought exactly the same thing.
1) I can't think of any occurrences with an npc controlling the type of Pokémon either, unfortunately.
2) I imagined you could check the Pokémon on the team (e.g. if there's a Ponyta or the like), but can you put that many Pokémon among the checks? If so, what's the script?
I'm sorry, I work in coding now and my ROM hacking background is... very far in the past, so bear with me!

I can think of a couple of NPCs in FireRed that check your party for specific Pokémon, one way or another:
- The Fisherman in the house on Route 12. I believe he gives you a Super Rod, and after that he'll ask you to show him a "large" Magikarp. The important factor, is he specifically asks to see a Magikarp, meaning you have to have one in your party and select it to show him.
- There's a guy in a house on Water Path who wants to see a large Heracross; same process as the Magikarp.
- Any NPC that wants to trade (such as the man with the Jynx in the house next to Cerulean City's Pokémon Center, or the NPCs in Cinnabar's Lab).

In each of these cases, the party is opened, the player selects a Pokémon, and if it doesn't fit the criteria, the player can't progress.

In your case, you can absolutely just set a condition for all the possible Pokémon of certain types, and have the players select a Pokémon from their party. If the Pokémon isn't on your list, they can't proceed.

Again, it's definitely not the most efficient way to do this, but using the existing game code it's totally possible this way.
 

Elfyer

Veteran
15
Posts
16
Days
  • Age 28
  • Seen yesterday
I'm sorry, I work in coding now and my ROM hacking background is... very far in the past, so bear with me!

I can think of a couple of NPCs in FireRed that check your party for specific Pokémon, one way or another:
- The Fisherman in the house on Route 12. I believe he gives you a Super Rod, and after that he'll ask you to show him a "large" Magikarp. The important factor, is he specifically asks to see a Magikarp, meaning you have to have one in your party and select it to show him.
- There's a guy in a house on Water Path who wants to see a large Heracross; same process as the Magikarp.
- Any NPC that wants to trade (such as the man with the Jynx in the house next to Cerulean City's Pokémon Center, or the NPCs in Cinnabar's Lab).

In each of these cases, the party is opened, the player selects a Pokémon, and if it doesn't fit the criteria, the player can't progress.

In your case, you can absolutely just set a condition for all the possible Pokémon of certain types, and have the players select a Pokémon from their party. If the Pokémon isn't on your list, they can't proceed.

Again, it's definitely not the most efficient way to do this, but using the existing game code it's totally possible this way.
I don't really know how to thank you! As soon as I can (damn work needed to afford living) I'll look for these npc and if I can edit the script properly.
Again, thank you so much:plead:
 
1,770
Posts
15
Years
I don't really know how to thank you! As soon as I can (damn work needed to afford living) I'll look for these npc and if I can edit the script properly.
Again, thank you so much:plead:
No problem! Again, it's probably not the cleanest way to do it, but at the end of the day it should get the job done.

I also asked in the PokéCommunity Discord, which has ROM Hacking sections. This is the answer someone gave me:

That special stores the ID of the party slot selected in the var 0x8004.
You can use the `specialvar VAR_VALUE 0xBA` after it, in order to get the species and store it in a variable.

Ex:
```
special 0x9F
waitstate
special2 0x8005 0xBA
compare 0x8005 0x4
if 0x1 goto @Charmander
```
**EDIT**: Oopsie. I forgot in binary `specialvar` is `special2` 😛
Without looking at the scripts myself I can't say for certain how to apply this, but it may be useful in your attempt.

Good luck!
 

Elfyer

Veteran
15
Posts
16
Days
  • Age 28
  • Seen yesterday
No problem! Again, it's probably not the cleanest way to do it, but at the end of the day it should get the job done.
I also asked in the PokéCommunity Discord, which has ROM Hacking sections. This is the answer someone gave me:
Without looking at the scripts myself I can't say for certain how to apply this, but it may be useful in your attempt.
Good luck!
Thanks so much for asking on the discord too! I'll give a try to this as well. My only doubt is that with this, since there are not 6 Pokémon for every type, do get what I want I should check for Pokémon (of other types) NOT being in the team. But if it's the best I got, I'll make it make sense jaja
 
Back
Top