• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • 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