• 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] Rival Battle Script Error

36
Posts
9
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:
 
760
Posts
15
Years
  • Seen Apr 22, 2024
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
 
36
Posts
9
Years
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:
760
Posts
15
Years
  • Seen Apr 22, 2024
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:
http://sphericalice.com/romhacking/documents/script/#c-5C
 
Back
Top