• 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

Touched

Resident ASMAGICIAN
625
Posts
9
Years
    • Age 122
    • Seen Feb 1, 2018
    I can't believe this! This development really goes so fast. I wonder what's now the current progress should be done? Hope that you'll be able to implement in Emerald as well. I'm always waiting. Since this is going along, I would make Mega sprites soon.

    Hmm... I'm confused with Mega Accessory (e.g . Mega Bracelet) and Mega Stone (e.g. Salamencite) (sorry that I've never played any Gen VI game). On the config instructions, is it correct that I should set the accessory's index number there? Then should I set the variables into the index number of the accessory "setvar 0x4060 0x161 *player var*" (in script when the player is about to obtain the key item)? If I set those variables, is it safe to leave it alone (and it will act as a check if it is enabled to Mega Evolve)? Then set evolution method and certain stones. See if I'm doing it correctly. I'm also a kind of guy who gets lost. My idea of the stone is one universal stone rather than specific stones for specific Pokemon. :P

    Anyway! Very excellent Touched. And again, waiting for Emerald.

    Yeah, just use setvar YOUR_VAR_NUMBER ITEM_INDEX to control the item that is checked. If it is 0, it's disabled. I might add an override flag (to force Mega Evo to skip item check if it's set) for story purposes if people want me to. Whatever is in this variable is the index that is checked. I made it this way for people wanting to switch characters or "upgrade" their keystone or something.

    The one for the opponent is the item seen in the message. Just leave this at 0 if you want to use the default item that is specified. Otherwise set it to the item index you want to use before a trainer battle. For example, Steven uses a "Mega Stickpin" in ORAS. So before his battle you'd set that var to the item index for that item. Then afterwards, you set it back to zero so it reverts to the default.

    Well I actually made the Eviolite code, so I can definitely fix it to make it work, as Christos said.

    From what I understand your evolutions are entry 0xFE or 0xFF, and I can make those exceptions.

    I'm only using 0xFE. The other variants of Mega Evolution use the unknown hword. What you might be able to do is check the limiter in the evolution types jumptable and disable eviolite if it the index is outside that. That way if people need to change the number or use the evolution table for something else, it won't break eviolite again.

    Just waiting for emerald release :)

    Testing for most bugs is happening on FR, while I research Emerald battle mechanics. You could speed this along by helping test for any glitches and submitting what you find (it it hasn't been already) on GitHub.
     
    218
    Posts
    10
    Years
    • Seen Nov 12, 2021
    Hey Touched, great work here but I have an unrelated issue. There is 47 mega Orbs, and the bag only supports 42 items currently. I previously hacked the ball slot with no problem but for some reason I can only get slots to go up to 42... Any thoughts on this?

    I'm not sure create a new item bag is necessary since you can only evolve one pokemon/fight anyway. We can simply use the PC as for the other items
     
    457
    Posts
    10
    Years
    • Seen Apr 9, 2024
    I don't know if any of you guys occurred this very little minor error (or anyone already posted this problem):
    It doesn't destroy much and anything at all but when I fight any rival battle and including the Champion battle (which I presented in the screenshot), the name of the enemy shows the enemy Trainer's name from its data instead of the "nicknamed" name. I nicknamed to my rival "Kent" but it shows up "Terry" instead of Kent. Screenshot below:

    KpHqKq9.png
     

    Touched

    Resident ASMAGICIAN
    625
    Posts
    9
    Years
    • Age 122
    • Seen Feb 1, 2018
    I don't know if any of you guys occurred this very little minor error (or anyone already posted this problem):
    It doesn't destroy much and anything at all but when I fight any rival battle and including the Champion battle (which I presented in the screenshot), the name of the enemy shows the enemy Trainer's name from its data instead of the "nicknamed" name. I nicknamed to my rival "Kent" but it shows up "Terry" instead of Kent. Screenshot below:

    KpHqKq9.png

    Haha. I assume that replacement with the rival name is controlled by the trainer class? Anyway, thanks for the report. Can you please create an issue on GitHub so I don't lose this?
     

    pokelover1991

    champion
    32
    Posts
    9
    Years
    • Seen Oct 16, 2015
    hi guys i got the offsets list in comand promt but when i opened criminons editor i selected charmender megaevolve both byte 0 no item it was at zero press edit repointed then went with charizard and mega evolved it to charmender same way both bytes 0 and item required 0 but when i try it charmender and charizard appears alternately and it does not show in game evolution. sry to repost but nobody reply to the earlier one
     
    457
    Posts
    10
    Years
    • Seen Apr 9, 2024
    Haha. I assume that replacement with the rival name is controlled by the trainer class? Anyway, thanks for the report. Can you please create an issue on GitHub so I don't lose this?

    I reissued it on GitHub. #done

    Now I remembered something: There is a hack around to use the real name from the trainer data for the Rival and Champion classes (I mean not using the nicknamed name). If this happens, that would be a great twist with this error. I think there should be an optional stuff in the code to apply that routine if you have enabled/disabled the name usage on those classes. I don't know how you will handle that.
     
    Last edited:

    Touched

    Resident ASMAGICIAN
    625
    Posts
    9
    Years
    • Age 122
    • Seen Feb 1, 2018
    hi guys i got the offsets list in comand promt but when i opened criminons editor i selected charmender megaevolve both byte 0 no item it was at zero press edit repointed then went with charizard and mega evolved it to charmender same way both bytes 0 and item required 0 but when i try it charmender and charizard appears alternately and it does not show in game evolution. sry to repost but nobody reply to the earlier one

    Why are both item indices 0? Only the Mega must have item index set to 0. The Pokemon that will Mega Evolve must have this set to the index of the item you are using as a Mega Stone. You must also have the item you set in the variable for your keystone, otherwise the options will not appear.

    I reissued it on GitHub. #done

    Now I remembered something: There is a hack around to use the real name from the trainer data for the Rival and Champion classes (I mean not using the nicknamed name). If this happens, that would be a great twist with this error. I think there should be an optional stuff in the code to apply that routine if you have enabled/disabled the name usage on those classes. I don't know how you will handle that.

    I've fixed this. There is a new option in config.h that allows you to turn this off. Remove the "// " in front of it to enable (or rather, disable).
     
    91
    Posts
    14
    Years
    • Seen Feb 22, 2023
    Few suggestions / questions:

    First of all: You are using symbols, great, but apparently not somewhat consistantly. I just inserted the code in my on-going project where I repointed a lot of tables to another space (Had to, because moar Pokémon) - And figured that names, evolutions, base stats, etc. are all hard-coded somewhere in your project files. I was not able to find them. Why not use #defines or symbols for that?

    Next: I wanted to change the insertion location and thought, hey, lets just use the linker, but all that did was change the offsets internally, which again was great but I had to manually move the code from 0x800000 to 0x1750000 where I wanted to have it. Little issue, but nerv-wrecking if I have to do it over and over again.

    Appart from that: Great work, great code, I really like it and am looking forward to using it. :)

    ~SBird
     

    pokelover1991

    champion
    32
    Posts
    9
    Years
    • Seen Oct 16, 2015
    Few suggestions / questions:

    First of all: You are using symbols, great, but apparently not somewhat consistantly. I just inserted the code in my on-going project where I repointed a lot of tables to another space (Had to, because moar Pokémon) - And figured that names, evolutions, base stats, etc. are all hard-coded somewhere in your project files. I was not able to find them. Why not use #defines or symbols for that?

    Next: I wanted to change the insertion location and thought, hey, lets just use the linker, but all that did was change the offsets internally, which again was great but I had to manually move the code from 0x800000 to 0x1750000 where I wanted to have it. Little issue, but nerv-wrecking if I have to do it over and over again.

    Appart from that: Great work, great code, I really like it and am looking forward to using it. :)

    ~SBird

    first try it on a fresh rom ,and if possible leave the location as it is dont shift the code
     

    Touched

    Resident ASMAGICIAN
    625
    Posts
    9
    Years
    • Age 122
    • Seen Feb 1, 2018
    Few suggestions / questions:

    First of all: You are using symbols, great, but apparently not somewhat consistantly. I just inserted the code in my on-going project where I repointed a lot of tables to another space (Had to, because moar Pokémon) - And figured that names, evolutions, base stats, etc. are all hard-coded somewhere in your project files. I was not able to find them. Why not use #defines or symbols for that?

    Next: I wanted to change the insertion location and thought, hey, lets just use the linker, but all that did was change the offsets internally, which again was great but I had to manually move the code from 0x800000 to 0x1750000 where I wanted to have it. Little issue, but nerv-wrecking if I have to do it over and over again.

    Appart from that: Great work, great code, I really like it and am looking forward to using it. :)

    ~SBird

    Thanks :D

    To fix the first issue, I plan to just read from a standard pointer location that tools use (like have a pointer to the value in a literal pool or something). That way it will just work without configuration. I still need to figure out exactly which tables are wrong though. This will probably end up being fixed when I migrate all addresses into the symbol table.

    As for the second, I'm not really sure how to fix that. I can't exactly change the build process now that there are tutorials and stuff. Maybe I could add command line switches to move the code? You'd still need to specify that for both insert.py and make though. As for removing it, I might make insert.py generate an IPS patch to remove the code. Too bad UPS wouldn't work for this purpose due to the checksums.


    I've told you how to fix this. You haven't configured the evolutions properly. I'm not explaining again, it's all in the tutorial. Please stop spamming my thread.
     

    Exodrake

    The Manliest Chick that Ever Manlied
    163
    Posts
    10
    Years
    • Seen Nov 30, 2016
    Next: I wanted to change the insertion location and thought, hey, lets just use the linker, but all that did was change the offsets internally, which again was great but I had to manually move the code from 0x800000 to 0x1750000 where I wanted to have it. Little issue, but nerv-wrecking if I have to do it over and over again.

    You have to change the offset in insert.py itself as well as the linker file. Insert.py can be dragged onto notepad and edited there just the same. I did this and everything assembled to A00000 like I wanted it to.
     

    Criminon

    Forever Spriting
    265
    Posts
    11
    Years
  • If you have a Pokémon mega evolve by having a move instead of an item, and holding Eviolite, it'll get its defences boosted by 1.5x because it has an "evolution", though that's actually used to make the Pokémon revert back to the original after the battle.

    Also, final forms of Pokémon that have mega evolutions will also have their defences boosted if they're holding Eviolite because they'd have an evolution, the mega one. Because of this I think it'd be simpler to just change the Eviolite item rather than the mega evolutions.

    I feel like an idiot. I was thinking everstone. This makes much more sense.
     

    pokelover1991

    champion
    32
    Posts
    9
    Years
    • Seen Oct 16, 2015
    i m literally sry touched for just irritating i m just 13 it is quiet hard for me figure this out i think i will get it soo sry for creating problems.
     

    Exodrake

    The Manliest Chick that Ever Manlied
    163
    Posts
    10
    Years
    • Seen Nov 30, 2016
    Found another bug, will report issue on GitHub.

    Notice how Draco Meteor doesn't reduce her special attack because she used it the same turn as the mega evolution.
     

    Touched

    Resident ASMAGICIAN
    625
    Posts
    9
    Years
    • Age 122
    • Seen Feb 1, 2018
    Found another bug, will report issue on GitHub.

    Notice how Draco Meteor doesn't reduce her special attack because she used it the same turn as the mega evolution.

    Have you updated to the latest version? I can see a small pixel under the mega evolution icon which means the healthbox wasn't updated. This, among other issues such as Mega Evolution priority have been fixed in more recent code. Since I moved sequence to before the moves execute this issue might not be valid anymore.
     

    Exodrake

    The Manliest Chick that Ever Manlied
    163
    Posts
    10
    Years
    • Seen Nov 30, 2016
    I updated and cannot for the life of me enable Mega Evolution for myself. It's working great for the AI but I can't seem to enable it. I set the item ID in the config file to 15B, which is my key stone, and I also set the index number in the item editor. I have the key stone item and I still cannot Mega Evolve. I edited a script to set variable 4001 to 15B and it still won't let me Mega Evolve. Is there another file I need to edit the item ID in? (Or simply disable the key stone check so you can always Mega Evolve like before)
     
    Last edited:

    Touched

    Resident ASMAGICIAN
    625
    Posts
    9
    Years
    • Age 122
    • Seen Feb 1, 2018
    I updated and cannot for the life of me enable Mega Evolution for myself. It's working great for the AI but I can't seem to enable it. I set the item ID in the config file to 15B, which is my key stone, and I also set the index number in the item editor. I have the key stone item and I still cannot Mega Evolve. I edited a script to set variable 4001 to 15B and it still won't let me Mega Evolve. Is there another file I need to edit the item ID in? (Or simply disable the key stone check so you can always Mega Evolve like before)

    Maybe I broke the check. Try compiling with make DEFS="-DDISABLE_KEYSTONE_CHECK" instead of just make to disable the item checking. Alternatively, go into config.h and uncomment (remove the "//") from the line that says "#define DISABLE_KEYSTONE_CHECK". I leave that off because I couldn't be bothered to write a give item script, so I might've not noticed if it stopped working.
     

    Exodrake

    The Manliest Chick that Ever Manlied
    163
    Posts
    10
    Years
    • Seen Nov 30, 2016
    That got everything working again, thank you. And yes, the bug in that video was fixed by your fixing the Mega Evolution priority so it's not a relevant bug anymore.
     

    Criminon

    Forever Spriting
    265
    Posts
    11
    Years
  • Hey there everyone! In anticipation of the final release on this hack, I present to you a Mega Evolution rombase.

    Please note that I have talked to touched and due to a bug the hack cannot recognize repointed pokemon tables. This means this rombase will not work until he says it works.

    What this rombase does is:

    Extends the pokemon tables and adds 100 new pokemon slots.
    Adds all Mega Evolutions from Gens 1-3, with stats, evolution paths, etc. Without their artwork or icons.
    Adds all Mega Stones from Gens 1-3, with icons, and descriptions.
    (This way if you want to add the remaining Mega Evolutions, and their prevolutions, you can do so!)

    Adds Mr.Dollsteak's decap/move/ability patch as well, so these Mega Evolutions have their correct abilities
    Adds the D/P sprites that Chaos Rush gathered. (Not for Mega Evolutions)

    I have also placed a folder in the zip that contains what I consider to be the best 64 x 64 mega evolution sprites out currently. I've spent a long time googling and that's the best I found. I know Dollsteak is continuing to work on graphics, so I'm sure we will see many more as time goes on. This folder also includes a bunch of Extra Mega Evolution images, Mega Evolution icons, Mega stone sprites, and a list of images that still need to be done.

    This also includes two .ini files; One for G3T and one for Gen III suite. These should be what you use with this patch to ensure you're able to edit them properly.

    My hope is that now that we have Mega Evolutions, and now that its so easy to add them into any standard game, we will be seeing more and more people wanting to help sprite these things.

    Download -Link

    TL;DR - This makes it so when Touched's hack is finished, all you have to do is add sprites to Mega Evolutions and you have them fully working.


    Edit:
    I have now included two patches in the download. One is the standard one I originally offered, and the other is a more enhanced version. (its the same download link)

    The enhanced versions includes:
    Fixed a bug where the Mega Bracelet item didn't have flavor text.
    Trainers above level 50 that owned Pokemon capable of Mega Evolving will mega evolve now.
    All Elite 4 Members have Mega Evolutions.
    Gary Mega Evolves his starters.
    Added in a new item called Keystone for your enemies to call when Mega Evolving.
    Gym Leaders Blaine, Sabrina, and Giovanni all have Mega Evolutions.
    Added a script at the beginning of the game that sets both your mega bracelet and their keystone to the proper variables.

    If I do anything else to these patches, its going to be with this enhanced version. I figured I would offer both, just in case people didn't want the trainers messed with.
     
    Last edited:

    Exodrake

    The Manliest Chick that Ever Manlied
    163
    Posts
    10
    Years
    • Seen Nov 30, 2016
    I bumped into a pretty obscure glitch. If a mega poke uses Dark Pulse in a double battle on the same turn as the mega evolution, the purple ring particle will be replaced by a garbled up health bar with the Dark Pulse particle's palette. This is probably specific to MrDollSteak's rombase and I'm not sure if it affects other move animations, I've only seen Dark Pulse trip this and boy was it weird. I was afraid the patch overwrote the particle graphic for that move, but Dark Pulse's animation is fine except for in that specific situation.
     
    Back
    Top