The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Other Rival Battle (https://www.pokecommunity.com/showthread.php?t=355277)

PokeStark September 7th, 2015 2:00 PM

Rival Battle
 
Hi, I'm having some trouble getting my rival battle code to work.
I'm trying to get him to walk to talk, walk to player, player reacts, talk, battle, talk, walk away, dissapear
when i hit the script no sprite walks towards the player but the player reacting still happens. The battle commences and after the battle no code is run until
the player re-walks over the script panel.. in which it restarts (still no sprite walking down) but skips the battle and goes to him talking before hes supposed to walk away..
I'm not sure what i'm doing wrong. My rival is person #10
here is the code..

Spoiler:
#dynamic 0x800FD5

#org @start
msgbox @talk1
playsong 0x11A 0x0
applymovement 0x10 @walk1
waitmovement 0x10
applymovement MOVE_PLAYER @walk2
waitmovement 0xFF
msgbox 0x8801043 MSG_NORMAL '"I've heard you smoked the pewter\n..."
trainerbattle 0x0 0x3 0x0 0x8801138 0x8801148
msgbox 0x8801164 MSG_NORMAL '"You've shown me I need to train\nh..."
applymovement 0x10 @walk3
waitmovement 0x10
hidesprite 0x10
setflag 0x1500
fadesong 0x125
setvar 0x6000 0x1
release
end


'---------
' Strings
'---------
#org 0x80102E
= Hey, You, Wait up!

#org 0x801043
= I've heard you smoked the pewter\ncity gym leader.\pVery impressive, I've just\nreceived my second gym badge.\pMy name is Ruby, I'm from the\nHoenn region.\pI've come here to challenge the\nElite 4, and catch rare pokemon.\pAnd you are my new rival!!

#org 0x801138
= Lets do this!

#org 0x801148
= You've put me to shame...

#org 0x801164
= You've shown me I need to train\nharder...\pUntil next time, [player] !


'-----------
' Movements
'-----------
#org @walk1
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x4A 'Face Player
#raw 0xFE 'End of Movements

#org @walk2
#raw 0x63 'Question Mark (?)
#raw 0x55 'Jump in Place (Facing Right)
#raw 0xFE 'End of Movements

#org @walk3
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0xFE 'End of Movements


any help is greatly appreciated.
Also, there is two rivals in this game, so this rival does not need to check for which pokemon the player started with
My rom is FireRed

Squeetz September 7th, 2015 8:59 PM

Changes in bold
Spoiler:
#dynamic 0x800FD5

#org @start
msgbox @talk1
playsong 0x11A 0x0
applymovement 0x10 @walk1
waitmovement 0x10
applymovement MOVE_PLAYER @walk2
waitmovement 0xFF
msgbox 0x8801043 MSG_NORMAL '"I've heard you smoked the pewter\n..."
trainerbattle 0x1 0x3 0x0 0x8801138 0x8801148 @after

#org @after
msgbox 0x8801164 MSG_NORMAL '"You've shown me I need to train\nh..."
applymovement 0x10 @walk3
waitmovement 0x10
hidesprite 0x10
setflag 0x1500 (Use a different flag, this is unsafe! Use 200-2FF)
fadesong 0x125
setvar 0x6000 0x1 (Use a different variable, this is unsafe! Use 4050-40FF)
release
end


'---------
' Strings
'---------
#org 0x80102E
= Hey, You, Wait up!

#org 0x801043
= I've heard you smoked the pewter\ncity gym leader.\pVery impressive, I've just\nreceived my second gym badge.\pMy name is Ruby, I'm from the\nHoenn region.\pI've come here to challenge the\nElite 4, and catch rare pokemon.\pAnd you are my new rival!!

#org 0x801138
= Lets do this!

#org 0x801148
= You've put me to shame...

#org 0x801164
= You've shown me I need to train\nharder...\pUntil next time, [player] !


'-----------
' Movements
'-----------
#org @walk1
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x4A 'Face Player
#raw 0xFE 'End of Movements

#org @walk2
#raw 0x63 'Question Mark (?)
#raw 0x55 'Jump in Place (Facing Right)
#raw 0xFE 'End of Movements

#org @walk3
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0xFE 'End of Movements

As for the rival OW not showing up, it might be because you placed him too far away from the player, e.g. he doesn't get loaded into the map.

PokeStark September 8th, 2015 9:10 PM

Quote:

Originally Posted by Squeetz (Post 8919961)
Changes in bold
Spoiler:
#dynamic 0x800FD5

#org @start
msgbox @talk1
playsong 0x11A 0x0
applymovement 0x10 @walk1
waitmovement 0x10
applymovement MOVE_PLAYER @walk2
waitmovement 0xFF
msgbox 0x8801043 MSG_NORMAL '"I've heard you smoked the pewter\n..."
trainerbattle 0x1 0x3 0x0 0x8801138 0x8801148 @after

#org @after
msgbox 0x8801164 MSG_NORMAL '"You've shown me I need to train\nh..."
applymovement 0x10 @walk3
waitmovement 0x10
hidesprite 0x10
setflag 0x1500 (Use a different flag, this is unsafe! Use 200-2FF)
fadesong 0x125
setvar 0x6000 0x1 (Use a different variable, this is unsafe! Use 4050-40FF)
release
end


'---------
' Strings
'---------
#org 0x80102E
= Hey, You, Wait up!

#org 0x801043
= I've heard you smoked the pewter\ncity gym leader.\pVery impressive, I've just\nreceived my second gym badge.\pMy name is Ruby, I'm from the\nHoenn region.\pI've come here to challenge the\nElite 4, and catch rare pokemon.\pAnd you are my new rival!!

#org 0x801138
= Lets do this!

#org 0x801148
= You've put me to shame...

#org 0x801164
= You've shown me I need to train\nharder...\pUntil next time, [player] !


'-----------
' Movements
'-----------
#org @walk1
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x4A 'Face Player
#raw 0xFE 'End of Movements

#org @walk2
#raw 0x63 'Question Mark (?)
#raw 0x55 'Jump in Place (Facing Right)
#raw 0xFE 'End of Movements

#org @walk3
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0xFE 'End of Movements

As for the rival OW not showing up, it might be because you placed him too far away from the player, e.g. he doesn't get loaded into the map.

I've completely redone all my flags and vars to appropriate available ones, based on KarateKid's post.. Thanks for that tip! i was using them in the thousands to avoid any problems but i guess that causes them!
Using your edits the code worked excellent. also, my sprite wasnt moving because it was sprite number 10 but the script must read it as 0xA and not 0x10 (16)
thanks a lot for your help! i should be able to code all my rival battles now! :)


All times are GMT -8. The time now is 2:30 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.