Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources

Notices
For all updates, view the main page.

Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.
New threads in this forum are to be approved by a moderator before they are displayed.



Reply
Click here to go to the first staff post in this thread.  
Thread Tools
  #1    
Old August 4th, 2009 (09:27 PM). Edited October 31st, 2012 by Deokishisu.
Deokishisu's Avatar
Deokishisu
Mr. Magius
 
Join Date: Feb 2006
Location: If I'm online, it's a safe bet I'm at a computer.
Gender: Male
Nature: Relaxed
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 = Seven Island
0x14 = Six Island

^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:
Quote originally posted by Chaos Rush:
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.
Reply With Quote
  #2    
Old August 5th, 2009 (04:17 AM).
Full Metal's Avatar
Full Metal
C(++) Developer.
Community Supporter
 
Join Date: Jan 2008
Location: In my mind.
Age: 19
Gender: Male
Nature: Timid
Send a message via Windows Live Messenger to Full Metal
so you haven' figured out how to add more yet though?
__________________

★ full metal.

I like to push it,
and push it,
until my luck is over.
Reply With Quote
  #3    
Old August 5th, 2009 (05:31 AM).
0m3GA ARS3NAL's Avatar
0m3GA ARS3NAL
Im comin' home...
Community Supporter Tier 1
 
Join Date: Jan 2008
Location: Superjail Penitentiary
Age: 22
Gender: Male
Nature: Gentle
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.
__________________
>Boot Jailbot
>Pass *****
.
.
Jailbot OS Ver 1.1.2
Greetings Warden
of Superjail Penitentiary
Awaiting user input...

>Display User_Info
╠══User Info══╣
Username:
0m3GA ARS3NAL
Age: 18
Sex: Male ♂
Race: Caucasian
Quote:
"What is this
I don't even..."

M/O: Often acts out to get attention, but recently has changed that. Has been studying up on hacking information and hopes to participate in more advanced hacking discussion.
╠══End of File══╣
Awaiting user input...

>
Reply With Quote
  #4    
Old August 5th, 2009 (06:37 AM).
BlitŻ's Avatar
BlitŻ
guahh my dog is so cute
 
Join Date: Feb 2009
Location: Bay Area, Califronia.
Age: 19
Gender: Male
Nature: Jolly
this is useful, but are these also the numbers I can use in a script for sethealing place?
__________________
Reply With Quote
  #5    
Old August 5th, 2009 (11:57 AM). Edited August 5th, 2009 by Deokishisu.
Deokishisu's Avatar
Deokishisu
Mr. Magius
 
Join Date: Feb 2006
Location: If I'm online, it's a safe bet I'm at a computer.
Gender: Male
Nature: Relaxed
Quote originally posted by Fan King:
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.
Reply With Quote
  #6    
Old August 5th, 2009 (01:50 PM).
Samike360's Avatar
Samike360
Lover of May
 
Join Date: Mar 2009
Location: ATL
Gender:
Nature: Bold
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.
__________________





Please warm my eggs...I'll be sure to return the favor

From now one, if you haven't contacted me yet....I will not accept hacks unless they are at least in progressing hacks. So if you want my help, get some screenshots first.
Reply With Quote
  #7    
Old August 5th, 2009 (04:30 PM). Edited August 5th, 2009 by Deokishisu.
Deokishisu's Avatar
Deokishisu
Mr. Magius
 
Join Date: Feb 2006
Location: If I'm online, it's a safe bet I'm at a computer.
Gender: Male
Nature: Relaxed
Quote originally posted by Samike360:
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.
Reply With Quote
  #8    
Old August 5th, 2009 (05:22 PM).
Samike360's Avatar
Samike360
Lover of May
 
Join Date: Mar 2009
Location: ATL
Gender:
Nature: Bold
Quote originally posted by Deokishisu:
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.
__________________





Please warm my eggs...I'll be sure to return the favor

From now one, if you haven't contacted me yet....I will not accept hacks unless they are at least in progressing hacks. So if you want my help, get some screenshots first.
Reply With Quote
  #9    
Old August 5th, 2009 (05:41 PM).
liuyanghejerry's Avatar
liuyanghejerry
Trainer
 
Join Date: Jan 2008
Location: China,Xi'an
Nature: Calm
Send a message via ICQ to liuyanghejerry Send a message via Windows Live Messenger to liuyanghejerry Send a message via Yahoo to liuyanghejerry
Quote originally posted by Samike360:
What I'm trying to ask is how would I change what she says after all my pokemon faint.
You can use a hex editor and search what she says .
__________________
Zel,thethethethe,LU-HO,Darthatron,HackMew,ZodiacDaGreat,Juan,score_under,JPAN,Tamah-chan,I really appreciate your kindness and your help!:D


