Remove the redundant move grammar table - pret/pokecrystal GitHub Wiki

In Japanese, 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. This tutorial will show you how to remove them, which saves space and simplifies the code.

Contents

  1. Delete the MoveGrammar table
  2. Simplify the move text
  3. Simplify the text printer

1. Delete the MoveGrammar table

Simply delete data/moves/grammar.asm.

2. Simplify the move text

Edit data/text/common_2.asm:

 _ActorNameText::
 	text "<USER>@"
 	text_end

-_UsedMove1Text::
+_UsedMoveText::
 	text_start
 	line "used @"
 	text_end
-
-_UsedMove2Text::
-	text_start
-	line "used @"
-	text_end

_UsedInsteadText::
	text "instead,"
	cont "@"
	text_end

_MoveNameText::
	text_ram wStringBuffer2
-	text_end
-
-	text_end ; unused
-
-_EndUsedMove1Text::
-	text "!"
-	done
-
-_EndUsedMove2Text::
-	text "!"
-	done
-
-_EndUsedMove3Text::
-	text "!"
-	done
-
-_EndUsedMove4Text::
-	text "!"
-	done
-
-_EndUsedMove5Text::
 	text "!"
 	done

3. Simplify the text printer

Edit engine/battle/used_move_text.asm:

 UsedMoveText:
 ; this is a stream of text and asm from 105db9 to 105ef6
 	text_far _ActorNameText
 	text_asm
 	ldh a, [hBattleTurn]
 	and a
 	jr nz, .start
 
 	ld a, [wPlayerMoveStruct + MOVE_ANIM]
 	call UpdateUsedMoves
 
 .start
 	ld a, BATTLE_VARS_LAST_MOVE
 	call GetBattleVarAddr
 	ld d, h
 	ld e, l
 
 	ld a, BATTLE_VARS_LAST_COUNTER_MOVE
 	call GetBattleVarAddr
 
 	ld a, BATTLE_VARS_MOVE_ANIM
 	call GetBattleVar
-	ld [wMoveGrammar], a
+	ld [wTempByteValue], a
 
 	push hl
 	farcall CheckUserIsCharging
 	pop hl
-	jr nz, .grammar
+	jr nz, .ok

 	; update last move
-	ld a, [wMoveGrammar]
+	ld a, [wTempByteValue]
 	ld [hl], a
 	ld [de], a

-.grammar
-	call GetMoveGrammar
-; wMoveGrammar now contains MoveGrammar
-
-; everything except 'instead' made redundant in localization
-
-	; check obedience
-	ld a, [wAlreadyDisobeyed]
-	and a
-	ld hl, UsedMove2Text
-	ret nz
-
-	; check move grammar
-	ld a, [wMoveGrammar]
-	cp $3
-	ld hl, UsedMove2Text
-	ret c
-	ld hl, UsedMove1Text
+.ok
+	ld hl, UsedMoveInsteadText
 	ret

-UsedMove1Text:
-	text_far _UsedMove1Text
-	text_asm
-	jr UsedMoveText_CheckObedience
-
-UsedMove2Text:
-	text_far _UsedMove2Text
+UsedMoveInsteadText:
+	text_far _UsedMoveText
	text_asm
-UsedMoveText_CheckObedience:
 ; check obedience
 	ld a, [wAlreadyDisobeyed]
 	and a
 	jr z, .GetMoveNameText
 ; print "instead,"
 	ld hl, .UsedInsteadText
 	ret
 
 .UsedInsteadText:
 	text_far _UsedInsteadText
 	text_asm
 .GetMoveNameText:
 	ld hl, MoveNameText
 	ret
 
 MoveNameText:
 	text_far _MoveNameText
+	text_end
-	text_asm
-; get start address
-	ld hl, .endusedmovetexts
-
-	...
-
-GetMoveGrammar:
-	...
-	ret
-
-INCLUDE "data/moves/grammar.asm"

(If you're using an older version of pokecrystal that has wd265 instead of wMoveGrammar, you don't need to replace wd265 with wTempByteValue, but do need to make the other changes. Older versions also use db "@" instead of text_end.)

Now moves will still print correctly, but without wasting time and space on using certain grammar.

Screenshot

⚠️ **GitHub.com Fallback** ⚠️