• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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] Pokemon Emerald: How do I change rematch trainer battles to on demand?

  • 694
    Posts
    7
    Years
    • Seen today
    Hey, so I'm completely noobish at scripting. I know that in Emerald, battles are not so easily started, and are (I believe) RTC based. How could I make a battle to an already existing trainer go from the vanilla script to something that you can request as many times as you wish on demand?

    So, I'd like the script text to be something like this:
    *Talks to trainer*
    Trainer: "Wanna rematch?"
    Options: Yes/No
    Option Yes: Engage battle
    Option No: "Alright then, maybe later"

    Also, would I need to create a new Person event in Advance Map? (I use PKSV-UI script editor) or can I just edit the existing script and compile it? Also, could this cause any foreseeable glitches after making specific trainers rematch on demand? If I remember correctly, the PokeNav lets you know when a trainer is ready to rebattle. Could that cause any issues if I do this? Also note, I don't know the offsets of the trainers. This is for an older mod called Theta Emerald EX but I can't figure out specific trainer information. What would I need to know beforehand?

    Please be willing to explain, step by step how to accomplish this. I'm somewhat used to AM but not to the script editor. I'd appreciate the help! Thanks!
     
  • 120
    Posts
    5
    Years
    • Seen Nov 2, 2023
    Here's a short script I compiled using XSE:

    #dynamic 0x800000
    #org @start
    trainerbattle 0x0 0x1 0x0 @ch @de
    msgbox @t1 0x5
    compare 0x800d 0x1
    if 0x0 goto @nope

    settrainerflag 0x1
    trainerbattle 0x0 0x1 0x0 @ch @de

    release
    end

    #org @nope
    msgbox @later 0x6
    release
    end

    '-----------------
    #org @ch
    = Battle time!

    #org @de
    = How did I lose?

    #org @t1
    = Want a rematch?


    #org @later
    = Okay, Maybe later?
     
  • 694
    Posts
    7
    Years
    • Seen today
    Here's a short script I compiled using XSE:

    #dynamic 0x800000
    #org @start
    trainerbattle 0x0 0x1 0x0 @ch @de
    msgbox @t1 0x5
    compare 0x800d 0x1
    if 0x0 goto @nope

    settrainerflag 0x1
    trainerbattle 0x0 0x1 0x0 @ch @de

    release
    end

    #org @nope
    msgbox @later 0x6
    release
    end

    '-----------------
    #org @ch
    = Battle time!

    #org @de
    = How did I lose?

    #org @t1
    = Want a rematch?


    #org @later
    = Okay, Maybe later?

    I appreciate that, but if I paste that and compile, will it work the same way? Would I need to know any trainer offset info?
     
  • 120
    Posts
    5
    Years
    • Seen Nov 2, 2023
    I've only been scripting in XSE and never used PKSV UI, but I don't think that it could be pasted onto PKSV UI from XSE as the codes are not written in the same way. You could however, use XSE for this code and compile it (I recommend it as it has become a modern scripting software) .
    As far as trainer offset goes (I'm assuming you are talking about the 0x1 of the trainerbattle command), you have to open up your rom with a trainer editing tool like HTE, and if you make your first trainer (using the ID of 001) that is 0x1 in scritpting (if its 002 its 0x2, if its 010 its 0xA as 10 = A in hexadecimal)
     
    Back
    Top