• 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?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Code: Mega Evolutions and Primal Reversion

That's the thing, the instructions are really vague. What is the "path" if it's not just the project root folder?
 
The error means you probably didn't add devkitarm to your path properly.
What is the exact path for these binaries with root in mind? These are the three methods I have tried.


Root -> devkitARM -> bin
Root -> bin
Root -> (binaries just inside root)
 

The keywords to google helped. I knew nothing about paths I guess. I appreciate the added help. While I'm familiar with a lot of things, doing development of this kind isn't something I've looked into. It looks like everything went AOK with this. I'll be looking into how to exactly make them mega evolve now. Thanks guys.

Edit:
Touched, when you get the time could you explain where to set the item for the mega bracelet? I don't see anything in the documentation on this. I have had gold teeth in my bags just in case it was still set to this, but I'm still not getting this to work.

Edit2:
I've looked into the "config" file and I saw you had a variable to set the mega evolution on, as well as the item to use for the flavor text when mega evolving. However after setting the 0x4001 to 0x1, it still did not work. I have also tried setting 0x4001 to 0x161 (gold teeth) to see if that worked as well, and no dice.

Also; I'm setting the evolution method to 254 (0xFE) as well as setting the level to the item ID (in hex) and I'm setting both unknown bytes to 2, assuming that the process is (1 = wishing, 2 = Mega, 3 = Primal)

[PokeCommunity.com] Mega Evolutions and Primal Reversion


Assuming I installed everything correctly, what is missing? Thanks!
 
Last edited:
Try running make && insert.py instead.
 
Nice work, Touched! I haven't tried this myself yet, and I'd love to make the thread a sticky, though a think a video showing this off first would be nice.

As for getting more sprites done, I doubt stickying the thread would actually help with that, though perhaps posting a separate thread about it in the Art section instead of having a general Gen VI resource thread might help.

But for now I'll enjoy using MrDollSteak's Mega Charizard and Venusaur sprites. :p

Thanks. I will hopefully update the main post soon with a new video and (Windows) installation instructions. I think Linux users will be able to work out my instructions easily enough. I'll let you know when I've done all that.

[PokeCommunity.com] Mega Evolutions and Primal Reversion


Would this be the correct syntax to Mega Evolve while holding a Fire Stone? (the item index number for it is 95, the instructions say to make that the level argument) Because nothing happens when I press Start with the move selection screen up, no sound effect plays and it just executes the move. Unless I need to set a variable to enable it like in the vanilla games where you require a key item to use mega evos?

Before anyone points out that I'm supposed to patch a clean ROM, I have the same problem when I do that too, the Mega Evolution just won't work. So that error in the command prompt has to be significant, because just double-clicking the insert.py seems to produce a test.GBA that is unmodified.

Yes that is the correct syntax. I would recommend hex editing them though to be sure (see below in my answer to Criminon). Check the build directory and see if both output.bin and linked.o exist. If not, the build process failed, and the hack was not inserted. I will hopefully give better instructions soon, see the bottom of this post for answers)

The keywords to google helped. I knew nothing about paths I guess. I appreciate the added help. While I'm familiar with a lot of things, doing development of this kind isn't something I've looked into. It looks like everything went AOK with this. I'll be looking into how to exactly make them mega evolve now. Thanks guys.

Edit:
Touched, when you get the time could you explain where to set the item for the mega bracelet? I don't see anything in the documentation on this. I have had gold teeth in my bags just in case it was still set to this, but I'm still not getting this to work.

Edit2:
I've looked into the "config" file and I saw you had a variable to set the mega evolution on, as well as the item to use for the flavor text when mega evolving. However after setting the 0x4001 to 0x1, it still did not work. I have also tried setting 0x4001 to 0x161 (gold teeth) to see if that worked as well, and no dice.

Also; I'm setting the evolution method to 254 (0xFE) as well as setting the level to the item ID (in hex) and I'm setting both unknown bytes to 2, assuming that the process is (1 = wishing, 2 = Mega, 3 = Primal)

[PokeCommunity.com] Mega Evolutions and Primal Reversion


Assuming I installed everything correctly, what is missing? Thanks!

