You are not logged in.
Pages: 1
Hey guys,
I've been looking into it but I can't seem to find where does the game choose where the player spawns after the halloffame script.
has anyone tried to do so and succeded?
Offline
TL;DR: Edit engine/menus/intro_menu.asm and change SPAWN_NEW_BARK in .SpawnAfterE4 to whatever other spawn value you want from constants/map_data_constants.asm. You can do the same with SPAWN_MT_SILVER in SpawnAfterRed to affect where you spawn after beating Red.
--------------------------------------------------------------------------------
There are two relevant flags defined in wram.asm:
• wDefaultSpawnpoint, which defaults to zero but can be set to a spawn location from constants/map_data_constants.asm; and
• wSpawnAfterChampion, which defaults to zero but can be set to the values defined in constants/wram_constants.asm (SPAWN_LANCE or SPAWN_RED).
The code that alters wSpawnAfterChampion is in engine/events/halloffame.asm. When you enter the Hall of Fame it calls HallOfFame, which sets wSpawnAfterChampion to SPAWN_LANCE; and when you beat Red it calls RedCredits, which sets wSpawnAfterChampion to SPAWN_RED.
Then the credits play and the game restarts. The "New Game / Continue / Options / Mystery Gift" menu code is in engine/menus/intro_menu.asm. When you choose to Continue, it calls Continue, which checks for SPAWN_LANCE:
ld a, [wSpawnAfterChampion]
cp SPAWN_LANCE
jr z, .SpawnAfterE4
And later jumps to FinishContinueFunction, which checks for SPAWN_RED:
ld a, [wSpawnAfterChampion]
cp SPAWN_RED
jr z, .AfterRed
.AfterRed:
call SpawnAfterRed
Those two subroutines, .SpawnAfterE4 and SpawnAfterRed, set wDefaultSpawnpoint to the values that determine where you appear (and reset wSpawnAfterChampion to zero):
.SpawnAfterE4:
ld a, SPAWN_NEW_BARK
ld [wDefaultSpawnpoint], a
call PostCreditsSpawn
jp FinishContinueFunction
SpawnAfterRed:
ld a, SPAWN_MT_SILVER
ld [wDefaultSpawnpoint], a
PostCreditsSpawn:
xor a
ld [wSpawnAfterChampion], a
ld a, MAPSETUP_WARP
ldh [hMapEntryMethod], a
ret
Anyway, just change SPAWN_NEW_BARK and SPAWN_MT_SILVER to whatever spawn values you want for after beating Lance and Red. You could even write extra logic to check wSpawnAfterChampion for other values besides SPAWN_LANCE or SPAWN_RED, if you wanted a third such location.
Last edited by Rangi (2018-12-05 22:31:21)
My projects on GitHub:
• Polished Map 4.7.1 or 2.7.1++
• Tilemap Studio 4.0.1
• Pokémon Polished Crystal 2.2.0 or 3.0.0 beta
• Pokémon Red★/Blue★: Space World Edition 2020-11-01
Offline
Pages: 1