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 Rematch a trainer multiple times (https://www.pokecommunity.com/showthread.php?t=420639)

Wiserospray April 30th, 2019 5:52 PM

Rematch a trainer multiple times
 
Hello,

I am trying to create a battle club in Pokemon Fire Red. This would include the player being able to rematch a trainer multiple times. But, when I try to initiate my code I am only able to battle the trainer once or twice. A part of my code that uses trainer battles is below.

Spoiler:
#org @grace
showsprite 0x03
applymovement 0x03 @battle
waitmovement 0x0
setvar 0x4015 0x1
trainerbattle 0x1 0x1C6 0x0 @oddish @stall @win
release
end


I appreciate any help someone can give me.

DrFuji April 30th, 2019 6:31 PM

You need to reset the opponent's trainerflag once you've won your battle. You can do this with the command 'settrainerflag'. Here's what it should like in your script:

Code:

...
trainerbattle 0x1 0x1C6 0x0 @oddish @stall @win

#org @win
settrainerflag 0x1C6
...



TrainerX493 May 1st, 2019 7:16 AM

Here is a way of doing it giving you a "Want a rematch?" dialog:

Quote:

;---------------
#org 0x101CC08
trainerbattle 0x0 0x8 0x0 0x901CC48 0x901CC66
msgbox 0x901CC7E MSG_YESNO ;"Hey! Wanna have a rematch?"
compare LASTRESULT 0x1
if 0x1 goto 0x901CC34
msgbox 0x901CC9B MSG_FACE ;"No? Later then!"
release
end

;---------------
#org 0x101CC34
settrainerflag 0x8
trainerbattle 0x0 0x8 0x0 0x901CC48 0x901CC66
release
end


Wiserospray May 1st, 2019 10:02 AM

Thanks! I completely forgot about resetting a trainer flag.


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