I would really recommend you hex edit these. That tool (don't know what it is) seems to treat the unknown hword as two separate unknown bytes. Mine treats it as an unknown hword, which means you should only set one (I presume the first one). For standard megas, just leave these at 0. The standard mega evolution is 0, primals are 1, and wishing is 2. Be aware that the last two are untested. The condition type index is 0xFE. All of this can be seen in src/evo.h

The argument to the mega evolution is an item index for your stone/orb (mega evolution/primal reversion) or a move index (wishing). The target species is obviously just the species index for your mega Pokemon. I recommend treating this like daniilS's form(e) hack - i.e. give them the same dex index and don't change HP, gender ratio, exp curve, learnset, etc. I would say only changing the sprite, cry, stats and ability are supported.

As for that variable index, I said in my previous post that that doesn't actually get checked yet. I just selects the item index you'll see in the message. I will eventually add checks.

Is this hack compatible with Mr.DollSteak's rombase? If it is, which one should I apply first?

I have no idea. There might be some ASM in his patch that conflicts with the hooks I do. I'll probably check this later. However, I perform literally no other modifications to non-free space, so if he doesn't hook the same routines, it should be 100% compatible. This goes for any other patch too.

Also, be aware that insert.py inserts at 0x800000 by default. So yeah, I recommend testing that you can insert in a clean ROM first.

Finally, @Criminon and/or @Exodrake: I am willing to work through this process of inserting step by step on the IRC, provided that you are willing to write up my instructions into an easy-to-follow tutorial immediately afterwards. Let me know if you want to do that.
 
Also, be aware that insert.py inserts at 0x800000 by default. So yeah, I recommend testing that you can insert in a clean ROM first.\

If I want to insert it to another location should i just change this code?
Code:
where = 0x800000
to
Code:
where = 0xA00000
or is there anything else i need to change?
 
If I want to insert it to another location should i just change this code?
Code:
where = 0x800000
to
Code:
where = 0xA00000
or is there anything else i need to change?

In linker.lsc:
Code:
rom     : ORIGIN = 0x08800000, LENGTH = 32M
to
Code:
rom     : ORIGIN = 0x08A00000, LENGTH = 32M

You could also change the length to a smaller amount, but who cares.
 
Finally, @Criminon and/or @Exodrake: I am willing to work through this process of inserting step by step on the IRC, provided that you are willing to write up my instructions into an easy-to-follow tutorial immediately afterwards. Let me know if you want to do that.

I think I could write a tutorial for them and for anyone who has troubles inserting it. You were the one who helped me, after all.

TUTORIAL (for Windows)

1. The very first thing you need to do is download the hack which is on Touched's github, here. Picture

2. Unpack it(it's just one folder) and place it anywhere(on your desktop for example).

3. Create a folder called "build" in aforementioned folder.

4. Download DevkitARM here

5. You can install everything there is or just devkitARM.

6. Add it to your path.

a) Right click My Computer and click Properties
b) In the System Properties window, click on the Advanced tab.
c) In the Advanced section, click the Environment Variables button
d) Finally, in the Environment Variables window (as shown here), highlight the Path variable in the Systems Variable section and click the Edit button
e) Add "C:\devkitPro\devkitARM\bin" to what's already there and click OK. Here's an in-depth explanation by Touched.
Say you have:

C:\path\a;\C:\path\b

It's a list of paths separated by semi-colons, so add it like

C:\path\a;\C:\path\b;C:\devkitPro\devkitARM\bin

If the path you're adding has spaces in it (C:\Program Files\devkitPro\devkitARM\bin), you need to quote it and add it like so

C:\path\a;\C:\path\b;"C:\Program Files\devkitPro\devkitARM\bin"

