![]() |
[Fire Red] Is there a way to continue an event script after a trainer battle?
Hey all, glad you stopped by! Title is explanatory enough; I want to have an event script continue running after a trainer battle. I've tried everything I can think of to no avail. I then reverse-engineered a script from the base game where the player battles his rival. The only thing different I could see was that the script called the trainer battle and then returned to the main body. I tried that, and the script still ends. I also tried changing the trainer battle type from the usual 0x0 to the rival's 0x9 just to see what it would do, and nothing changed. Here's my code:
Spoiler:
TL;DR of that code: an NPC is startled by the player, grabs some fossils (the hidesprite commands), battles the player, gives the player the Helix Fossil, and runs off. Anyone have any past experience with this, or maybe some experimental ideas? I'm stumped. Thanks all for reading <3 |
It's based on trainer battle types. There are two trainer battle types (iirc) that can continue the script after the player wins.
The first is trainer battle 0x1. You can use that like this: trainerbattle 0x1 0x01 0x0 @Challenge @Defeat @Victory With @Victory leading to the script that runs after you win. This is mostly used for gym leaders in the original game. The second is trainer battle 0x3, which isn't something I've personally tested so I'd probably recommend you use the first one. From what I've been told, however, this command doesn't stop the current script. trainerbattle 0x3 0x01 0x0 @Defeat ... The ellipses can just be replaced with the rest of the script you're running after you win, so you never jump to a different pointer. Again, not sure if this one has any problems though. 0x1 should do the trick without a hitch. EDIT: Actually, the 0x9 you're using should also have this second functionality now that I think about it... Try using a goto @Victory right after your trainerbattle if you'd prefer to use 0x9 |
| All times are GMT -8. The time now is 9:17 AM. |
![]()
© 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.