Jump to content

HGSS shiny memory address


Recommended Posts

I have done some searching around the forums and have not been able to come up with anything useful. I am playing Pokemon Soul Silver on Desmume and I am trying to find the memory address that holds the shiny flag for the pokemon in the first slot of the party. If someone could point me in the right direction, I would greatly appreciate it.

For some context, I am going to make a lua script that gets a "gift pokemon" and checks to see if it is shiny, if not, load savestate and repeats.

Link to comment
Share on other sites

3 hours ago, AJBinky said:

Shininess is determined by a calculation involving the Original Trainer's ID number and secret ID number, as well as the Pokémon's personality value.

The exact calculation is (TrainerID xor SecretID)xor (PersonalityValue31..16 xorPersonalityValue15..0), where the latter two values represent the highest and lowest 16 bits of the 32-bit personality value respectively; more detailed information can be found at the personality value article.

The above formula can result in a number from 0 to 65535. If the result is less than 8, then the Pokémon is Shiny. This gives an overall probability of 8/65536 or 1/8192, exactly the same as in Generation II.

Source: bulbapedia

There's no shiny flag.

Link to comment
Share on other sites

I forgot to mention that if you are using savestates you'll need a way  advance the RNG, otherwise you'll allways get the same PID. Or you could just change OT and SID before generation if you don't care about those so the pokemon is shiny (you can read the rng seed with lua and probably know the pid beforehand, or get the pid, store it and load the savestate).

Not sure how much you can acomplish with lua though.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...