• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • 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.

[Battle] FireRed: Script a Battle Between 2 NPCs

Script an event that involves 2 NPCs talking to te player, then trigger a double battle. Kind of simple
 
If the player controls the NPC that would work

In this case you can do something like the following (in a script)
1. save the player's pokemon data somewhere (free ram, see FBI's portable storage system for example)
2. give the player the NPC's pokemon (givepokemon should work)
3. swap the player's battle backsprite with the NPCs (use JPANs engine or this routine)
4. initiate the trainer battle
5. after the battle, delete the given pokemon (JPANs engine special or see this thread)
6. get the player's original pokemon back (eg. the portable storage system again)

You will probably want to allow the game to continue in the event the player loses the trainer battle, which means using Oak's tutorial battle (you can toggle the tutorial text with this or just allow continuation via a flag)

This might look like a lot but you'll learn a lot by getting it all to work. Good luck!
 
In this case you can do something like the following (in a script)
1. save the player's pokemon data somewhere (free ram, see FBI's portable storage system for example)
2. give the player the NPC's pokemon (givepokemon should work)
3. swap the player's battle backsprite with the NPCs (use JPANs engine or this routine)
4. initiate the trainer battle
5. after the battle, delete the given pokemon (JPANs engine special or see this thread)
6. get the player's original pokemon back (eg. the portable storage system again)

You will probably want to allow the game to continue in the event the player loses the trainer battle, which means using Oak's tutorial battle (you can toggle the tutorial text with this or just allow continuation via a flag)

This might look like a lot but you'll learn a lot by getting it all to work. Good luck!

Thank you!
 
Why would a double battle work? I want an NPC vs. another NPC.

That wasn't very clear...making a battle with two NPCs against each other doesn't seem very useful.
 
Back
Top