PHO - Pokémon Hackers Online
Go Back   PHO - Pokémon Hackers Online > Discussion Board > Archive > Questions & Answers

Notices

Questions & Answers Do you have a problem you need a straight answer for? Ask a question here and get an answer.

Reply
 
Thread Tools Display Modes
Old 5th March 2014, 08:48 PM   #1
ExitWound
Neophyte
 
Join Date: Mar 2014
Posts: 14
ExitWound
Default Help with PokéMarts.

So first off, I'm using this amazing FireRed ROM base found here.
I have, however, run into a problem. It seems this base was completely wiped of it's shop data... Is there any way I can create shops as I go? I only know of shop editors, but nothing to actually create your own...
ExitWound is offline   Reply With Quote
Sponsored Links
Old 6th March 2014, 02:05 AM   #2
Elsa
Let it go!
PHO VIP
 
Elsa's Avatar
 
Join Date: Apr 2010
Location: United States
Age: 21
Posts: 365
Elsa
Default

Sounds like something that would involve hex editing... Maybe someone around here would know about that xD
__________________

- - - - - - - Elsa - - - - - - -
Twitter | YouTube | Steam | Twitch
- - - - - - - - - - - - - - - - -
Elsa is offline   Reply With Quote
Old 6th March 2014, 10:03 PM   #3
ExitWound
Neophyte
 
Join Date: Mar 2014
Posts: 14
ExitWound
Default

Ehh, that's what I figured.... I'm no good for Hex Editing. :/
Does anyyybodyyy know how?
ExitWound is offline   Reply With Quote
Old 6th March 2014, 11:16 PM   #4
Kakarot1212
not that active anymore
 
Kakarot1212's Avatar
 
Join Date: Dec 2013
Location: Philippines
Age: 21
Posts: 82
Kakarot1212
Default

What do you actually mean by "shop data"? If you mean by the things that being sold(i.e Potions, Pokeball etc.) at the mart, it should be easy to fix. Cause I saw at the features of the rombase that all of its script are cleared.

Last edited by Kakarot1212; 6th March 2014 at 11:19 PM.
Kakarot1212 is offline   Reply With Quote
Likes Elsa liked this post
Old 6th March 2014, 11:23 PM   #5
ExitWound
Neophyte
 
Join Date: Mar 2014
Posts: 14
ExitWound
Default

Yeah, that. Going into a-Mart, there is no shop data... You can see the cities and the addresses that the shop is supposed to be at, but they have no items and I can't add items... Actually, here's a screenshot. It'll make it easier...

ExitWound is offline   Reply With Quote
Old 6th March 2014, 11:33 PM   #6
Miksy91
Gotta fill something here.
 
Miksy91's Avatar
 
Join Date: Jul 2013
Location: Northern Europe
Age: 27
Posts: 117
Miksy91
Default

Not sure if that offset there is a value in decimal or hexadecimal, but due to it being bigger than value 0xFFFFFF, I'd say, it's probably in decimal and the hexadecimal value of it is 0x16A298.

So what you would like to do would be searching for a pointer to address 0x16A298 with any hex editor you like. That pointer is "98 A2 16 08".

Once you find it, you would have to make it point to free space, and write your own shop data there. You can do all this with a hex editor and it's quite simple really.

It's all about having to do;
1) A little search
2) Finding free space
3) Re-writing the pointer value
4) Writing the shop data

Sounds kinda complicated as you have seemingly never done anything like this before but it's not
__________________
Miksy91 is offline   Reply With Quote
Likes Elsa liked this post
Old 6th March 2014, 11:44 PM   #7
ExitWound
Neophyte
 
Join Date: Mar 2014
Posts: 14
ExitWound
Default

Hmm... In HxD I searched for 98 A2 16 08 and it said it couldn't find it. I'm not sure what else to do without help :/
ExitWound is offline   Reply With Quote
Old 7th March 2014, 07:03 AM   #8
Kakarot1212
not that active anymore
 
Kakarot1212's Avatar
 
Join Date: Dec 2013
Location: Philippines
Age: 21
Posts: 82
Kakarot1212
Default

Quote:
Originally Posted by ExitWound View Post
Yeah, that. Going into a-Mart, there is no shop data... You can see the cities and the addresses that the shop is supposed to be at, but they have no items and I can't add items... Actually, here's a screenshot. It'll make it easier...





Then theres no need of hex editing! You just need Advance Map 1.92 and a script editor, you can search fo XSE for this, a clean fire red rom, and the patched rom.
Drop down the A-Mart editor, we dont need it from now on.

If you have all that, then your good to go, now,

First,
Open A-Map. Then set for the script editor, before we can use it,
Spoiler:



When this pops-up, choose no.
Spoiler:


After that, your ready. Now,
Spoiler:
Open A-Map twice,
Spoiler:


Load the clean rom on the first one
Spoiler:


And the patched rom on the other one.
Spoiler:


Now, go to the clean one, go to virdian city, or any city with a mart.
Click on the Brendan sprite twice, now, double click on the "W" on the door of the mart.
Spoiler:


Notice that you are now on the inside of the mart, now(word of the day) , click on the little "P" icon,
Spoiler:


Notice that a script would pop-up, that is the script of the mart, now, copy all of that, we'll need it later.
Spoiler:


