• 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!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • 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] How to treat this breeding script?

  • 107
    Posts
    4
    Years
    • Seen Apr 27, 2023
    With the help of the community this script was made in order to eliminate the female Pokemon that is breeding to generate an egg of the same species.

    # Generate egg
    egg = pbNewPkmn(babyspecies,EGG_LEVEL)
    if $PokemonGlobal.daycare[0][0].gender == 1 # if daycare storage #1 is female
    $PokemonGlobal.daycare[0][0] = $PokemonGlobal.daycare[1][0] # take storage #2, turns it to #1
    $PokemonGlobal.daycare[1][0] = nil #delete #2
    elsif $PokemonGlobal.daycare[1][0].gender == 1
    $PokemonGlobal.daycare[1][0] = nil
    end

    However, if the player tries to breed with a Ditto and a Pokémon MALE*, I believe the game can create conflicts in this regard. And the ideal would be to eliminate the male Pokémon, since a Pokémon of its kind will be born.

    How to proceed in this script?

    ESSENTIALS V18.1
     
    Add "|| pbIsDitto". This way:
    Code:
    # Generate egg
    egg = pbNewPkmn(babyspecies,EGG_LEVEL)
    if $PokemonGlobal.daycare[0][0].gender == 1 || pbIsDitto?($PokemonGlobal.daycare[0][0]) # if daycare storage #1 is female
      $PokemonGlobal.daycare[0][0] = $PokemonGlobal.daycare[1][0] # take storage #2, turns it to #1
      $PokemonGlobal.daycare[1][0] = nil #delete #2
    elsif $PokemonGlobal.daycare[1][0].gender == 1 || pbIsDitto?($PokemonGlobal.daycare[1][0]) 
      $PokemonGlobal.daycare[1][0] = nil
    end
     
    A
    Add "|| pbIsDitto". This way:
    Code:
    # Generate egg
    egg = pbNewPkmn(babyspecies,EGG_LEVEL)
    if $PokemonGlobal.daycare[0][0].gender == 1 || pbIsDitto?($PokemonGlobal.daycare[0][0]) # if daycare storage #1 is female
      $PokemonGlobal.daycare[0][0] = $PokemonGlobal.daycare[1][0] # take storage #2, turns it to #1
      $PokemonGlobal.daycare[1][0] = nil #delete #2
    elsif $PokemonGlobal.daycare[1][0].gender == 1 || pbIsDitto?($PokemonGlobal.daycare[1][0]) 
      $PokemonGlobal.daycare[1][0] = nil
    end

    Thanksss! *-*
     
    Back
    Top