Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2016-01-31 18:39:50

Halfshadow
Member
From: Italy - Lucca
Registered: 2012-04-24
Post 95/193

Crystal - Delete or edit the caught data function

Hello, at the beginning I've added the new areas for my hack after the FAST SHIP, but there is a problem, in Crystal if I catch a pokémon in the added area of CERULEAN CAVE for example the Seer in a normal Crystal see it like a pokémon caught in a glitch name area. Then the better way I think will be erase the function that add the caught area (not the level or the day time) into a PKM in my version of Crystal. Can be done?

Last edited by Halfshadow (2016-03-30 22:14:59)


The italian Pokémon Green creator.

Offline

#2 2016-02-01 13:04:12

Halfshadow
Member
From: Italy - Lucca
Registered: 2012-04-24
Post 96/193

Re: Crystal - Delete or edit the caught data function

Otherwise I have another idea. If is possible use another free byte of the pokémon structure for add the place of the catch and hack the seer function to read the place in another byte is possible maintain the function, if a pokémon would be traded into an original Crystal rom the place of the caught will be sen as "unknown" and viceversa a pokémon from an original Crystal rom will be seen as unknown in this hack but the function could remain. Can be done?


The italian Pokémon Green creator.

Offline

#3 2016-03-30 22:17:02

Halfshadow
Member
From: Italy - Lucca
Registered: 2012-04-24
Post 157/193

Re: Crystal - Delete or edit the caught data function

UP

Could be fine also an ASM that delete the caught data before a trade, then the glitches into an original Crystal will be avoid. Otherwise delete the entire function that set the caught data after the catch. Please can you help me?


The italian Pokémon Green creator.

Offline

#4 2016-03-31 07:33:42

Miksy91
Member
Registered: 2010-10-16
Post 2,243/2,317

Re: Crystal - Delete or edit the caught data function

You could indeed do it in either way, and both should be quite simple asm hacks to do, but these require some debugging or finding with some other method, where to write your own routine though.

But even an easier way to accomplish this that I can think of would be simply calling a routine that changes the caught data of every pokemon in your party to 00 00 whenever you talk to a person that you can trade with. You won't even need assembly for that.

Offline

#5 2016-03-31 13:30:23

Halfshadow
Member
From: Italy - Lucca
Registered: 2012-04-24
Post 159/193

Re: Crystal - Delete or edit the caught data function

Mhh, ok, the routines can be called via script, right? And what is the routine that change the caught data? Maybe I can add the script in the trade machine, not is necessary for the machine of the TIME CAPSULE 'cause the 1st generation structure automatically delete the caught data info.


The italian Pokémon Green creator.

Offline

#6 2016-03-31 13:44:22

Miksy91
Member
Registered: 2010-10-16
Post 2,244/2,317

Re: Crystal - Delete or edit the caught data function

You should be able to figure this out on your own based on the ram map:
http://datacrystal.romhacking.net/wiki/ … 1_Settings

Like you can see there, the first party pokemon has its caught data at $DA47-48, the second one 0x30 bytes ahead, the third one 0x30 bytes ahead of that etc.

Knowing this, this should be really simple to do, and if you write an asm routine for it, it should take less than 10 instructions to make, and wouldn't require copy pasting.
But you can also do this with pure scripting if you want although that would involve copy pasting (which is in programming generally a bad thing but doesn't really matter whether you use that kind of a method here or not). To do this by scripting, you would repeat a certain "load byte into address" script code over and over again (= 12 times in total because 2 * 6 = 12).

P.S
The addresses are of course different, but knowing what the pokemon structure should look like in wram, you should be able to find it pretty easily.

Last edited by Miksy91 (2016-03-31 13:45:12)

Offline

#7 2016-03-31 13:57:38

Halfshadow
Member
From: Italy - Lucca
Registered: 2012-04-24
Post 160/193

Re: Crystal - Delete or edit the caught data function

After the "load bytes" what happen, the script erase the bytes itself or are necessary another instructions?


The italian Pokémon Green creator.

Offline

#8 2016-03-31 14:00:12

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,281/3,508

Re: Crystal - Delete or edit the caught data function

If you want to remove the Pokeseer, it seems simpler to just:
1) Remove their script, making them a generic NPC
2) set a breakpoint to watch for it writing the "caught location" byte in their data when you catch them, and just NOP out the command, so no value is ever written there, making it work just like Gold and Silver.

