• 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] Hide Trainer Sprite after Battle and YES/NO Battle script HELP

  • 15
    Posts
    3
    Years
    • Seen Jun 9, 2024
    Hello,😄
    I am new to Rom Hacking and need some help with scripting.
    Anyone know how to script that a Trainer sprite dissapears after Battle and saying something?
    Also how to script a Yes or No Trainer Battle?
    Any help would be appreciated.

    (This is my first thread ever created so pls point out if I did anything wrong)
     
  • 120
    Posts
    5
    Years
    • Seen Nov 2, 2023
    To create a yes/no battle script you could use something like this:

    #dynamic 0x800000
    #org @start
    lock
    faceplayer
    msgbox @Talk 0x5 '----------------- A type 0x5 message box is a Yes/No one, and here we are asked if we want to battle.
    compare lastresult 0x1 '----------------- Comparing if we chose yes or no.
    if 0x1 goto @Battle '----------------- If we chose yes go to battle, else, say that we can't.
    msgbox @CantBattle 0x6
    release
    end

    '-----------------

    #org @Battle '----------------- The script goes here if we say yes
    trainerbattle 0x0 0x1 0x0 @Challenge @Defeat
    hidesprite 0x1 '----------------- hidesprite is used to hide person events, and if your person event number is one, you write 0x1, if it's two, you'll
    setflag 0x205 '----------------- use 0x2 and so on. Setflag is used to permanently hide the NPC from the map, and you need to associate a
    release '----------------- number to it, and here I used flag 0x205. You can use a safe flag value from 0x200 to 0x2FF and you'll have to
    end '----------------- place this number in the person ID box in Advance Map.

    '----------------- Below is the code for all the text that's displayed with message boxes.

    #org @Talk
    = Hi there!, do you perhaps want to\nbattle?

    #org @CantBattle
    = Ok, I guess you don't want to.

    #org @Challenge
    = Okay, let's go!

    #org @Defeat
    = Wow, you defeated me?

    '-----------------

    I used ('-----------------) to write comments in the code, and it is not necessary for the code to work.
     
    Last edited:
  • 15
    Posts
    3
    Years
    • Seen Jun 9, 2024
    Thanks, you have helped me a lot with this.
    Much appreciated :D
     
    Last edited:
    Back
    Top