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)
-   -   Script [Emerald] A trainer battle is occurring twice when there's no clear indication in the script of a repeated battle. (https://www.pokecommunity.com/showthread.php?t=445276)

ShinyTillDawn February 10th, 2021 5:04 AM

[Emerald] A trainer battle is occurring twice when there's no clear indication in the script of a repeated battle.
 
1 Attachment(s)
I'm very sorry for posting so many help threads. But I literally could not find another thread from searching that has someone else dealing with this same problem.
In the attached script, it's basically the character entering the champion's room and triggering almost the same thing as base Emerald's Wallace battle, but with a different trainer, instead.
What happens is, after the opening dialogue, the player gets thrown into the battle, as expected, with different music thanks to "playsong". But after victory, it does the battle again! Even though, I only put the "trainerbattle" command on 1 line of code, and followed that with "setflag" and "goto". What's interesting (and makes sense) is that the regular trainer battle theme plays on the 2nd battle. And if I change who the trainer is, it repeats that trainer twice instead of two different trainers back to back.

From my testing, the player only battles this trainer twice, not infinitely. The other parts of the script work fine.

I literally don't know what's wrong with the script, and why I'm getting 2 battles back to back. Help would be appreciated.

Anon822 February 10th, 2021 6:30 AM

'special 0x3E' seems to be the cause of this issue. Removing it makes the battle only happen once.

ShinyTillDawn February 10th, 2021 6:36 AM

This is from a different script for the battle before that one:
https://cdn.discordapp.com/attachments/561296209529274380/809070147360391258/unknown.png

I also used "special 0x3E" and I remember that battle not repeating. Would you agree it's some sort of complicated bug with "trainerbattle 0x3..."?

Anon822 February 10th, 2021 6:43 AM

Quote:

Originally Posted by ShinyTillDawn (Post 10279600)
This is from a different script for the battle before that one:
I also used "special 0x3E" and I remember that battle not repeating. Would you agree it's some sort of complicated bug with "trainerbattle 0x3..."?

I wouldn't call it a bug, but I guess it just doesn't work with trainerbattle 0x3

Meister_anon~Master_o f_None February 20th, 2021 10:14 PM

Sounds interesting, maybe I can use that as a simple way to make battles repeatable, without having to edit every script.


All times are GMT -8. The time now is 9:18 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.