• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best places on the 'net to talk Pokémon and more! Community members will not see the bottom screen advertisements.
  • Want to share your adventures playing Pokémon?
    Check out our new Travel Journals forum for sharing playthroughs of ROM Hacks, Fan Games, and other Pokémon content!
  • IMPORTANT: Following a takedown request, the following hacks have been delisted from PokéCommunity:

    • Pokémon Glazed
    • Pokémon: Giratina Strikes Back
    • Pokémon Flora Sky
    • Pokémon Stranded
    The downloads and discussion threads for these hacks will no longer be accessible, and staff will be unable to return questions regarding accessing this content.

Om3GA ARS3NAL's Scripting Secrets

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
Sorry if I say that but... this is just the way the Pokémon Daycare works. It's not really like a "takepokemon" in the true meaning of the term. Basically a surrogate, if you ask me. "Who cares if it works?" you may say. Well, it doesn't really work because you wouldn't be able to use the daycare in your hacks. Keep in mind Daycare = eggs as well.

Now, what's my idea about takepokemon?
ASM hacking + scripting of course. First you need to make the usual checks to make sure the player has at least 2 Pokémon (the second one not being an egg, for example). Then you would set a variable, like 0x8000, in order to choose the Pokémon that should be taken away. Then you would check the value hold by the variable is in a proper range, that is it couldn't be 0x5 when you have just 2 Pokémon. If everything was fine you set another variable like 0x8001 to either 0x0 or 0x1. The reason of this will be explained in a minute. Then an ASM script would be called. The ASM script would first check if some Pokémon was taken away already. If so, unless variable 0x8001 is set to 0x1, the ASM script would end. Otherwhise it would get the Pokémon data and store it on a safe memory area (overwriting anything there in case a Pokémon was removed already and 0x8001 was set to 0x1). Then the Pokémon data would be erased and the rest of the data adjusted eventually. Finally a "takepokemon flag" would be set. That flag would be useful of course in case you want to get back the Pokémon with another ASM script later on or in case you want to check if a Pokémon was taken away so far. Pretty complex? Maybe. I wish I knew more ASM.
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
True HackMew, this is not quite a 'tekepokemon' per say, but it is an acceptable placeholder...
For instance, you could infact add a daycare later in the game, if this event were to come first.
(In the hack I am working on, the player has the option of giving a little girl her first pokemon, and later in my hack, there is in fact a daycare, and it works out perfectly... I have tested it and everything.)
But I do think ASM would work much better, that is why I want to learn it, and that is why I said...
0m3GA ARS3NAL said:
You still had to select the pokemon you wanted to use though...
If I could figure out how to ASM hack... I would do it... does anyone know where I can find some semi-understandable ASM tutorials? (I have always wanted to learn ASM, but I could never find a tutorial that I could understand...)
So if you can find one, please tell me... and I'll start working on it... or you people can just ask M_X about it when he is done with D&N, he might do it...
 
224
Posts
15
Years
  • Seen Mar 8, 2016
So... I know about the Memory Viewer, and that particular offset... But I dont understand how I'll be able to move the "Moved" Pokemon back to the party. Wouldn't that require ASM? Or... Does the command movebyte hold some significance in this situation?

Hmm ok, I think this is possible using the loadbytefrompointer and writebytetooffset commands. This commands were explained in one of the recent RHNs. Check it out, they teach you how to use that command to change the players OW. I'm still learning how to use these commands properly, but I think it should work in theory if the Pokemon data is moved to some other place. I think it would require a lot of loadbytetooffset and writebytooffset commands though.
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
Hmm ok, I think this is possible using the loadbytefrompointer and writebytetooffset commands. This commands were explained in one of the recent RHNs. Check it out, they teach you how to use that command to change the players OW. I'm still learning how to use these commands properly, but I think it should work in theory if the Pokemon data is moved to some other place. I think it would require a lot of loadbytetooffset and writebytooffset commands though.

!!!!I have been trying to find those offsets! Can you please link me to that particular RHN?!!!!

