- Notifications
You must be signed in to change notification settings - Fork0
More options for in-game trades in FR.
License
Zeturic/bpre-trade-stuff
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Adds a few more options for in-game trades.
Can also be used as sort of a trade editor to manage the new options.
For binary FR.
Seehere for the prequisites and help in installing them.
Open your terminal to whatever folder you want to download this repo into. Then, do the following to download the repo:
$ git clone https://github.com/Zeturic/bpre-trade-stuff.git$cd bpre-trade-stuff
Copy your ROM to this directory and rename itrom.gba
.
Openconfig.mk
in a text editor to set some compile-time configuration.
The build system is smart enough to find enough free space on its own, but if you want it to be inserted at a particular address, you can specify it by updating the definition ofSTART_AT
. If the given address is acceptable (i.e. is word-aligned and has enough bytes of free space), it will be inserted there. Otherwise, it will just useSTART_AT
to determine where in the ROM it should start looking for free space.
Make sure to updateNUM_INGAME_TRADES
if you've repointed and expanded the table.
InGameTrade::abilityNum
had to be moved in order to make room forInGameTrade::moveset
. If the data in your ROM is already in this format, make sure to setABILITYNUM_HAS_ALREADY_BEEN_MOVED
to1
, otherwise keep it as0
.
If you've previously inserted this hack and just want to update the data without reinserting another copy of the code, you can setINSERT_INGAME_TRADE_HACK
to0
. Otherwise, keep it as1
.
Runmake src/sInGameTrades.c
to extract the in-game trade data from your ROM. Then, you can open the newly createdsrc/sInGameTrades.c
in a text editor to modifysInGameTrades
as desired.
Keep in mind that you can't add in-game trades by adding more elements to the end ofsInGameTrades
, because that would overwrite whatever happened to be after the table in your ROM. Instead, repointsInGameTrades
externally first, then use this with an updatedNUM_INGAME_TRADES
.
Once you're ready, runmake
. This won't actually modifyrom.gba
, instead your output will be intest.gba
. Naturally, test it in an emulator.
The long and short of it is that this breaks trade editors. This is because it places new data in what used to be padding bytes, and trade editors could easily zero them out because they don't expect them to be meaningful or to need to be preserved.
Even worse, as mentioned above,InGameTrade::abilityNum
had to be moved, and obviously trade editors will be looking for it at the old location, which is now part ofInGameTrade::moveset
, and obviously that would confuse them.
As a result,do not use trade editors with this.
Obviously, this lets you modify your trades when you're inserting this hack viasrc/sInGameTrades.c
, but what if you want to modify them later on, long after you've added this?
This is why the optionsINSERT_INGAME_TRADE_HACK
andABILITYNUM_HAS_ALREADY_BEEN_MOVED
exist inconfig.mk
. They allow you to modify the data in your ROM by modifyingsrc/sInGameTrades.c
without reinserting the actual code, acting essentially as a text-based trade editor.
Alternatively, you can edit your trades using a hex editor.
Most of the fields in theInGameTrade
struct should be self-explanatory, but I'll explain the new ones anyway.
Iflevel
is set to0
, the Pokémon's level will match the level of the Pokémon the player traded away. Otherwise, its level will be set to match thelevel
field.
Theivs
are listed in the following order: HP, Attack, Defense, Speed, Special Attack, Special Defense. If any of them are set to0xFF
, that particular IV will be randomly generated. Otherwise, that IV will match the provided value.
An explanation of theppBonuses
byte can be foundhere.
An explanation of thepokerus
byte can be foundhere.
An explanation of theball
byte can be foundhere.
Themoveset
field is a pointer to moveset data. If it is set toNULL
, the Pokémon will inherit the default moveset based on its level.
The moveset's format is dead simple; it's just four hwords corresponding to the move indices of the four chosen moves. Just make sure to put it at an address that is hword-aligned (ends in0
,2
,4
,6
,8
,A
,C
, orE
).
For example, if you wanted Reyley's Mimien to know Psychic (0x5E), Shadow Ball (0xF7), and Snatch (0x121), without a fourth move, you'd just do5E 00 F7 00 21 01 00 00
. For the purposes of this example, we'll assume you inserted that at0x08800900
with a hex editor.
Then, you can set themoveset
field to(u16*) 0x08800900
for Reyley's Mimien.
The project structure and some of the build tools are frompokeemerald.
About
More options for in-game trades in FR.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.