The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Rival Battle Script Error

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old August 15th, 2018 (3:50 PM).
DoctorKoolMan's Avatar
DoctorKoolMan DoctorKoolMan is offline
 
Join Date: Apr 2015
Location: United States
Age: 28
Gender: Male
Posts: 36
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:
#dynamic 0x904000

#org @start
lockall
checkflag 0x202
if 0x1 goto @done
showsprite 0x01
applymovement 0x01 @move1
waitmovement 0x0
call @battle
setflag 0x202
applymovement 0x01 @move2
waitmovement 0x0
hidesprite 0x01
releaseall
end

#org @battle
trainerbattle 0x0 0x169 0x0 @before @after
return

#org @done
releaseall
end

#org @before
= before

#org @after
= after

#org @move1
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0xFE

#org @move2
#raw 0x1
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0xFE
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old August 15th, 2018 (3:59 PM).
kalarie kalarie is offline
 
Join Date: Jun 2008
Posts: 760
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
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old August 15th, 2018 (4:40 PM). Edited August 15th, 2018 by DoctorKoolMan.
DoctorKoolMan's Avatar
DoctorKoolMan DoctorKoolMan is offline
 
Join Date: Apr 2015
Location: United States
Age: 28
Gender: Male
Posts: 36
Quote:
Originally Posted by kalarie View Post
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!
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old August 16th, 2018 (2:55 AM).
kalarie kalarie is offline
 
Join Date: Jun 2008
Posts: 760
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
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 9:17 AM.