If you just overwrite what you already have there, you might break other parts of your system.
(note: this is the location of your installed path, if you chose a different location then you'll have to alter it in order to match the location)

7. Download 'make gnu' here

8. Install it anywhere you want.(a default location is: C:\Program Files (x86)\GnuWin32)

9. Right Click My Computer, open. Then go Disc C, Program Files x86 and find a folder called: "GnuWin32". In that folder there should a bunch of folders. Find one called "bin". Copy the content of bin into your 'Mega-evolutionMaster' folder.

10.(optional) Install python 3.

11. Name your clean fire red rom "BPRE0" and place it in the folder.

12. While holding shift right click empty space in your folder and choose "open the command window".

13. Type: "make", hit enter. Then type: "insert.py" and hit enter once more.

14. You should have created a test.gba in the project root(in the folder)

If that doesn't work for you...you'll have to ask someone else, preferably Touched.
 
Last edited:
e) Copy that and click OK: C:\devkitPro\devkitARM\bin(note: this is the location of your installed path, if you chose a different location then you'll have to alter it in order to match the location)

Thanks for doing this. Would you mind if I added it to the main post?

However, you've made a mistake.

You add to ADD that to the text that is already there:

Say you have:

C:\path\a;\C:\path\b

It's a list of paths separated by semi-colons, so add it like

C:\path\a;\C:\path\b;C:\devkitPro\devkitARM\bin

If the path you're adding has spaces in it (C:\Program Files\devkitPro\devkitARM\bin), you need to quote it and add it like so

C:\path\a;\C:\path\b;"C:\Program Files\devkitPro\devkitARM\bin"

If you just overwrite what you already have there, you might break other parts of your system.
 
Last edited:
Thanks. I will hopefully update the main post soon with a new video and (Windows) installation instructions. I think Linux users will be able to work out my instructions easily enough. I'll let you know when I've done all that.



Yes that is the correct syntax. I would recommend hex editing them though to be sure (see below in my answer to Criminon). Check the build directory and see if both output.bin and linked.o exist. If not, the build process failed, and the hack was not inserted. I will hopefully give better instructions soon, see the bottom of this post for answers)



I would really recommend you hex edit these. That tool (don't know what it is) seems to treat the unknown hword as two separate unknown bytes. Mine treats it as an unknown hword, which means you should only set one (I presume the first one). For standard megas, just leave these at 0. The standard mega evolution is 0, primals are 1, and wishing is 2. Be aware that the last two are untested. The condition type index is 0xFE. All of this can be seen in src/evo.h

The argument to the mega evolution is an item index for your stone/orb (mega evolution/primal reversion) or a move index (wishing). The target species is obviously just the species index for your mega Pokemon. I recommend treating this like daniilS's form(e) hack - i.e. give them the same dex index and don't change HP, gender ratio, exp curve, learnset, etc. I would say only changing the sprite, cry, stats and ability are supported.

As for that variable index, I said in my previous post that that doesn't actually get checked yet. I just selects the item index you'll see in the message. I will eventually add checks.



I have no idea. There might be some ASM in his patch that conflicts with the hooks I do. I'll probably check this later. However, I perform literally no other modifications to non-free space, so if he doesn't hook the same routines, it should be 100% compatible. This goes for any other patch too.

Also, be aware that insert.py inserts at 0x800000 by default. So yeah, I recommend testing that you can insert in a clean ROM first.

Finally, @Criminon and/or @Exodrake: I am willing to work through this process of inserting step by step on the IRC, provided that you are willing to write up my instructions into an easy-to-follow tutorial immediately afterwards. Let me know if you want to do that.

Hey there, thanks for the wonderful information. Definitely appreciated! I would be happy to, and was already planning on writing a comprehensible guide once I fully got it working and understood it. I was planning on hitting it with a hex editor as soon as I got back to work (in 8-9ish hours)

Also it looks like your IRC is down, I don't know if it still is, but it was all last night. Regardless, I'll be in contact.
 
Why would you want to do that to yourself? There are perfectly good tools I made to insert this for you.

i was just trying ur tool and i got nowhere but stuck i prefer hex if u would help or could u create a video.i m new and i a student quiet yet so wont understand ur terms
 
i tried i just installed everything and i m stuck wat to do i created a build folder and copied the bin file and typed in comand promt it tells me there is no softwre to read .py file
 
i was just trying ur tool and i got nowhere but stuck i prefer hex if u would help or could u create a video.i m new and i a student quiet yet so wont understand ur terms

There is a tutorial how to get them working a few posts up. I'm afraid inserting this via only a hex editor would be far too complicated. It's about 5kB of code and will constantly be updated. Trust me when I say my way is easier.
 
Back
Top