The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Battle FireRed: Script a Battle Between 2 NPCs (https://www.pokecommunity.com/showthread.php?t=413299)

DeathOrDoom0 September 8th, 2018 7:49 AM

FireRed: Script a Battle Between 2 NPCs
 
Does anyone know how to do this for FireRed?

BirdstarCat13 September 9th, 2018 4:16 AM

Script an event that involves 2 NPCs talking to te player, then trigger a double battle. Kind of simple

DeathOrDoom0 September 9th, 2018 4:45 AM

Quote:

Originally Posted by BirdstarCat13 (Post 9923601)
Script an event that involves 2 NPCs talking to te player, then trigger a double battle. Kind of simple

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

Koople September 9th, 2018 10:00 AM

Quote:

Originally Posted by DeathOrDoom0 (Post 9923214)
Does anyone know how to do this for FireRed?

Is the player controlling one of the NPCs, or are you intending for it to be a cutscene? The former would be relatively easy, the latter quite difficult.

DeathOrDoom0 September 9th, 2018 10:05 AM

Quote:

Originally Posted by Koople (Post 9923756)
Is the player controlling one of the NPCs, or are you intending for it to be a cutscene? The former would be relatively easy, the latter quite difficult.

If the player controls the NPC that would work

Koople September 9th, 2018 11:15 AM

Quote:

Originally Posted by DeathOrDoom0 (Post 9923764)
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!

DeathOrDoom0 September 9th, 2018 11:56 AM

Quote:

Originally Posted by Koople (Post 9923803)
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!

BirdstarCat13 September 9th, 2018 5:08 PM

Quote:

Originally Posted by DeathOrDoom0 (Post 9923612)
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.

DeathOrDoom0 September 9th, 2018 6:18 PM

Quote:

Originally Posted by BirdstarCat13 (Post 9923969)
That wasn't very clear...making a battle with two NPCs against each other doesn't seem very useful.

It's useful if you're telling a story and using it as a device for telling a story


All times are GMT -8. The time now is 9:13 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.