No new asm routines needed, you're just removing a tiny piece of the original code so it stops causing you problems.

Offline

#9 2016-03-31 14:17:28

Halfshadow
Member
From: Italy - Lucca
Registered: 2012-04-24
Post 161/193

Re: Crystal - Delete or edit the caught data function

Yes, but the function for erase the data before a trade via script is interesting, can be used also for delete the data of the traded pokémon from a retail Crystal and can be useful for avoid any compatibility problem and maintain the seer function. :)


The italian Pokémon Green creator.

Offline

#10 2016-04-02 16:00:39

Halfshadow
Member
From: Italy - Lucca
Registered: 2012-04-24
Post 162/193

Re: Crystal - Delete or edit the caught data function

I'm always here, I can't compile the script, 'cause the "loadbyte" string don't work, I can't find on the web the correct form to compile the script, please can you show me an example of script for do this?


The italian Pokémon Green creator.

Offline

#11 2016-04-02 17:10:34

Miksy91
Member
Registered: 2010-10-16
Post 2,246/2,317

Re: Crystal - Delete or edit the caught data function

You're using a rom file for hacking (and not a disassembly) right?
Why don't you just write the script code somewhere with a hex editor and see how it works and possibly add it to the script then?

Offline

#12 2016-04-02 17:43:34

Halfshadow
Member
From: Italy - Lucca
Registered: 2012-04-24
Post 163/193

Re: Crystal - Delete or edit the caught data function

I had understood that a routine for do this was present yet, the loadbyte function. I use PKSVui as script editor, but when I try to compile the "loadbyte" like you sayed don't compile, 'cause don't match.


The italian Pokémon Green creator.

Offline

#13 2016-04-02 20:52:49

Miksy91
Member
Registered: 2010-10-16
Post 2,247/2,317

Re: Crystal - Delete or edit the caught data function

15 Load variable into RAM:                                                  Top
--------------------------
 
Application example
 
Loads a variable into RAM.
 
Structure:
 
[15][xx]
 

1A Copy variable code:                                                        Top
----------------------
 
Writes variable from RAM to ram address.
 
Structure:
 
[1A][ram address (2byte)]

I believe these are called "loadvar" and "copyvartobyte" but I'm not totally sure.
But you can write them with a hex editor as well.

Last edited by Miksy91 (2016-04-02 20:54:20)

Offline

#14 2016-04-03 00:50:08

Halfshadow
Member
From: Italy - Lucca
Registered: 2012-04-24
Post 164/193

Re: Crystal - Delete or edit the caught data function

Oh, ok, tomorrow I'll try, thank you Miksy. You think that the better way is of load and next copy and after re-do the 2 steps for the other 11 bytes?


The italian Pokémon Green creator.

Offline

#15 2016-04-03 01:16:01

Halfshadow
Member
From: Italy - Lucca
Registered: 2012-04-24
Post 165/193

Re: Crystal - Delete or edit the caught data function

Very very thanks Miksy, works! I can update the script of the machine for start the trade, all the pokémons will lose the caught data, not is a problem if other pokémon from a retail Crystal will be wrong, the more important thing is not load a glitch area, I can put a girl with the seer that says that her granny could mistake to see about traded pokémons. Thank you. :)

-EDIT- Better way: I've also added the strings to the script after you esc from the trade center, during nurse and player movement there is a second script that erase all the caught data, then also the traded pokémon from a retail Crystal will be erased and this avoid any mismatch problem.

Last edited by Halfshadow (2016-04-03 01:49:12)


The italian Pokémon Green creator.

Offline

Board footer

Powered by FluxBB