I did something that really bad.But made all Chinese can hack Pokemon, too.If you guys hate me, I totally understand,but cannot do anything but force to keep everything.
If there must be someone to undertake all spit and curse, it must be me.
Reply With Quote
  #10    
Old August 5th, 2009 (08:41 PM). Edited August 5th, 2009 by 0m3GA ARS3NAL.
0m3GA ARS3NAL's Avatar
0m3GA ARS3NAL
Im comin' home...
Community Supporter Tier 1
 
Join Date: Jan 2008
Location: Superjail Penitentiary
Age: 22
Gender: Male
Nature: Gentle
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!
__________________
>Boot Jailbot
>Pass *****
.
.
Jailbot OS Ver 1.1.2
Greetings Warden
of Superjail Penitentiary
Awaiting user input...

>Display User_Info
╠══User Info══╣
Username:
0m3GA ARS3NAL
Age: 18
Sex: Male ♂
Race: Caucasian
Quote:
"What is this
I don't even..."

M/O: Often acts out to get attention, but recently has changed that. Has been studying up on hacking information and hopes to participate in more advanced hacking discussion.
╠══End of File══╣
Awaiting user input...

>
Reply With Quote
  #11    
Old August 5th, 2009 (08:51 PM).
Deokishisu's Avatar
Deokishisu
Mr. Magius
 
Join Date: Feb 2006
Location: If I'm online, it's a safe bet I'm at a computer.
Gender: Male
Nature: Relaxed
Quote originally posted by Samike360:
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.

Quote originally posted by 0m3GA ARS3NAL:
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.
Reply With Quote
  #12    
Old August 5th, 2009 (09:16 PM).
0m3GA ARS3NAL's Avatar
0m3GA ARS3NAL
Im comin' home...
Community Supporter Tier 1
 
Join Date: Jan 2008
Location: Superjail Penitentiary
Age: 22
Gender: Male
Nature: Gentle
Quote originally posted by Deokishisu:
Glad I got people excited about this, I'll work on my end when I have the time. Maybe we can crack this.
Yeah, it would be a great thing to find table data, that means we might be able repoint and expand.
That means more Pokemon Centers!
__________________
>Boot Jailbot
>Pass *****
.
.
Jailbot OS Ver 1.1.2
Greetings Warden
of Superjail Penitentiary
Awaiting user input...

>Display User_Info
╠══User Info══╣
Username:
0m3GA ARS3NAL
Age: 18
Sex: Male ♂
Race: Caucasian
Quote:
"What is this
I don't even..."

M/O: Often acts out to get attention, but recently has changed that. Has been studying up on hacking information and hopes to participate in more advanced hacking discussion.
╠══End of File══╣
Awaiting user input...

>
Reply With Quote
  #13    
Old August 6th, 2009 (03:23 AM).
Samike360's Avatar
Samike360
Lover of May
 
Join Date: Mar 2009
Location: ATL
Gender:
Nature: Bold
Quote originally posted by Deokishisu:
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.
__________________





Please warm my eggs...I'll be sure to return the favor

From now one, if you haven't contacted me yet....I will not accept hacks unless they are at least in progressing hacks. So if you want my help, get some screenshots first.
Reply With Quote
  #14    
Old August 16th, 2009 (10:16 PM).
Learath2's Avatar
Learath2
Scripter
 
Join Date: Aug 2009
Location: Turkey
Gender: Male
Nature: Calm
İt is a noobish question but what do you mean by pc ?
Reply With Quote
  #15    
Old August 16th, 2009 (11:27 PM).
Mateo's Avatar
Mateo
Johto Region Champion
 
Join Date: Jun 2005
Location: Celadon Mansion
Age: 25
Nature: Quirky
Quote originally posted by Learath2:
İt is a noobish question but what do you mean by pc ?
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.
__________________
mateo.





"Haha! The fun has been doubled!" - Princess Luna
Reply With Quote
  #16    
Old August 17th, 2009 (10:08 AM).
0m3GA ARS3NAL's Avatar
0m3GA ARS3NAL
Im comin' home...
Community Supporter Tier 1
 
Join Date: Jan 2008
Location: Superjail Penitentiary
Age: 22
Gender: Male
Nature: Gentle
Quote originally posted by Mateo:
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.
__________________
>Boot Jailbot
>Pass *****
.
.
Jailbot OS Ver 1.1.2
Greetings Warden
of Superjail Penitentiary
Awaiting user input...

