• 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.

[Scripting Question] Individual values are limited to 31 in Essentials per base ... But, how do I put a new limit on 36? I want normal Pokémon to have a limit of 31, but S

  • 232
    Posts
    7
    Years
    • Seen May 23, 2024
    Individual values are limited to 31 in Essentials per base ...
    But, how do I put a new limit on 36?
    I want normal Pokémon to have a limit of 31, but SHINYS Pokémon to have a limit of 36 ...
    What code should I use?
     

    JulyArt

    New Developer
  • 70
    Posts
    3
    Years
    • Seen Dec 17, 2021
    Essential Base. So this is partly understanding how present calculation operates alongside with 'what's the minimum we can do to achieve the goal'

    I'm unsure of 'what all needs to be changed', these are the location of importance. e.g. will the game allow IV stat of 36 if we don't change IV STAT LIMIT beyond 31? probably? If no, then also change IV_STAT_LIMIT, but also need to change regular default " @iv = rand(IV_STAT_LIMIT+1) " to @iv = rand(IV_STAT_LIMIT-4)" and assign default to the .shiny pkmn.
    There are two lines of shiny? one within wild encounter, one within egg hatching.

    You're looking to implement this 'logic', but not this line specifically.

    @iv = rand(IV_STAT_LIMIT+6)

    Code:
      if shinyretries>0
        shinyretries.times do
          break if egg.shiny?
          egg.personalID = rand(65536)|(rand(65536)<<16)
        end
    
    if egg.shiny? #c.edit  add in two lines of new codes here
                      pkmn.iv[s]      = rand(IV_STAT_LIMIT+6)      #something like this.
    
      end
      # Give Pokérus
      if rand(65536)<POKERUS_CHANCE
        genwildpoke.givePokerus
      end


    belows are essentials code as they are, use these to search for place of edits.
    Code:
     IV_STAT_LIMIT         = 31    # Max total IVs
    Code:
        PBStats.eachStat do |s|
          @iv[s]      = rand(IV_STAT_LIMIT+1)
          @ev[s]      = 0

    I think you got it from here. Try some stuff. Probably easiest way to check if it's working is giving yourself PKMN and see if it's still limit at IV 31
    Then put "always shiny = on" then try again, if some stats > 31 . ya done good.

    After that, then you'd do the same code to eggs, and then check eggs real quick.
     
    Last edited:
  • 232
    Posts
    7
    Years
    • Seen May 23, 2024
    Essential Base. So this is partly understanding how present calculation operates alongside with 'what's the minimum we can do to achieve the goal'

    I'm unsure of 'what all needs to be changed', these are the location of importance. e.g. will the game allow IV stat of 36 if we don't change IV STAT LIMIT beyond 31? probably? If no, then also change IV_STAT_LIMIT, but also need to change regular default " @iv = rand(IV_STAT_LIMIT+1) " to @iv = rand(IV_STAT_LIMIT-4)" and assign default to the .shiny pkmn.
    There are two lines of shiny? one within wild encounter, one within egg hatching.

    You're looking to implement this 'logic', but not this line specifically.

    @iv = rand(IV_STAT_LIMIT+6)

    Code:
      if shinyretries>0
        shinyretries.times do
          break if egg.shiny?
          egg.personalID = rand(65536)|(rand(65536)<<16)
        end
    
    if egg.shiny? #c.edit  add in two lines of new codes here
                      pkmn.iv[s]      = rand(IV_STAT_LIMIT+6)      #something like this.
    
      end
      # Give Pokérus
      if rand(65536)<POKERUS_CHANCE
        genwildpoke.givePokerus
      end


    belows are essentials code as they are, use these to search for place of edits.
    Code:
     IV_STAT_LIMIT         = 31    # Max total IVs
    Code:
        PBStats.eachStat do |s|
          @iv[s]      = rand(IV_STAT_LIMIT+1)
          @ev[s]      = 0

    I think you got it from here. Try some stuff. Probably easiest way to check if it's working is giving yourself PKMN and see if it's still limit at IV 31
    Then put "always shiny = on" then try again, if some stats > 31 . ya done good.

    After that, then you'd do the same code to eggs, and then check eggs real quick.


    Perfect! You are good at scripting!
    But there is a hole ...
    When a trainer breeds with Shinys Pokémon with Ivs over 31 using Items that pass individual values from father to son, the Pokémon is born normal with IV above 31, how to block this in the breeding done in daycare?
    Because if a normal Pokémon is born with an individual value above 31, it is not exclusive to the Shinys.
     

    JulyArt

    New Developer
  • 70
    Posts
    3
    Years
    • Seen Dec 17, 2021
    I'm still learning about PKMN games, which item is it that allows IV to be passed? It'll be easier to locate and alter the code by searching the item. e.g. I'm unsure what the code currently looks like.

    That's a good catch.

    I'm starting to understand that Essentials is like a long script. Or a book if you will. and it's kind of like. "you know which chapter this happens in?" haha
     

    StCooler

    Mayst thou thy peace discover.
  • 9,304
    Posts
    4
    Years
    • Seen yesterday
    Perfect! You are good at scripting!
    But there is a hole ...
    When a trainer breeds with Shinys Pokémon with Ivs over 31 using Items that pass individual values from father to son, the Pokémon is born normal with IV above 31, how to block this in the breeding done in daycare?
    Because if a normal Pokémon is born with an individual value above 31, it is not exclusive to the Shinys.

    In the file PField_DayCare, in the long function:
    Code:
    def pbDayCareGenerateEgg
    find the lines:
    Code:
      egg.iv[0] = ivs[0]
      egg.iv[1] = ivs[1]
      egg.iv[2] = ivs[2]
      egg.iv[3] = ivs[3]
      egg.iv[4] = ivs[4]
      egg.iv[5] = ivs[5]
    and replace them with:
    Code:
      egg.iv[0] = (egg.shiny? ? ivs[0] : [31, ivs[0]].min)
      egg.iv[1] = (egg.shiny? ? ivs[1] : [31, ivs[1]].min)
      egg.iv[2] = (egg.shiny? ? ivs[2] : [31, ivs[2]].min)
      egg.iv[3] = (egg.shiny? ? ivs[3] : [31, ivs[3]].min)
      egg.iv[4] = (egg.shiny? ? ivs[4] : [31, ivs[4]].min)
      egg.iv[5] = (egg.shiny? ? ivs[5] : [31, ivs[5]].min)
     
  • 232
    Posts
    7
    Years
    • Seen May 23, 2024
    In the file PField_DayCare, in the long function:
    Code:
    def pbDayCareGenerateEgg
    find the lines:
    Code:
      egg.iv[0] = ivs[0]
      egg.iv[1] = ivs[1]
      egg.iv[2] = ivs[2]
      egg.iv[3] = ivs[3]
      egg.iv[4] = ivs[4]
      egg.iv[5] = ivs[5]
    and replace them with:
    Code:
      egg.iv[0] = (egg.shiny? ? ivs[0] : [31, ivs[0]].min)
      egg.iv[1] = (egg.shiny? ? ivs[1] : [31, ivs[1]].min)
      egg.iv[2] = (egg.shiny? ? ivs[2] : [31, ivs[2]].min)
      egg.iv[3] = (egg.shiny? ? ivs[3] : [31, ivs[3]].min)
      egg.iv[4] = (egg.shiny? ? ivs[4] : [31, ivs[4]].min)
      egg.iv[5] = (egg.shiny? ? ivs[5] : [31, ivs[5]].min)

    St. Cooler always sending well
     
    Back
    Top