The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script [ASM & Hex] Gen 3 - A (half-failed) in-game mirror trade hack

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old May 28th, 2018 (9:01 AM). Edited June 8th, 2018 by kouromaro.
kouromaro kouromaro is offline
 
Join Date: May 2018
Posts: 11
I am working on making a script and a Thumb routine to let you trade your own Pokemon back to yourself.

It doesn't work for post-Gen-1 evolutions. I am looking for some help with this. Gen I evolutions work just fine (Kadabra, Haunter, etc.)

Below I will explain my findings, and what I did.
  • From JPAN's special script research and this RAM map, I guessed that special 0xfe is just going to trade you whichever Pokemon stored at the Opponent Pokemon Slot #1 RAM space. An experiment shows that this is the case.
  • Therefore I wrote a Thumb routine that simply copy the Pokemon in Party Slot #1 to Opponent Party Slot #1. This did enable me to trade to myself the same Pokemon at Party Slot #1.
    (Thank HackMew for the detailed tutorials, and Univ. of Waterloo for the Thumb instruction set!)
  • But the Pokemon taken from your party to trade is the one whose slot number is stored in variable 0x8009 before the trade. So, I set 0x8009 to 0x00.
  • At this point, the script and the routine effectively trade the first Pokemon in the party for itself. This is enough to evolve Gen 1 Pokemons.
  • kalarie later points out that I would need National Dex to ever evolve anything into Gen 2 and above Pokemons, so I used PKHex to enable that in my test save file. I also threw in special 0x16f into my script just to be sure.
And to test all of this, I applied all that to an unmodified Fire Red ROM base.

So here are my scripts and Thumb routine:

Thumb routine
Spoiler:
Code:
.text
.align 2
.thumb
.thumb_func
.global test_180528


main:
	push {r0-r3, lr}
  ldr r0, .PARTY_SLOT_0
  ldr r1, .OPPENENT_SLOT_0
  mov r2, #0x00
  
copy_loop:
  ldr r3, [r0, r2]
  str r3, [r1, r2]
  add r2, #0x04
  cmp r2, #0x64
  bcc copy_loop
  
	pop {r0-r3, pc}
  
  
.align 2
.PARTY_SLOT_0:
	.word 0x02024284
.OPPENENT_SLOT_0:
	.word 0x0202402C


XSE script
Spoiler:
Code:
#dynamic 0x800000


#org @main
lock
special 0x16F
setvar 0x8009 0x00
callasm 0x800001
special 0xFE
waitstate
msgbox @finish 0x06
end

#org @finish
= Something is horribly wrong.

release
end


And this is a video of it at work:


For your reference, I also attached:
  • Thumb routine
  • Compiled routine binary
  • XSE Script
  • A save file with some handy test cases

I wonder what went wrong. My only suspicion left is the removal of held item during the trade. But that would not make any sense.


Original sad post:
Spoiler:
Long story short, I tried to write a script and a Thumb routine to make an in-game trade that trade your Pokemon back at you.
It didn't work so well. Pokemon that evolves through trades without needing items evolve just fine. However, the ones that require items fail to evolve.

If someone could point out what I was missing, that would be awesome.

Attached are the ASM routines, its compiled binary and scripts that I used. Obviously, the parameter for "callasm" in the script must be adjust to where you inject the binary.

And here is my sad result:

Turns out I cannot yet post links so please visit YouTube, video 5LoNk_rrtSM. Still uploading at the time this post is made (Sorry).

