Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Reload this Page [Tutorial] How to Change the Start Map with a Hex Editor (FireRed only)

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
 
Thread Tools
  #1    
Old February 21st, 2013 (09:16 AM). Edited February 22nd, 2013 by karatekid552.
karatekid552's Avatar
karatekid552 karatekid552 is offline
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
Posts: 1,767
Send a message via AIM to karatekid552 Send a message via Windows Live Messenger to karatekid552 Send a message via Skype™ to karatekid552
This tutorial is for FireRed hackers who use JPAN's Hacked Engine and have had the unfortunate experience of opening SMCA to get this error:


(I'll type it too, so hopefully searching the error in Google will find this page)
Run-time error '380':

Invalid property value


I will explain what caused this error in a little bit, but first, let's do what SMCA can do with a Hex editor. I personally recommend HxD for this.

So, here are your offsets:
(These are taken from the source code of SMCA, except for the y-coordinate, which I had to find myself, only later realizing JPAN had documented it in his notes for the first Hacked Engine release.)


Quote:
Bank = 0x054A04
Level = 0x054A06
X-coordinate = 0x054A08
Y-coordinate = 0x054A00
And, here they are in HxD (on a copy of FireRed with the Hacked Engine of course):



So, it is as simple as changing those bytes to match what you want the starting players location to be. Remember, everything is in Hex.


Now, you will notice I did not tell you how to change the player facing. In a standard, unhacked FireRed, the location for the player facing is 0x168CCB and here is a key:

Quote:
down= 01
up= 02
left= 03
right= 04
Now, let's go to that offset in the hacked copy of FireRed:




As you can see, this location has been removed by JPAN. It was a map script and in his hacked engine, all scripts are removed. This is what caused the error in SMCA. It was looking for either a 01, 02, 03, or 04 at offset 0x168CCB, but instead got an FF.

Thanks to DrFuji, we now know how to add this feature back in.

Here is the script we are going to use:
Code:
#Dynamic 0x800000
#org @start
spriteface 0xFF 0x(refer to above key for direction)
setvar 0x4056 0x1
end

Now, just insert this script into the Map Script section of the Header of your start map in Advance Map:

Settings-
Type:04
Flag:4056
Value:0000
Script Offset 2: @start (from the script)

Credits:
JPAN
HackMew
DrFuji
__________________

Paired with Simba
Reply With Quote
  #2    
Old February 22nd, 2013 (06:36 AM).
hukurae's Avatar
hukurae hukurae is offline
 
Join Date: Aug 2009
Gender: Male
Posts: 8
Wow I'm gonna try this sooooon

thank you very much xD
Reply With Quote
  #3    
Old February 22nd, 2013 (08:43 AM).
karatekid552's Avatar
karatekid552 karatekid552 is offline
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
Posts: 1,767
Send a message via AIM to karatekid552 Send a message via Windows Live Messenger to karatekid552 Send a message via Skype™ to karatekid552
Quote originally posted by hukurae:
Wow I'm gonna try this sooooon

thank you very much xD
You are very welcome. I hope it helps everyone out!
__________________

Paired with Simba
Reply With Quote
  #4    
Old February 22nd, 2013 (11:49 AM).
GoGoJJTech's Avatar
GoGoJJTech GoGoJJTech is offline
http://GoGoJJTech.com (WIP!)
Silver Tier
 
Join Date: Nov 2012
Location: Earth
Age: 16
Gender: Male
Nature: Quiet
Posts: 1,965
Nice!
great tut this can help all hackers who used this engine.

Also i dont know the offset for the player facing,
so my idea is to search for the string in hxd and find the pointer to it
__________________
I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this into your signature.
The SoulSilver Music Patch - The Black Music Patch - Mega-Huge Sappy Tutorial
Romhack.me Profile - Pokecommunity Profile - Pokemonhackersonline Profile - Youtube Channel

Join us in the romhacking chat
Pokémon Platinum Red and Blue
Reply With Quote
  #5    
Old February 22nd, 2013 (11:55 AM).
karatekid552's Avatar
karatekid552 karatekid552 is offline
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
Posts: 1,767
Send a message via AIM to karatekid552 Send a message via Windows Live Messenger to karatekid552 Send a message via Skype™ to karatekid552
Quote originally posted by gogojjtech:
Nice!
great tut this can help all hackers who used this engine.

Also i dont know the offset for the player facing,
so my idea is to search for the string in hxd and find the pointer to it
I already tried that, my best bet is it is part of an ASM routine that loads offset by adding a certain amount to an earlier offset. But, i just had an idea! Set a breapoint on the read of the playerfacing location in a clean rom. Let me give this a try.....
__________________

Paired with Simba
Reply With Quote
  #6    
Old February 22nd, 2013 (01:18 PM).
GoGoJJTech's Avatar
GoGoJJTech GoGoJJTech is offline
http://GoGoJJTech.com (WIP!)
Silver Tier
 
Join Date: Nov 2012
Location: Earth
Age: 16
Gender: Male
Nature: Quiet
Posts: 1,965
You can copy the old playerfacing and paste it in a free space, then point everything to there.
can that work?
__________________
I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this into your signature.
The SoulSilver Music Patch - The Black Music Patch - Mega-Huge Sappy Tutorial
Romhack.me Profile - Pokecommunity Profile - Pokemonhackersonline Profile - Youtube Channel

Join us in the romhacking chat
Pokémon Platinum Red and Blue
Reply With Quote
  #7    
Old February 22nd, 2013 (01:32 PM). Edited February 22nd, 2013 by karatekid552.
karatekid552's Avatar
karatekid552 karatekid552 is offline
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
Posts: 1,767
Send a message via AIM to karatekid552 Send a message via Windows Live Messenger to karatekid552 Send a message via Skype™ to karatekid552
Quote originally posted by gogojjtech:
You can copy the old playerfacing and paste it in a free space, then point everything to there.
can that work?
I tried but it doesn't work.
__________________

Paired with Simba
Reply With Quote
  #8    
Old February 22nd, 2013 (02:58 PM).
GoGoJJTech's Avatar
GoGoJJTech GoGoJJTech is offline
http://GoGoJJTech.com (WIP!)
Silver Tier
 
Join Date: Nov 2012
Location: Earth
Age: 16
Gender: Male
Nature: Quiet
Posts: 1,965
Hmm, so taking the old one doesn't work, and searching for the new one doesn't work,
seems like it all must be stored in the ram, or something crazy like that.
maybe the whole thing was just recreated, like a whole new way of calling the beginning.
Maybe creating your own kind, and in a clean rom, find all offsets that point to the one in the clean rom.
Then in the hacked rom, go to those pointers and point to the new address where you made yours.
all this is nuts man!
__________________
I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this into your signature.
The SoulSilver Music Patch - The Black Music Patch - Mega-Huge Sappy Tutorial
Romhack.me Profile - Pokecommunity Profile - Pokemonhackersonline Profile - Youtube Channel

Join us in the romhacking chat
Pokémon Platinum Red and Blue
Reply With Quote
  #9    
Old February 22nd, 2013 (03:05 PM).
karatekid552's Avatar
karatekid552 karatekid552 is offline
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
Posts: 1,767
Send a message via AIM to karatekid552 Send a message via Windows Live Messenger to karatekid552 Send a message via Skype™ to karatekid552
Quote originally posted by gogojjtech:
Hmm, so taking the old one doesn't work, and searching for the new one doesn't work,
seems like it all must be stored in the ram, or something crazy like that.
maybe the whole thing was just recreated, like a whole new way of calling the beginning.
Maybe creating your own kind, and in a clean rom, find all offsets that point to the one in the clean rom.
Then in the hacked rom, go to those pointers and point to the new address where you made yours.
all this is nuts man!
It is. I found the routine in the origional rom that calls the player facing information. When I open this routine in JPAN's, there is no routine, it is just junk.
__________________

Paired with Simba
Reply With Quote
  #10    
Old February 22nd, 2013 (05:14 PM).
Shubunkus's Avatar
Shubunkus Shubunkus is offline
I.R.
 
Join Date: Jul 2012
Gender: Male
Nature: Bold
Posts: 49
Hey, this is great! Only one problem though, I tried this on an unhacked FireRed but the when I try to change the way the player is facing, he always ends up facing down no matter what I do. Do you know why this is?
__________________
Reply With Quote
  #11    
Old February 22nd, 2013 (05:31 PM).
DrFuji's Avatar
DrFuji DrFuji is offline
Helfen, Wehren, Heilen
Crystal Tier
 
Join Date: Sep 2009
Location: Downia-upside
Age: 22
Gender: Male
Nature: Jolly
Posts: 1,322
Quote originally posted by karatekid552:
If someone does know the location of the player facing, please let me know so I can add it to this tutorial.
Actually, JPAN's engine removes that part completely, you can see this because the player faces up at the beginning of a regular FR ROM whereas they face down in a patched version. The reason behind this is because the direction the player faces is determined by a level script in the player's room which is only activated when they first enter/ spawn there. But since all scripts are cleared in the patch it was replaced with 0xFF bytes, leading to the error encountered.

Anyway, this is a pretty helpful/ simple tutorial to get around the problems associated with SMCA and its even better now that people will be able to know at a glance how to change that elusive Y-coordinate :P
__________________
Reply With Quote
  #12    
Old February 22nd, 2013 (05:50 PM).
Shubunkus's Avatar
Shubunkus Shubunkus is offline
I.R.
 
Join Date: Jul 2012
Gender: Male
Nature: Bold
Posts: 49
Quote originally posted by DrFuji:
Actually, JPAN's engine removes that part completely, you can see this because the player faces up at the beginning of a regular FR ROM whereas they face down in a patched version. The reason behind this is because the direction the player faces is determined by a level script in the player's room which is only activated when they first enter/ spawn there. But since all scripts are cleared in the patch it was replaced with 0xFF bytes, leading to the error encountered.

Anyway, this is a pretty helpful/ simple tutorial to get around the problems associated with SMCA and its even better now that people will be able to know at a glance how to change that elusive Y-coordinate
So, I decided to check this out and found that the level script type for the way the player is facing is a "Validates Values... [4]". Is it possible that I could have this level script and a level script of the "[2] Validates Values" at the same time so the player is facing a certain way and have another level script activate at the same time?
__________________
Reply With Quote
  #13    
Old February 22nd, 2013 (06:02 PM).
karatekid552's Avatar
karatekid552 karatekid552 is offline
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
Posts: 1,767
Send a message via AIM to karatekid552 Send a message via Windows Live Messenger to karatekid552 Send a message via Skype™ to karatekid552
Quote originally posted by DrFuji:
Actually, JPAN's engine removes that part completely, you can see this because the player faces up at the beginning of a regular FR ROM whereas they face down in a patched version. The reason behind this is because the direction the player faces is determined by a level script in the player's room which is only activated when they first enter/ spawn there. But since all scripts are cleared in the patch it was replaced with 0xFF bytes, leading to the error encountered.

Anyway, this is a pretty helpful/ simple tutorial to get around the problems associated with SMCA and its even better now that people will be able to know at a glance how to change that elusive Y-coordinate
Thank you DrFuji, but I have a question, why was it so elusive? It was so close to the other data, i found it rather quickly. Why wasn't it included in SMCA?

The player facing makes sense. It's just a sprite behave command. Hmmm, i guess I'll add that to the tutorial. Thanks for letting me know!
__________________

Paired with Simba
Reply With Quote
  #14    
Old February 22nd, 2013 (06:43 PM).
GoGoJJTech's Avatar
GoGoJJTech GoGoJJTech is offline
http://GoGoJJTech.com (WIP!)
Silver Tier
 
Join Date: Nov 2012
Location: Earth
Age: 16
Gender: Male
Nature: Quiet
Posts: 1,965
Nice find Dr Fuji you really saved a bunch of hackers from this mess
__________________
I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this into your signature.
The SoulSilver Music Patch - The Black Music Patch - Mega-Huge Sappy Tutorial
Romhack.me Profile - Pokecommunity Profile - Pokemonhackersonline Profile - Youtube Channel

Join us in the romhacking chat
Pokémon Platinum Red and Blue
Reply With Quote
  #15    
Old August 10th, 2014 (04:56 PM).
Bauerklos's Avatar
Bauerklos Bauerklos is offline
 
Join Date: May 2014
Location: 'murica.
Gender: Male
Nature: Quiet
Posts: 18
How do I tell what the level and the bank is? Using SMCA, that is. I haven't found any good tutorials on using it.
Reply With Quote
  #16    
Old December 23rd, 2014 (07:47 AM).
klingt klingt is offline
Living Poetry
 
Join Date: Dec 2014
Gender: Male
Posts: 13
Quote:
#org 0x054A06/0x054A04
setbyte 0x2 or to whatever level/bank
end
What I used to change the level in front of the spriteface script
__________________
The experienced are the dead, collapsed in their heaps
The beyond is ahead and you can only hope to catch a glimpse
You peer into the fabric mirage
There is no form, no color
A new scene without compare nor equal
Reply With Quote
  #17    
Old January 13th, 2015 (02:55 PM).
Lance32497's Avatar
Lance32497 Lance32497 is offline
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Posts: 480
sorry if Im asking yah this, I aint using JPAN hacked engine and I'm having problem in SMCA, it doesnt have Y coordinate and I cant find the right X value in my desired position...
Is there a way to edit the Y position using Hex editor?
__________________
My Threads

Reply With Quote
  #18    
Old January 13th, 2015 (06:38 PM).
Hopeless Masquerade's Avatar
Hopeless Masquerade Hopeless Masquerade is offline
カミツレ
Silver Tier
 
Join Date: Mar 2010
Location: Nimbasa City
Age: 18
Gender: Female
Nature: Lax
Posts: 1,109
Quote originally posted by Lance32497:
sorry if Im asking yah this, I aint using JPAN hacked engine and I'm having problem in SMCA, it doesnt have Y coordinate and I cant find the right X value in my desired position...
Is there a way to edit the Y position using Hex editor?
This tutorial literally gives you the offsets you need to edit the map, as well as the X and Y coordinates. JPAN's engine doesn't change them.
__________________
Nimbasa City
"Lit by the Flash of Lightning!"
Supporter City Collab 2015


has no friends
Silver Supporter

Reply With Quote
  #19    
Old January 13th, 2015 (07:00 PM).
Lance32497's Avatar
Lance32497 Lance32497 is offline
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Posts: 480
Quote originally posted by itari:
This tutorial literally gives you the offsets you need to edit the map, as well as the X and Y coordinates. JPAN's engine doesn't change them.
ahhh thanks... It really helped me
__________________
My Threads

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

Forum Jump


All times are UTC -8. The time now is 04:09 PM.