Speed up Pokémon Center Healing - pret/pokecrystal GitHub Wiki

Healing your Pokémon at the Center can be a bit of a slow process. The nurse has a lot of text, and the animation for healing takes several seconds. Many mods such as Crystal Legacy have sped it up in different ways.

The healing flow consists of these steps:

  • The nurse gives a greeting depending on the time of day, followed by a "welcome" message.
  • The nurse explains that she can heal the player's party, then asks if she should do that.
  • The player answers Yes/No.
  • If yes, she asks to see the player's Pokémon. If no, then skip to the last step.
  • The animation for placing the balls on the machine is played.
  • The healing animation and music are played.
  • If a Pokémon has Pokérus and this is the first time healing, the nurse mentions this. Then the flow ends.
  • Otherwise, the nurse thanks the player and informs them their party has been healed.
  • The nurse takes a bow, says "We hope to see you again" and the flow ends.

Clearly, there are a lot of steps here which can be sped up or skipped entirely. Any of the sections in this article can be used or left out depending on preference.

Contents

  1. Shorten the Nurse's Text
  2. Speed up Pokéball Animation
  3. Increase Text Speed

1) Shorten the Nurse's Text

When you talk to the nurse, there is a lot of text that gets printed to the screen, and the player must mash buttons to scroll through it every time they heal their party. Technically, none of it is necessary, but we'll leave some of it in to give the player some interaction. In this example, we'll leave the text intact but most of it will be displayed only the first time the player uses the Pokémon Center. Fortunately, there is an easy way to keep track of this. Since the PokéCom center was removed for the Western versions of the game, there is an unused event flag we can use for this purpose called EVENT_WELCOMED_TO_POKECOM_CENTER. At the same time, we can simplify the code by removing some of the unused PokéCom center code.

In this example, we'll retain the time-of-day greeting and the question, and the "we hope to see you again".

First, we'll make the necessary changes to the text strings. In data/text/std_text.asm:

NurseMornText:
	text "Good morning!"
-	line "Welcome to our"
-	cont "#MON CENTER."
	done

NurseDayText:
	text "Hello!"
-	line "Welcome to our"
-	cont "#MON CENTER."
	done

NurseNiteText:
	text "Good evening!"
	line "You're out late."

-	para "Welcome to our"
-	line "#MON CENTER."
	done

+NurseCenterWelcomeText:
+	text "Welcome to our"
+	line "#MON CENTER."
+
+	para "We can heal your"
+	line "#MON to perfect"
+	cont "health."
+	done
-
-PokeComNurseMornText:
-	text "Good morning!"
-
-	para "This is the #-"
-	line "MON COMMUNICATION"
-
-	para "CENTER--or the"
-	line "#COM CENTER."
-	done
-
-PokeComNurseDayText:
-	text "Hello!"
-
-	para "This is the #-"
-	line "MON COMMUNICATION"
-
-	para "CENTER--or the"
-	line "#COM CENTER."
-	done
-
-PokeComNurseNiteText:
-	text "Good to see you"
-	line "working so late."
-
-	para "This is the #-"
-	line "MON COMMUNICATION"
-
-	para "CENTER--or the"
-	line "#COM CENTER."
-	done

NurseAskHealText:
-	text "We can heal your"
-	line "#MON to perfect"
-	cont "health."

-	para "Shall we heal your"
+	text "Shall we heal your"
	line "#MON?"
	done

This moves most of the text we'll be skipping into NurseCenterWelcomeText so we can still use the other strings in the future. It's not really necessary to remove the PokéCom center strings, but when we're done they won't be referenced anymore.

Then, in engine/events/std_scripts.asm:

PokecenterNurseScript:
- ; EVENT_WELCOMED_TO_POKECOM_CENTER is never set
-
	opentext
	checktime MORN
	iftrue .morn
	checktime DAY
	iftrue .day
	checktime NITE
	iftrue .nite
	sjump .ok

.morn
-	checkevent EVENT_WELCOMED_TO_POKECOM_CENTER
-	iftrue .morn_comcenter
	farwritetext NurseMornText
	promptbutton
+	checkevent EVENT_WELCOMED_TO_POKECOM_CENTER
+	iffalse .ok_first_time
	sjump .ok
