4 Dynamic Trade Names
TRBRY edited this page 2022-11-22 23:01:07 +01:00

Dynamic Trade Names

Traded Pokemon are stored at gEnemyParty[0]. If you create a custom Pokemon to trade (not in sIngameTrades), the trading scene strings will get messed up. This loads the correct OT name / OT nickname from the pokemon's data structure rather than the in game trade array.

credit: Zeturic's binary FR src

Open src/trade.c

Find BufferTradeSceneStrings After the else statement, replace the following:

ingameTrade = &sIngameTrades[gSpecialVar_0x8004];
StringCopy(gStringVar1, ingameTrade->otName);
StringCopy_Nickname(gStringVar3, ingameTrade->nickname);
GetMonData(&gPlayerParty[gSpecialVar_0x8005], MON_DATA_NICKNAME, name);
StringCopy_Nickname(gStringVar2, name);

with:

GetMonData(&gEnemyParty[0], MON_DATA_OT_NAME, gStringVar1);
GetMonData(&gEnemyParty[0], MON_DATA_NICKNAME, name);
StringCopy_Nickname(gStringVar3, name);
GetMonData(&gPlayerParty[gSpecialVar_0x8005], MON_DATA_NICKNAME, name);
StringCopy_Nickname(gStringVar2, name);

That's it!