6 Remove the functionally redundant move grammar tables
Manh edited this page 2023-08-19 12:45:26 +07:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

In the Japanese releases, there are five ways to say "POKéMON used MOVE!":

  • "POKéMONが MOVEを つかった!" ("POKéMON used MOVE!")
  • "POKéMONが MOVEした!" ("POKéMON did MOVE!")
  • "POKéMONが MOVE した!" ("POKéMON did MOVE!" for long move names)
  • "POKéMONの MOVE こうげき!" ("POKéMON's MOVE attack!")
  • "POKéMONの MOVE" ("POKéMON's MOVE!")

These are all redundant in the English localization and all the strings have been translated to just “!”. This tutorial will show you how to remove them, which saves space and simplifies the code.

Open src/battle_message.c and remove the following declarations:

- static void ChooseMoveUsedParticle
- static void ChooseTypeOfMoveUsedString
- static const u8 sText_ExclamationMark[] = _("!")
- static const u8 sText_ExclamationMark2[] = _("!")
- static const u8 sText_ExclamationMark3[] = _("!")
- static const u8 sText_ExclamationMark4[] = _("!")
- static const u8 sText_ExclamationMark5[] = _("!")

In the same file, look for the functions: sGrammarMoveUsedTable, ChooseMoveUsedParticle and ChooseTypeOfMoveUsedString and remove them completely.

In the function BufferStringBattle in src/battle_message.c, remove ChooseMoveUsedParticle(gBattleTextBuff1); and ChooseTypeOfMoveUsedString(gBattleTextBuff2);

And finally, change sText_AttackerUsedX and add an exclamation mark at the end of the string like so:

- static const u8 sText_AttackerUsedX[] = _("{B_ATK_NAME_WITH_PREFIX} \n{B_BUFF2}”)
+ static const u8 sText_AttackerUsedX[] = _("{B_ATK_NAME_WITH_PREFIX} \n{B_BUFF2}!”)

And thats it! You have now removed the move grammar tables and functions and also made it easier on resources because now the game wont go through multiple functions just to print a single exclamation mark present in 5 different text strings.