• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • 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.

[Scripting Question] Make shiny without forcing the shiny flag

  • 4
    Posts
    8
    Years
    • Seen Aug 24, 2016
    How do you force a pokemon to be shiny without forcing the shiny flag?
     
    Last edited by a moderator:
    Well, you can force a specific pokemon's shinyness with poke.makeShiny, where "poke" represents the pokemon to be edited. That can by found with several methods:
    Code:
    poke=$Trainer.party[0]
    poke=pbFirstAblePokemon
    poke=$Trainer.lastPokemon
    poke=pbGetPokemon(1)

    That's exactly what I said that I don't want. Isn't it possible to set the personalID to a value that will make it shiny?
     
    Sadly, you can't. The PersonalID also controls a lot of other things like natures and gender. Plus, there's not really a way to reverse the formula that makes a Pokemon shiny.

    Code:
      def isShiny?
        return @shinyflag if @shinyflag!=nil
        a=@personalID^@trainerID
        b=a&0xFFFF
        c=(a>>16)&0xFFFF
        d=b^c
        return (d<SHINYPOKEMONCHANCE)
      end

    which means you would need to solve this:
    Code:
    ((@personalID^@trainerID)&0xFFFF)^(((@personalID^@trainerID)>>16)&0xFFFF)<SHINYPOKEMONCHANCE
    for @personalID
     
    Sadly, you can't. The PersonalID also controls a lot of other things like natures and gender. Plus, there's not really a way to reverse the formula that makes a Pokemon shiny.

    Code:
      def isShiny?
        return @shinyflag if @shinyflag!=nil
        a=@personalID^@trainerID
        b=a&0xFFFF
        c=(a>>16)&0xFFFF
        d=b^c
        return (d<SHINYPOKEMONCHANCE)
      end

    which means you would need to solve this:
    Code:
    ((@personalID^@trainerID)&0xFFFF)^(((@personalID^@trainerID)>>16)&0xFFFF)<SHINYPOKEMONCHANCE
    for @personalID

    What's the formula for personalID and trainerID?
     
    Back
    Top