| Touched |
May 6th, 2015 2:43 PM |
Quote:
Originally Posted by azurile13
(Post 8738999)
Alright, I wanted to implement hidden abilities in a fire red rom, and I don't mean the cheap way of simply replacing a regular ability with a hidden ability. Now, I have the theoretical method, and it is very simple. The base stats data http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_base_stats_data_structure_in_Generation_III of each pokemon has a full word of padding, and it would only take a byte to store any ability I wanted. And the pokemon data structure http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_data_structure_in_Generation_III has a ton of unused bytes (or I guess it could even be a bit) that can turn off or on the hidden ability, but aren't randomized in a random encounter. Most of it is encrypted, but there are already decryption methods, and you could even use something like language (who cares in a hack), pokerus remaining if you haven't added a RTC, or markings. Of course, that's the easy part. I have no idea where/how the game reads abilities or even how I would go about finding that out. Are there any existing guides or documentation/how would I do it myself/is this lightyears beyond the reach of a noob who is still asking the questions in beginner's lounge?
|
I don't know what you mean by a "ton of unused bytes" - there really aren't that many?
Anyway, you're right - all you really need is one bit. The main problem is finding where the abilities are set/read. You could lookup the XREFs of pokemon_getattr and pokemon_setattr, and find which set the ability bit and manually hook and change them all.
The main problem is that code like this is repeated a lot throughout the engine, and changing it is tedious at best.
Code:
u8 ability = pokemon_getattr(pokemon, REQ_ABILITY_BIT) ? base_stats[species].ability2 : base_stats[species].ability1;
What I wanted to do was change the pokemon_getattr to return a byte and change all of the above to:
Code:
u8 ability = pokemon_getattr(pokemon, REQ_ABILITY);
But I gave up because I was feeling too lazy. If you have IDA and a basic understanding of ASM, you should be able to do this - you have the right idea. Come onto the IRC and I can try to guide you through implementing this.
|