The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

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.


Advertise here

Reply
Click here to go to the first staff post in this thread.  
Thread Tools
  #1    
Old February 21st, 2013, 09:16 AM
karatekid552's Avatar
karatekid552
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
Send a message via AIM to karatekid552 Send a message via Windows Live Messenger to karatekid552 Send a message via Skype™ to karatekid552

Advertise here
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

Last edited by karatekid552; February 22nd, 2013 at 06:15 PM. Reason: If I could spell things correctly the first time....
Reply With Quote
  #2    
Old February 22nd, 2013, 06:36 AM
hukurae's Avatar
hukurae
Unhatched Egg
 
Join Date: Aug 2009
Gender: Male
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
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
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 View Post
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
アルファ近く
 
Join Date: Nov 2012
Location: Earth
Age: 15
Gender: Male
Nature: Quiet
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
__________________
Reply With Quote
  #5    
Old February 22nd, 2013, 11:55 AM
karatekid552's Avatar
karatekid552
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
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 View Post
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
アルファ近く
 
Join Date: Nov 2012
Location: Earth
Age: 15
Gender: Male
Nature: Quiet
You can copy the old playerfacing and paste it in a free space, then point everything to there.
can that work?
__________________
Reply With Quote
  #7    
Old February 22nd, 2013, 01:32 PM
karatekid552's Avatar
karatekid552
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
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 View Post
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

Last edited by karatekid552; February 22nd, 2013 at 01:50 PM.
Reply With Quote
  #8    
Old February 22nd, 2013, 02:58 PM
GoGoJJTech's Avatar
GoGoJJTech
アルファ近く
 
Join Date: Nov 2012
Location: Earth
Age: 15
Gender: Male
Nature: Quiet
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!
__________________
Reply With Quote
  #9    
Old February 22nd, 2013, 03:05 PM
karatekid552's Avatar
karatekid552
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
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 View Post
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
I.R.
 
Join Date: Jul 2012
Gender: Male
Nature: Bold
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
Helfen, Wehren, Heilen
 
Join Date: Sep 2009
Location: Upside-downia
Age: 21
Gender: Male
Nature: Jolly
Quote:
Originally Posted by karatekid552 View Post
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
I.R.
 
Join Date: Jul 2012
Gender: Male
Nature: Bold
Quote:
Originally Posted by DrFuji View Post
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
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
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 View Post
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
アルファ近く
 
Join Date: Nov 2012
Location: Earth
Age: 15
Gender: Male
Nature: Quiet
Nice find Dr Fuji you really saved a bunch of hackers from this mess
__________________
Reply With Quote
  #15    
Old August 10th, 2014, 04:56 PM
Bauerklos's Avatar
Bauerklos
 
Join Date: May 2014
Location: 'murica.
Gender: Male
Nature: Quiet
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
Reply
Quick Reply

Sponsored Links


Advertise here
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 12:43 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.