• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Script✓] Rematch a trainer multiple times

  • 11
    Posts
    6
    Years
    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:


    I appreciate any help someone can give me.
     
    Last edited:
    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
    ...
     
    Here is a way of doing it giving you a "Want a rematch?" dialog:

    ;---------------
    #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
     
    Back
    Top