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

[Custom Feature Question] How do I add a third gender to the game?

  • 429
    Posts
    4
    Years
    I wish to add a third Gender option to Pokemon Essentials.

    You know how if a Pokemon isn't coded to be always male, always female, or genderless, it's coded to generate a random number and make the Pokemon female if it's over a threshold determined by its Gender Ratio (such as FemaleOneEighth or Female50Percent)?

    How do I code a Pokemon to, when created, check if its random number is an even number, making it Gender3 if true and checking its female/male status normally if the number is odd?

    How do I code this Gender to be able to breed with anything that isn't genderless, taking the Male slot by default unless it's partner is male in which case it takes the female slot, and how do I code this Gender to interact with Gender-based effects like Cute Charm/Attract/Rivalry by allowing it to Attract and be Attracted by any Pokemon, count as whichever Gender allows it to evolve in the case of Pokemon like Combee and Salazzle, and trigger the boost of Rivalry whether the Gender3 or their foe has Rivalry?

    I've already drawn the gender symbol, if that helps.
     
  • 188
    Posts
    9
    Years
    • Seen May 16, 2024
    Checking the parity of a number is an easy bitwise check:
    Code:
    if randNum & 1 == 0
      #set gender flag to Gender3
    end
     
    Back
    Top