Now, well move on to the next step, where the patched rom will get involved, just do the same steps on going to the map etc.,

Go to the mart, where we get the script earlier, notice that the script of the merchant is empty, which is $000000.
Spoiler:


Now, change the zero the last "0" to "1", for we to make a script for the empty scripted events, signpost, etc.,
Spoiler:


Then click on the open script, it will give you a blank script.
Spoiler:


Now, copy the script we copied before, the mart script we copied earlier, and paste it in the blank script.
Spoiler:


Now, compile it.
Spoiler:


Don't close the script yet!

Back to the A-Map, now click on the merchant, the little "P" thing. On the "script offset", copy the offset of the script, witch is located on the top of every script. But dont copy the "0x" thingy.
Spoiler:


Then save your ROM and your good to go!

Hope this helps.
Kakarot1212 is offline   Reply With Quote
Old 7th March 2014, 09:30 AM   #9
Miksy91
Gotta fill something here.
 
Miksy91's Avatar
 
Join Date: Jul 2013
Location: Northern Europe
Age: 27
Posts: 117
Miksy91
Default

Quote:
Originally Posted by ExitWound View Post
Hmm... In HxD I searched for 98 A2 16 08 and it said it couldn't find it. I'm not sure what else to do without help :/
Hmm... not sure what's the problem then actually. Assuming that mart editor reads that address (1483416) from the rom and it is indeed in decimal (it could be in hexadecimal already though! but I doubt that unless the rom base expands the rom data to 32 MB. even so, that would be a very strange place for storing the mart data due to the address being so high).

But you can always go with Domination came up with. Although I'd myself always prefer doing things the "right way". :P (Not that you would have to use a hex editor for everything, it's not like that. But it's good to understand what is really going on when you use A-Map to push all those buttons and click "Save" the changes to the rom.)

Edit:
I'll try checking this out for you actually
(Just out of curiosity to see what went wrong.)
__________________

Last edited by Miksy91; 7th March 2014 at 09:34 AM.
Miksy91 is offline   Reply With Quote
Old 7th March 2014, 10:00 AM   #10
Miksy91
Gotta fill something here.
 
Miksy91's Avatar
 
Join Date: Jul 2013
Location: Northern Europe
Age: 27
Posts: 117
Miksy91
Default

Yeah... so apparently the programmer of A-Mart wasn't smart enough to include a check whether the pointer value to any mart data had been modified or not...

Anyway, the data of Viridian City pokemart is indeed in rom address 0x16A298 in a clean pokemon firered rom file. It doesn't exist there in the rom base file though!

If you open a clean pokemon firered rom file and search for pointer value to that (98 A2 16 08), you'll run into the pointer being in address 0x16A28A. In other words, this 4-byte value determines where the mart data of Viridian City pokemart is stored. Now if you want to make room for new items for that mart, you'll have to adjust this pointer to point to free space and write the mart data there!

Like you can probably almost assume already, you can find a pointer to certain rom address (in most GBA games) with this "trick";

If we have offset 0x12AB89, that would translate to 89 AB 12 08. If we had offset 0x3789A instead, that would turn into 9A 78 03 08. And 0x1234 into 34 12 00 08 etc.

Anyway... the mart data itself is quite simple really. I'm not 100% sure about this because I didn't experiment with it, but it looks like it works like this:

[Item no.][Item no.][Item no.]...[00 00]

For example, Viridian City pokemart data (at 0x16A298) is:
04 00 | 0D 00 | 0E 00 | 12 00 | 00 00

If you take a look at this documentation in datacrystal, http://datacrystal.romhacking.net/wi...ed_-_Tutorials

you can notice that:

Code:
Item: Hex Values 

Master Ball: 0100 
Ultra Ball: 0200 
Great Ball: 0300 
Poké Ball: 0400 
Safari Ball: 0500 
Net Ball: 0600 
Dive Ball: 0700 
Nest Ball: 0800 
Repeat Ball: 0900 
Timer Ball: 0A00 
Luxury Ball: 0B00 
Premier Ball: 0C00 
Potion: 0D00 
Antidote: 0E00 
Burn Heal: 0F00 
Ice Heal: 1000 
Awakening: 1100 
Parlyz Heal: 1200
And in the game, the salesman sells "Poke Ball", "Potion", "Antidote" and "Parlyz Heal" (in this exact same order!).

And by the way... we've got a pretty good and simple introduction to rom hacking here folks!
__________________

Last edited by Miksy91; 7th March 2014 at 10:03 AM.
Miksy91 is offline   Reply With Quote
Reply

Tags
pokémarts

Thread Tools
Display Modes

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 GMT. The time now is 09:29 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc. User Alert System provided by Advanced User Tagging (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Pokémon characters and images belong to Pokémon USA, Inc. and Nintendo.
Pokémon Hackers Online (PHO) is in no way affiliated with or endorsed by Nintendo LLC, Creatures, GAMEFREAK inc,
The Pokémon Company, Pokémon USA, Inc., The Pokémon Company International, or Wizards of the Coast.
All forum/site content (unless noted otherwise) and site designs are © 2006-2013 Pokémon Hackers Online (PHO).
Green Charizard Christos TreeckoLv100

"Black 2" by ARTPOP. Kyurem artwork by XOUS.

no new posts