• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Cyndy, May, Hero (Conquest), or Wes - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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] Rival Battle Script Error

  • 36
    Posts
    10
    Years
    I am trying to get a script together where the players rival appears, walks toward the player, has a battle, and then walks away and disappears.

    Every aspect works so far except after the battle ends the script comes to a hard stop and the sprite is back where it was initially.

    If i walk back on the tile that should trigger the event the rival sprite walks toward me (like he did the first time) and then walks away and disappears for good like he was supposed to after the battle.

    Is there a specific command I need to include after trainerbattle to ensure that the script plays onward?

    Do I need to use the trainerbattle 0x1 command when including a battle in a tile script?

    Here is the script I used.

    Spoiler:
     
    When using trainerbattle 0x0 the script will always end after the battle. You should indeed use another trainerbattle type. I recommend using trainerbattle 0x3, since that allows you to continue the script after the battle and has no bugs as far as I know.

    Also, this tutorial might be useful:
    https://www.youtube.com/watch?v=8iEV_PRW_-g

    Thank you for the info. Ill watch this through and give my script another go.

    edit: yup making it a 0x1 battle with the addition @pointer going to every part after the battle made it workj flawlessly. Thanks again!
     
    Last edited:
    Glad it helped;)

    The 0x1 trainerbattle could be problematic when used in an area where you're able to surf with wild pokemon. If you've been through a type 0x1 trainerbattle and encounter a wild pokemon in water you'll be unable to escape from the water afterwards. Therefore it's safer to use trainerbattle 0x3 instead.

    This could also be helpful in understanding the trainerbattle command:
    https://sphericalice.com/romhacking/documents/script/#c-5C
     
    Back
    Top