(But yeah, I do believe that this method would work, I have renamed the first bit of information, to 'Explaining the Daycare Script'. But I do believe if I could find the location the pokemon were stored, I could pull this off... I can't find it though...)
 

ZodiacDaGreat

Working on a Mobile System
429
Posts
17
Years
I can try to attempt a routine a cheapo one first without any check for egg or party amount then improve from there. I don't promise anything though XD
 
Last edited:
224
Posts
15
Years
  • Seen Mar 8, 2016
!!!!I have been trying to find those offsets! Can you please link me to that particular RHN?!!!!

(But yeah, I do believe that this method would work, I have renamed the first bit of information, to 'Explaining the Daycare Script'. But I do believe if I could find the location the pokemon were stored, I could pull this off... I can't find it though...)

What offsets lol? The ones for the OW? If so, they are located in the INI of Hackmew's Overworld Editor RE, but anyways here's the link to the RHN: http://www.pokecommunity.com/showpost.php?p=4216237&postcount=300

Oh and just a quick question to any scripters here... The loadbytefrompointer and loadbytetooffset would work on Ruby if you want to change the main players OW, correct?
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
What offsets lol? The ones for the OW? If so, they are located in the INI of Hackmew's Overworld Editor RE, but anyways here's the link to the RHN: http://www.pokecommunity.com/showpost.php?p=4216237&postcount=300

Oh and just a quick question to any scripters here... The loadbytefrompointer and loadbytetooffset would work on Ruby if you want to change the main players OW, correct?

By Offset, I mean the offsets in the RAM.
The bytes with the sprite information have to be stored somewhere... and the offsets to that have to be something, ammirite?
I know them now though, Darthatron showed me, I am going to check out that RHN now...
 

ZodiacDaGreat

Working on a Mobile System
429
Posts
17
Years
You can search for it in the RAM ^^ Open the Search For Cheats, and set it to this:
Search Type = Specific Value
Data Size = 32 bits
Compare Type = Equal
Signed/Unsigned = Hex
value = 08+pointertomale/female sprite data
 
Last edited:
219
Posts
16
Years
This is the script that retaken the pokemons to the player.
But this is just a simple one,I remove the "check" thing,so if there's any problems about your team (Is it full?),it may go wrong.And I also remove the "Pay" function ,so that you can get your pokemon back for free.

Code:
'This script isn't safe,just for test!
#dynamic 0x575288
lock
faceplayer
setvar 0x8004 0x0
special2 LASTRESULT 0xC0
message @2 0x2
release
end

#org @2
= Done.
Hope it helps...
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
This is the script that retaken the pokemons to the player.
But this is just a simple one,I remove the "check" thing,so if there's any problems about your team (Is it full?),it may go wrong.And I also remove the "Pay" function ,so that you can get your pokemon back for free.

Code:
'This script isn't safe,just for test!
#dynamic 0x575288
lock
faceplayer
setvar 0x8004 0x0
special2 LASTRESULT 0xC0
message @2 0x2
release
end

#org @2
= Done.
Hope it helps...

I think you dont understand Special2's function... Special2 writes a value to the variable given (In this case, it would be LASTRESULT (0x800D))
What this script here does, is...

Lock the player
Make the sprite face the player
set 0x8004 to 0
set LASTRESULT to an unknown value stored in special2 0xC0
Display a message
Unlock player and sprite
end script

This does not add the pokemon to the party, I am afraid...


Also, ZodiacDaGreat, how would searching for the sprite data make a difference? Shouldn't I search for the pokemon's party data?
 

ZodiacDaGreat

Working on a Mobile System
429
Posts
17
Years
Excuse me? Who was it that wanted the pointer to where the player's sprite location is stored? Anyway, for pokemon party data its all here:
* Ruby: 0x03004360
* Sapphire: 0x03004360
* Emerald: 0x02024190 (0x020244EC for US games??)
* FireRed: 0x02024284
* LeafGreen: 0x020241e4
He's what I can do, copy the data of one pokemon to another area in the ROM(Taking Pokemon) and copying it back(Giving) the only thing I have yet to try is whether or not the data copied to a different area of the ROM is saved if the player saves the game and turns off the GBA.
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
Excuse me? Who was it that wanted the pointer to where the player's sprite location is stored? Anyway, for pokemon party data its all here:

He's what I can do, copy the data of one pokemon to another area in the ROM(Taking Pokemon) and copying it back(Giving) the only thing I have yet to try is whether or not the data copied to a different area of the ROM is saved if the player saves the game and turns off the GBA.

Oh, *Facepalm* I know where they are now, I asked Darthatron, he told me a day ago...
Sorry, but in any case... What is the format of the Party Data? like, what do the different bytes mean?
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
Well then... this should not be so hard... all we gotta do is insert a pokemon into the 'daycare' system, then search for the missing bytes elsewhere in the RAM, then once found, we gotta load the missing bytes into 100 different variables, and write them back to the missing party slot...
 

ZodiacDaGreat

Working on a Mobile System
429
Posts
17
Years
lol, thats off - using 100 variables cause it makes no difference of wasting variables :/ ASM is your best bet here.

Edit: Its problematic if you try something like a read and write byte array with scripting.
 
Last edited:

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
lol, thats off - using 100 variables cause it makes no difference of wasting variables :/ ASM is your best bet here.

Well, if you could load the 100 byte string representing the pokemon inserted into the daycare, divided into 100 bytes, put onto 100 variables, then you could use writebytetooffset and write the bytes to the empty slot in the party.
 
1,104
Posts
16
Years
Well, if you could load the 100 byte string representing the pokemon inserted into the daycare, divided into 100 bytes, put onto 100 variables, then you could use writebytetooffset and write the bytes to the empty slot in the party.

No ASM is the best way to do it. I've already written up a code to do it all, I just need to test it all out for any bugs and errors when I find the time.

Through the Pokemon script engine it would take up far too much space in the ROM with 100 writebytetooffset's, and load byte to offsets plus the rest of the script. Then again to send the data back, which would obviously take thousands of bytes. Those commands are only useful for the odd little thing. You're much better off with ASM and only using probably at most 1/10th of the space. It would also be more efficient time-wise.

@Zodiacdagreat
After you mentioned it to me, only some areas of the 02000000 range don't reset with the restart of the game. I didn't try the 03... range though. I only went off and found an offset that didn't reset.
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
LOL, so true, I was just trying to think of a non-ASM alternative... I dont know ASM in any case, and most tutorials I find are confusing, and not written in a way I can understand it... I wish you would make an ASM tutorial thethethethe... you make good tutorials...
 
Back
Top