The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Altering rival's movement in Oak's Lab in Fire Red

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 June 6th, 2020 (11:11 AM).
ric01 ric01 is offline
 
Join Date: Sep 2019
Posts: 4
It always irked me that the starters in FR/LG are placed out of order in Oak's Lab at the beginning: it's Bulbasaur/Squirtle/Charmander, when in the Pokédex it goes Bulbasaur/Charmander/Squirtle. So, I wanted to switch the latter two so they're in order while keeping the rival's choice pokémon consistent.

I already used Advance Starter to change both the player and the rival starters such that the rival still gets whatever pokémon has a type advantage to yours. However, the rival's movement is unchanged, so he will pick the incorrect pokéball from the table. I assume I only need to make changes to each pokéball's script on Advance Map or something, but I don't know what to actually alter. I'm pretty new to ROM hacking and know next to nothing about scripting - the only scripts I have touched are of a few marts in order to change the items they sell.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old June 7th, 2020 (2:13 AM).
Entaro Ceraphenine's Avatar
Entaro Ceraphenine Entaro Ceraphenine is offline
 
Join Date: Sep 2016
Location: Katones City
Gender: Male
Nature: Quiet
Posts: 48
You might wanna start by learning scripting in XSE and a very little about Hex editing at first. Rival's movement is activated from the pokeball you pick. If you pick Bulbasaur, the game runs a script like "you selected the first pokeball, so make the rival move to let him pick the third pokeball". It all happens in these tiny scripts:
Spoiler:
#org 0x169CDC <--- this is where the script is located
closeonkeypress
compare 0x4001 0x0 <--- comparing the variable number 4001 with 0, variable 4001's value becomes 0 when you pick the first pokeball i.e. Bulbasaur
if 0x1 goto 0x8169CFF <--- this basically means "if 4001 is equal to 0, then continue script from 169CFF"
compare 0x4001 0x1 <--- variable 4001's value becomes 1 when you pick the second pokeball i.e. Squirtle in a fresh FireRed or Charmander in your ROM
if 0x1 goto 0x8169D1F
compare 0x4001 0x2 <--- likewise, for the 3rd pokeball
if 0x1 goto 0x8169D0F
end

#org 0x169CFF
applymovement 0x8 0x8169D62 <--- rival's sprite is moved according to the movement data at 169D62
waitmovement 0x0
goto 0x8169D2F

#org 0x169D1F
applymovement 0x8 0x8169D72
waitmovement 0x0
goto 0x8169D2F

#org 0x169D0F
applymovement 0x8 0x8169D6B
waitmovement 0x0
goto 0x8169D2F

#org 0x169D62 <--- rival's movement data when you pick bulbasaur, so that he reaches the 3rd pokeball where the game supposes charmander would be
#raw 0x10
#raw 0x10
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x11
#raw 0xFE

#org 0x169D72
#raw 0x10
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x2E
#raw 0xFE

#org 0x169D6B
#raw 0x10
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x2E
#raw 0xFE


A simple fix would be to reroute the variable 4001 check. If you want to do scripting after learning XSE, you can do this:
1. Write a script in a free space in your ROM like this:
Spoiler:
#dynamic 0xUVWXYZ

#org @start
closeonkeypress
compare 0x4001 0x0
if 0x1 goto 0x8169D0F
compare 0x4001 0x1
if 0x1 goto 0x8169CFF
compare 0x4001 0x2
if 0x1 goto 0x8169D1F
end

where UVWXYZ is the location of the free space. Remember this address because it will be important for repointing.

2. Open your ROM in a Hex Editor (dont worry, we wont be doing complex hex here), preferably HxD
Search for "DC 9C 16 08" hex values and replace them with "YZ WX UV 08" (According to the address of the free space). Do the replacement for everytime "DC 9C 16 08" pops up. What this basically does is tells the game to go to UVWXYZ instead of 169CDC

Method 2: A bit complex but easier steps and saves ROM spaces:
Open your ROM in HxD.
Go to 169CE4 and replace FF 9C 16 with 0F 9D 16
Go to 169CEF and replace 1F 9D 16 with FF 9C 16
Go to 169CFA and replace 0F 9D 16 with 1F 9D 16
Dont Ctrl+C Ctrl+V the hex codes because it will bug your game. Use Ctrl+B (paste-write) instead of Ctrl+V (paste-insert).
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:15 AM.