>Display User_Info
╠══User Info══╣
Username:
0m3GA ARS3NAL
Age: 18
Sex: Male ♂
Race: Caucasian
Quote:
"What is this
I don't even..."

M/O: Often acts out to get attention, but recently has changed that. Has been studying up on hacking information and hopes to participate in more advanced hacking discussion.
╠══End of File══╣
Awaiting user input...

>
Reply With Quote
  #17    
Old August 18th, 2009 (05:29 AM).
score_under's Avatar
score_under
I program the *other* ASM.
 
Join Date: Aug 2005
Location: Hertfordshire, England
Age: 22
Nature: Rash
Quote originally posted by The blob of blobs:
so you haven' figured out how to add more yet though?
I have.
Quote originally posted by 0m3GA ARS3NAL:
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 (I also can't believe people overlooked the very fundamental sethealingplace until now... I'd considered it for a long time)
__________________
Plz not to PM me, I don't come here often enough. Email if you need me
Reply With Quote
  #18    
Old August 18th, 2009 (11:01 AM).
0m3GA ARS3NAL's Avatar
0m3GA ARS3NAL
Im comin' home...
Community Supporter Tier 1
 
Join Date: Jan 2008
Location: Superjail Penitentiary
Age: 22
Gender: Male
Nature: Gentle
Quote originally posted by score_under:
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 (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?
__________________
>Boot Jailbot
>Pass *****
.
.
Jailbot OS Ver 1.1.2
Greetings Warden
of Superjail Penitentiary
Awaiting user input...

>Display User_Info
╠══User Info══╣
Username:
0m3GA ARS3NAL
Age: 18
Sex: Male ♂
Race: Caucasian
Quote:
"What is this
I don't even..."

M/O: Often acts out to get attention, but recently has changed that. Has been studying up on hacking information and hopes to participate in more advanced hacking discussion.
╠══End of File══╣
Awaiting user input...

>
Reply With Quote
  #19    
Old August 18th, 2009 (04:15 PM).
Gamer2020's Avatar
Gamer2020
This love is a sickness...
 
Join Date: Jun 2008
Location: Distant Land
Gender: Male
Nature: Bold
Send a message via Skype™ to Gamer2020
Most importantly please say what you did to find these. I want to try to find them for emerald...
__________________
Pokemon Game Editor Download!
Pokemon TCG Assistant!
Fun Fact: Even though PGE isn't posted on PC anymore it still has the same number of downloads per day.
Accept no imitations!
Reply With Quote
  #20    
Old September 20th, 2009 (10:29 AM).
Jambo51's Avatar
Jambo51
Glory To Arstotzka
 
Join Date: Jun 2009
Gender: Male
Nature: Quiet
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.
__________________
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
Reply With Quote
  #21    
Old January 6th, 2010 (02:11 PM).
OM3GA Umbr30n's Avatar
OM3GA Umbr30n
Was Mazot2
 
Join Date: Jun 2009
Location: UK
Age: 17
Gender: Male
Nature: Relaxed
Wow this is great information, im sure this will help alot of people and will change hacks as we know them
__________________

Flareon's are Red,
Vaporeon's Blue,
Espeon is my concious,
Umbreon is my life-style

~Umbreon
Reply With Quote
  #22    
Old June 29th, 2010 (11:58 AM).
hoebeke
 
Join Date: May 2009
Gender:
I'm very sorry for bumping, but i have tried this and I must be doing SOMETHING wrong because I can't get it to work :\ please help?
Reply With Quote
  #23    
Old July 26th, 2010 (09:46 PM). Edited July 27th, 2010 by Chaos Rush.
Chaos Rush's Avatar
Chaos Rush
im sexy and i know it
 
Join Date: May 2007
Location: Taylor Swift
Gender: Male
Nature: Adamant
Sorry to bump, but here are the values for Pokemon Emerald:
Quote:
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.
__________________
Reply With Quote
  #24    
Old July 26th, 2010 (10:49 PM).
colcolstyles's Avatar
colcolstyles
Yours truly
 
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
Here are your missing values:

Code:
0x01 = Player's Room (male)
0x02 = Player's Room (female)
...
0x0C = Outside Player's House (male)
0x0D = Outside Player's House (female)
...
0x15 = Southern Island
0x00 and anything higher than 0x16 appears to always warp the player to Petalburg City.
__________________

Brother of Vrai
Reply With Quote
  #25    
Old July 31st, 2010 (10:34 AM).
Kevin's Avatar
Kevin
kevin del rey
Community Supporter
 
Join Date: Jul 2010
Location: Virginia
Age: 16
Gender: Male
Thank you so much!!! You helped me with my hack, I accidentally deleted the map scripts. =P
__________________
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 02:33 PM.