-.morn_comcenter
-	farwritetext PokeComNurseMornText
-	promptbutton
-	sjump .ok

.day
-	checkevent EVENT_WELCOMED_TO_POKECOM_CENTER
-	iftrue .day_comcenter
	farwritetext NurseDayText
	promptbutton
+	checkevent EVENT_WELCOMED_TO_POKECOM_CENTER
+	iffalse .ok_first_time
	sjump .ok
-.day_comcenter
-	farwritetext PokeComNurseDayText
-	promptbutton
-	sjump .ok

.nite
-	checkevent EVENT_WELCOMED_TO_POKECOM_CENTER
-	iftrue .nite_comcenter
	farwritetext NurseNiteText
	promptbutton
+	checkevent EVENT_WELCOMED_TO_POKECOM_CENTER
+	iffalse .ok_first_time
	sjump .ok
-.nite_comcenter
-	farwritetext PokeComNurseNiteText
-	promptbutton
-	sjump .ok

+.ok_first_time
+	farwritetext NurseCenterWelcomeText
+	promptbutton
+
.ok
-	; only do this once
-	clearevent EVENT_WELCOMED_TO_POKECOM_CENTER
-
	farwritetext NurseAskHealText
	yesorno
	iffalse .done
	...
.no

+	checkevent EVENT_WELCOMED_TO_POKECOM_CENTER
+	iftrue .done
	farwritetext NurseReturnPokemonText
	pause 20

.done
	farwritetext NurseGoodbyeText
+	setevent EVENT_WELCOMED_TO_POKECOM_CENTER

	turnobject LAST_TALKED, UP
	pause 10
	...

We've basically just removed all the PokéCom center text references, and skipped some text if EVENT_WELCOMED_TO_POKECOM_CENTER is set. Specifically, we're skipping our new NurseCenterWelcomeText and NurseReturnPokemonText.

2) Speed up Pokéball Animation

By default, the "ball placement" animation involves waiting as up to six balls are placed on the machine with a delay of 30 frames (half a second) between each one. There are a couple different ways to speed up this process; you may speed up the animation or simply skip it altogether.

Option 1: Speed up the animation

The quickest way to speed up the animation is to simply reduce the delay between the Poké Ball placements. In engine/events/heal_machine_anim.asm:

HealMachineAnim:
...
.party_loop
	call .PlaceHealingMachineTile
	push de
	ld de, SFX_SECOND_PART_OF_ITEMFINDER
	call PlaySFX
	pop de
-	ld c, 30
+	ld c, 5
	call DelayFrames
	dec b
	jr nz, .party_loop
	ret

You may replace 30 with any number you desire; it is simply the number of frames between each Poké Ball. Here it has been replaced with 5.

Option 2: Skip the animation and immediately place all balls at once

If you want to skip the ball placement animation entirely so all balls are immediately placed on the machine, this is also easily done.

HealMachineAnim:
...
.LoadBallsOntoMachine:
	ld a, [wPartyCount]
	ld b, a
+	push de
+	ld de, SFX_SECOND_PART_OF_ITEMFINDER
+	call PlaySFX
+	pop de
.party_loop
	call .PlaceHealingMachineTile
-	push de
-	ld de, SFX_SECOND_PART_OF_ITEMFINDER
-	call PlaySFX
-	pop de
-	ld c, 30
-	call DelayFrames
	dec b
	jr nz, .party_loop
+	ld c, 30
+	call DelayFrames
	ret

In this code, the call to DelayFramces has been moved outside the loop, so there is still a delay between ball placement and the healing animation. The delay is set to 30 frames, but can be replaced with any number, or those two lines can be removed entirely to give no delay. The code for playing the "ball placement" sound has also been moved outside the loop so it is only played once.

Note: Along with the healing machine at the Pokémon Center and Prof. Elm's lab, these modifications will also affect the speed that Poké Balls are placed in the hall of fame's Pokémon registration machine. So that needs to be taken into consideration.

3) Increase Text Speed

This tutorial adds an "instant" text speed option so that text doesn't scroll but is just printed all at once: Add a new text scrolling speed

And this tutorial allows you to selectively apply autoscrolling to textboxes so that the player no longer needs to press A to advance them: Battle Autoprompts (The tutorial itself uses it for battle text, but it can be used for other text too!)