I am really sorry for the curt tone. I don't mean to be rude. I am just upset at the moment.
After getting the concept, grand ideas and plan figured out more than a week ago; multiple evenings/weekend days preparing, this failure of a mere critical test bummed me out.
Especially as I was already tired when I decided to just write the short ASM routine and script. The excitement evaporates in mere seconds and all that was left was the exhaustion.
And it is 23:57 :(

After thoughts/questions:
- I wonder if there is any difference in the link-trade script that cause those Pokemon to evolve.
- Simply changing a Pokemon's evolution method (via PGE) cannot make anything evolve into Evolved-to-by-trade-holding-item Pokemon (e.g. Scizor, Steelix). (Side note, same for Deoxys, yet Mewtwo and Mew works fine).
- Locksmith Army was able to make Pokemon evolves into such Pokemon just fine. I wonder what they did differently?

Part of my mentioned grand plan was to credit the awesome people whose tutorials lead me so far, and also explained what I do for future reader; but I am bummed out, and this remains 50% failure, so allow me to postpone that for a bit.
Attached Files
File Type: asm mirror_trade_180531.asm‎ (381 Bytes, 2 views) (Save to Dropbox)
File Type: bin mirror_trade_180531.bin‎ (28 Bytes, 2 views) (Save to Dropbox)
File Type: txt mirror_trade_180531.rbc.txt‎ (209 Bytes, 1 views) (Save to Dropbox)
File Type: sav FR.sav‎ (128.0 KB, 1 views) (Save to Dropbox)
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old May 30th, 2018 (8:10 AM).
BirdstarCat13 BirdstarCat13 is offline
 
Join Date: Nov 2017
Gender: Male
Posts: 476
Lolwut? All you have to do is change the evolution method. What it evolves into is irrelevant since the game only stores evolution data in the Pokémon that evolves, and it only stores the data for what it evolves into. If you change how it evolves, then that's it. Also, I don't recommend PGE, it's known to break things.
__________________
-------------------------
I hate signatures that are just a line of text without any clear division. You weirdos know who you are ;)
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old May 30th, 2018 (3:02 PM).
kalarie kalarie is offline
 
Join Date: Jun 2008
Posts: 760
If I remember correctly you need to have the national dex activated to make pokemon past number 151 (mew) evolve, also through trading (Like Poliwhirl -> Politoed, Onix -> Steelix. That might have to do something with your issue?

To activate the national dex, use special 0x16F in a script.
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old May 30th, 2018 (7:14 PM).
BirdstarCat13 BirdstarCat13 is offline
 
Join Date: Nov 2017
Gender: Male
Posts: 476
Quote:
Originally Posted by kalarie View Post
If I remember correctly you need to have the national dex activated to make pokemon past number 151 (mew) evolve, also through trading (Like Poliwhirl -> Politoed, Onix -> Steelix. That might have to do something with your issue?

To activate the national dex, use special 0x16F in a script.
Oryou can just enable Non-Kantonian evolution.
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old May 31st, 2018 (9:43 AM). Edited May 31st, 2018 by kouromaro.
kouromaro kouromaro is offline
 
Join Date: May 2018
Posts: 11
Quote:
Originally Posted by kalarie View Post
If I remember correctly you need to have the national dex activated to make pokemon past number 151 (mew) evolve, also through trading (Like Poliwhirl -> Politoed, Onix -> Steelix. That might have to do something with your issue?

To activate the national dex, use special 0x16F in a script.
Quote:
Originally Posted by BirdstarCat13 View Post
Oryou can just enable Non-Kantonian evolution.
This was the reason I could never get Scizor, Steelix or their friends, or Deoxys via an evolution ever. Moon Stones work wonders now.
However, turns out it was not the only reason my mirror trade failed to work.

I am suspecting the fact that the Held Item got deleted... But that is natural for Evolution Items, isn't it?

Quote:
Originally Posted by BirdstarCat13 View Post
Lolwut? All you have to do is change the evolution method.
I didn't know of the National Dex check before, so I tried making the evolution method Moon Stone, which failed. But now I learned what was actually wrong with that.

I still want to look into this a little more though. Feels more "natural" evolving these Pokemons with a trade. Also, it is undoubtedly a more interesting hack :D

---

Also, I just realized I failed to attach the scripts and savefiles I said I would, so my apology for the inconvenience.
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old June 8th, 2018 (9:49 PM).
kouromaro kouromaro is offline
 
Join Date: May 2018
Posts: 11
Bumb
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content

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 -8. The time now is 9:20 AM.