• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Killing the "Killing Pokémon Center" Glitch

Deokishisu

Mr. Magius
990
Posts
18
Years
Thought this might help out a couple people...

How to Kill the "Killing PC" Glitch

The "Killing PC Glitch" occurs when the player heals at a PC you created (i.e. one that you made out of another map or inserted into a blank map, not a PC that was already in the game and was edited) and hasn't healed at a "real" or "default" PC beforehand. It messes everything up and freezes the game as most of you know. Well, I've done some research, and I've learned how to fix it.

Now, default Nintendo PCs have two levelscripts in the map. The first goes like this:
Code:
#org 0x(offset)
sethealingplace 0x(#)
end
The second is always the same on every PC map, whose offset is: 1BC05C.

The first is what we have to worry about. When the command "sethealingplace" is used, it's basically setting that this was the last Pokémon Center the player has visited, and allows the Nurse to heal your Pokémon with the generic Nurse script without freezing. The "#" is a value in hex from 1 to 14 in Firered and Leafgreen. That means there are a total of 20 default PCs in Firered and Leafgreen.

Simply add these two levelscripts to your custom Pokémon Center, and your PC won't kill anyone.

However, there is a catch. As far as I can tell, you can't go past the default amount of Pokémon Centers included in the game. That means you can't increase the sethealingplace value past 14 and magically add another PC. If you do that, you'll appear at the last default PC, which happens to be Six Island in FR. The sethealingplace value should correspond to the previous Pokémon Center the player would have normally visited. That way, when your unsuspecting victims-I mean-loving playerbase finds their Pokémon have been eaten by a Lvl. 100 wild Cleffa, they'll go back to the previous town to heal and not, say, your unedited Seven Island's Pokemon Center.

The values go in order. In Firered they start with:
Code:
0x01 = Player's House
0x02 = Viridian City
0x03 = Pewter City
0x04 = Cerulean City
0x05 = Lavender Town
0x06 = Vermilion City
0x07 = Celadon City
0x08 = Fuchsia City 
0x09 = Cinnabar Island
0x0A = Indigo Plateau/Pokemon League Entrance
0x0B = Saffron City
0x0C = Route 4/Mt. Moon Entrance
0x0D = Route 10/Rock Tunnel Entrance
0x0E = One Island
0x0F = Two Island
0x10 = Three Island
0x11 = Four Island
0x12 = Five Island
0x13 = [B]Seven Island[/B]
0x14 = [B]Six Island[/B]

^Notice Seven and Six Island are switched.
NOTE: The levelscript for the player's house is actually in the player's room,
and not on the first floor.
As a totally random example, if you wanted to add a PC between Viridian and Pewter right before Viridian Forest, you would use 0x2 as your value for sethealingplace in your custom PC. That way, if the player dies, they will appear at Viridian's Pokémon Center and not Pewter's or Fuchsia's or another PC.

I don't hack R/S/E, but I'd imagine it'd work in a similar fashion. Someone's welcome to confirm it.

EDIT:
Sorry to bump, but here are the values for Pokemon Emerald:

Code:
0x01 = Player's Room (male)
0x02 = Player's Room (female)
0x03 = Petalburg City
0x04 = Slateport City
0x05 = Mauville City
0x06 = Rustboro City
0x07 = Fortree City
0x08 = Lilycove City
0x09 = Mossdeep City
0x0A = Sootopolis City
0x0B = Ever Grande City (Victory Road)
0x0C = Littleroot Town (left)
0x0D = Littleroot Town (right)
0x0E = Oldale Town
0x0F = Dewford Town
0x10 = Lavaridge Town
0x11 = Fallarbor Town
0x12 = Verdanturf Town
0x13 = Pacifidlog Town
0x14 = Ever Grande City (Pokemon League)
0x15 = Southern Island
0x16 = Battle Frontier

EDIT: Updated the list. Thanks colcolstyles.
 
Last edited:

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
I can imagine this would be a table, so if we can find the table data, we might be able to add more PC's... unless there IS not table, and the game just reads that one byte and does what it does...
This table data would be a bit more difficult to locate, I'll look for some help.

GREAT data BTW.
 

Deokishisu

Mr. Magius
990
Posts
18
Years
this is useful, but are these also the numbers I can use in a script for sethealing place?

Yes, put one of the values in the sethealingplace 0x(#) bit of your level script and it will port the player to the Pokemon Center that corresponds to that value when they lose. That way, your custom PC won't try to heal the player and crash the game when they lose.
 
Last edited:

Samike360

Lover of May
397
Posts
15
Years
How would I edit the Nurse Joy script? Is that the second level script you mentioned? And thanks a lot, this will prove very useful to me.
 

Deokishisu

Mr. Magius
990
Posts
18
Years
How would I edit the Nurse Joy script? Is that the second level script you mentioned? And thanks a lot, this will prove very useful to me.

It really depends on what you want to do with the Nurse Joy script, as far as I can tell, it has nothing to do with the second levelscript on the map:

Code:
#org 0x1BC05C
special 0x182
end

^Which is the same offset and everything in every PC. I've tried using the special a number of times in different situations, and it appears to do nothing. However, it has to be important for the Pokemon Center, or it wouldn't be there. So I'd just be on the safe side and leave it as is.



There are a variety of things you could do with Nurse Joy's script without killing its functionality, would you care to be more specific?

For example, in something I've been working on in my spare time, you could get to a Pokemon Center before receiving your starter. I just added a checkflag 0x828 to the beginning of her script and if I didn't have a Pokemon, I had it simply go to a msgbox instead of going through and trying to heal my nonexistant Pokemon and crashing the game.

If you wanted to go even more simple and edit what she says in each town, you'd just replace the text and repoint if it's bigger in each town's individual Nurse Joy script.

You can do anything really, she's just like any other NPC, add some checkflags, applymovements, whatever you want and she'll function in any event. Just make sure she's pointed back to her original healing script if the event's already been done with a "checkflag 0x(#)" and a "if 0x1 goto 0x(offset of healing script)".

If you don't have a clue what I'm saying, read a scripting tutorial.
 
Last edited:

Samike360

Lover of May
397
Posts
15
Years
It really depends on what you want to do with the Nurse Joy script, as far as I can tell, it has nothing to do with the second levelscript on the map:

Code:
#org 0x1BC05C
special 0x182
end
^Which is the same offset and everything in every PC. I've tried using the special a number of times in different situations, and it appears to do nothing. However, it has to be important for the Pokemon Center, or it wouldn't be there. So I'd just be on the safe side and leave it as is.



There are a variety of things you could do with Nurse Joy's script without killing its functionality, would you care to be more specific?

For example, in something I've been working on in my spare time, you could get to a Pokemon Center before receiving your starter. I just added a checkflag 0x828 to the beginning of her script and if I didn't have a Pokemon, I had it simply go to a msgbox instead of going through and trying to heal my nonexistant Pokemon and crashing the game.

If you wanted to go even more simple and edit what she says in each town, you'd just replace the text and repoint if it's bigger in each town's individual Nurse Joy script.

You can do anything really, she's just like any other NPC, add some checkflags, applymovements, whatever you want and she'll function in any event. Just make sure she's pointed back to her original healing script if the event's already been done with a "checkflag 0x(#)" and a "if 0x1 goto 0x(offset of healing script)".

If you don't have a clue what I'm saying, read a scripting tutorial.

What I'm trying to ask is how would I change what she says after all my pokemon faint.
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
Hmm, about locating possible data, I have a theory.

I was thinking that first we are going to want to search for the bank and map number of the map, then it's X/Y coordinates.
I'll see what I can come up with...


Nope, no luck...
I'll see if I can get a hold of some help here...
HackMew or something, anyone would help though!
 
Last edited:

Deokishisu

Mr. Magius
990
Posts
18
Years
What I'm trying to ask is how would I change what she says after all my pokemon faint.

The "blah blah scurried to a Pokemon Center" bit? Or the "if your Pokemon's HP is low please come see us" bit?

Well, either way, A-Text is an easy way to edit it. Open your ROM with it, search for the text you want, hit resume 'till you find it, add it to the ini, and edit it from there. It'll even repoint it for you if it's bigger than the previous text.

Hmm, about locating possible data, I have a theory.

I was thinking that first we are going to want to search for the bank and map number of the map, then it's X/Y coordinates.
I'll see what I can come up with...


Nope, no luck...
I'll see if I can get a hold of some help here...
HackMew or something, anyone would help though!

Glad I got people excited about this, I'll work on my end when I have the time. Maybe we can crack this.
 

Samike360

Lover of May
397
Posts
15
Years
The "blah blah scurried to a Pokemon Center" bit? Or the "if your Pokemon's HP is low please come see us" bit?

Well, either way, A-Text is an easy way to edit it. Open your ROM with it, search for the text you want, hit resume 'till you find it, add it to the ini, and edit it from there. It'll even repoint it for you if it's bigger than the previous text.



Glad I got people excited about this, I'll work on my end when I have the time. Maybe we can crack this.

Ok thanks a lot. I'll see what I can do.
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
Pokemon Center.




I was thinking, could it be a list of pointers to the fly-to data for towns? I haven't hacked the Advance gen much, I'm a Metal Gen hacker mostly, but it might be worth looking into.

Checked that, and no, didn't work, still have yet to find the data for this, it would be GREAT to expand.
 

score_under

Inactive; Former ROM hack tool author, ❤️
526
Posts
18
Years
so you haven' figured out how to add more yet though?
I have.
I can imagine this would be a table, so if we can find the table data, we might be able to add more PC's... unless there IS not table, and the game just reads that one byte and does what it does...
This table data would be a bit more difficult to locate, I'll look for some help.

GREAT data BTW.
There is a table... and think what you're saying! If it "reads one byte and does what it does", then the code to do that is in the ROM somewhere! ;)

To anyone skimming this topic, this is pretty important:

BFD80 and BFDA4 in FR point to the sethealingplace table, and BFD54 and BFD78 point to it in LG.

I can't believe it wasn't found before, that was really simple :P (I also can't believe people overlooked the very fundamental sethealingplace until now... I'd considered it for a long time)
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
I have.

There is a table... and think what you're saying! If it "reads one byte and does what it does", then the code to do that is in the ROM somewhere! ;)

To anyone skimming this topic, this is pretty important:

BFD80 and BFDA4 in FR point to the sethealingplace table, and BFD54 and BFD78 point to it in LG.

I can't believe it wasn't found before, that was really simple :P (I also can't believe people overlooked the very fundamental sethealingplace until now... I'd considered it for a long time)

You didn't have to show off, lol.
I looked for a bit, and I couldn't find it, what did you do to find it?
(I looked for bank.map data, I looked for the X/Y positions, I couldn't find it.)
So if these POINT to it, then why are there 2 pointers for each ROM?
Does it point to 2 different tables?
Care to elaborate a bit?
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
Is there a tutorial for expanding either this (the sethealingplace table) or the flying table?

I could do with expanding both of them for my hack.
 

OM3GA Umbr30n

Was Mazot2
123
Posts
14
Years
  • Age 26
  • UK
  • Seen Mar 3, 2010
Wow this is great information, im sure this will help alot of people and will change hacks as we know them :P
 
Back
Top