• 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] Trainer Battle Scripting

157
Posts
7
Years
    • Seen Nov 19, 2023
    So I am trying to script a trainer battle where the trainer stand in front of an area making you battle them to progress, then after being beaten the screen fades to black and they have disappeared, like the rocket grunt in celadon in fire red. Here is the script I've been using (on pokemon emerald btw).

    #dynamic 0x2E9710

    #org @event
    lock
    faceplayer
    trainerbattle 0x2 0x1 0x0 0x82E97BF 0x82E9803 0x82E977B
    release
    end

    '---------------
    #org 0x2E977B
    msgbox 0x82E9816 MSG_NORMAL '"Curses, foiled by a kid!"
    fadescreen 0x1
    setflag 0x1200
    hidesprite 0x6
    fadescreen 0x0
    release
    end


    '---------
    ' Strings
    '---------
    #org 0x2E97BF
    = Prepare to be defeated!

    #org 0x2E9803
    = Dang you beat me

    #org 0x2E9816
    = Curses, foiled by a kid!



    So when I talk to the trainer in game, literally nothing happens ahah. So any help regarding what might be wrong here would be appreciate. Cheers.
     

    Skeli

    Lord of the Rings
    300
    Posts
    10
    Years
  • Try writing your script like this

    #dynamic 0x2E9710
    #org @event
    lock
    faceplayer
    msgbox 0x82E97BF MSG_NORMAL
    closeonkeypress
    trainerbattle 0x3 0x1 0x0 0x82E9803
    msgbox 0x82E9816 MSG_NORMAL '"Curses, foiled by a kid!"
    fadescreen 0x1
    hidesprite 0x6
    fadescreen 0x0
    release
    end
     
    Last edited:
    Back
    Top