Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2016-12-06 20:46:45

~Red
Member
Registered: 2010-10-16
Post 273/276

Fainting and returning to pallet town...

So basically, your house in my hack is now on Route 22, but I noticed a slight glitch, it sends me to Red's House in pallet town if i havent visited any pokemon centres. Is there a way to fix this?

Offline

#2 2016-12-07 01:47:24

Danny-E 33
Administrator
Registered: 2012-06-09
Post 1,002/1,022

Re: Fainting and returning to pallet town...

These are the 4 lines responsible, from SetDefaultNames: in engine/oak_speech.asm:

ld hl, wPlayerName
ld bc, wBoxDataEnd - wPlayerName
xor a
call FillMemory

SetDefaultNames: is called when the player selects "NEW GAME" from the main menu.
When the player blacks out, you get sent to the map ID located in wLastBlackoutMap ($D719)
Those 4 lines fill from wPlayerName ($D158) to wBoxDataEnd ($DEE2) with $00.
$00 is also the ID for Pallet Town.
To fix this, simply change those 4 lines to:

ld hl, wPlayerName
ld bc, wBoxDataEnd - wPlayerName
xor a
call FillMemory
ld a, ROUTE_22
ld [wLastBlackoutMap], a

However, you will also have to define a special warp for Route 22 in data/special_warps.asm by adding an entry for Route 22 to FlyWarpDataPtr:


Red Hack: Pokémon Prototype

Total number of registered users: 7000+
Total number of active users: ~12

Offline

#3 2016-12-08 15:01:28

~Red
Member
Registered: 2010-10-16
Post 274/276

Re: Fainting and returning to pallet town...

Thank you, this worked!

Offline

Board footer

Powered by FluxBB