The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Rematch a trainer multiple times

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old April 30th, 2019 (5:52 PM). Edited May 1st, 2019 by Wiserospray.
Wiserospray's Avatar
Wiserospray Wiserospray is offline
 
Join Date: Apr 2019
Location: Yankee
Gender: Male
Nature: Timid
Posts: 11
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.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old April 30th, 2019 (6:31 PM).
DrFuji's Avatar
DrFuji DrFuji is offline
Heiki Hecchara‌‌
 
Join Date: Sep 2009
Location: Aussie
Age: 30
Gender: Male
Nature: Jolly
Posts: 1,693
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
...
__________________
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old May 1st, 2019 (7:16 AM).
TrainerX493's Avatar
TrainerX493 TrainerX493 is offline
 
Join Date: Feb 2019
Age: 26
Gender: Male
Nature: Lax
Posts: 4
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
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old May 1st, 2019 (10:02 AM).
Wiserospray's Avatar
Wiserospray Wiserospray is offline
 
Join Date: Apr 2019
Location: Yankee
Gender: Male
Nature: Timid
Posts: 11
Thanks! I completely forgot about resetting a trainer flag.
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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