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

Changing a Pokemon's Ability based on Gender

21
Posts
8
Years
    • Seen May 13, 2016
    Hi everyone! Was hoping someone could figure out why my Mon's ability doesn't change?
    In the pbs, the mon has no hidden ability, and only 1 normal ability which is competitive.
    MultipleForms.register(:GALLIAN,{

    "ability"=>proc{|pokemon|
    next if pokemon.gender==0 # Male Gallian
    if pokemon.abilityflag && pokemon.abilityflag=0
    next getID(PBAbilities,:DEFIANT) # Female Gallian
    end
    },

    "getBaseStats"=>proc{|pokemon|
    next [90,90,80,70,70,70] if pokemon.gender==1 # Female Gallian
    },

    "getMoveList"=>proc{|pokemon|
    next if pokemon.gender==0 # Male Gallian
    movelist=[]
    case pokemon.gender
    when 1 ; movelist=[[1,:HONECLAWS],[1,:SING],[1,:PECK],[1,:TAILWHIP],
    [7,:PECK],[10,:SING],[13,:DISARMINGVOICE],[15,:FURYATTACK],
    [19,:PERISHSONG],[26,:DRILLPECK],[30,:TAILWIND],[33,:PLAYROUGH],
    [37,:SWORDSDANCE],[40,:THRASH],[44,:STEELWING],
    [47,:ACROBATICS],[53,:SKYATTACK]] # Female Gallian
    end
    for i in movelist
    i[1]=getConst(PBMoves,i[1])
    end
    next movelist
    }
    })
     
    21
    Posts
    8
    Years
    • Seen May 13, 2016
    Thanks. Made that small change but still doesn't work :c

    Here are a couple of screenshots of the issue if it helps anyone, figure out what my problem is.
    Changing a Pokemon's Ability based on Gender

    Changing a Pokemon's Ability based on Gender

    Changing a Pokemon's Ability based on Gender

    Changing a Pokemon's Ability based on Gender
     
    Last edited by a moderator:
    15
    Posts
    13
    Years
    • Seen Aug 9, 2016
    Meowstic is already programmed to determine ability based on gender.
    Try copying that code, replacing species name, ability, etc.

    Code:
    MultipleForms.register(:GALLIAN,{
    "ability"=>proc{|pokemon|
       next if pokemon.gender==0              # Male Gallian
       if pokemon.abilityflag && pokemon.abilityflag==0
         next getID(PBAbilities,:DEFIANT) # Female Gallian
       end
    },

    also, that "pokemon.abilityflag && pokemon.abilityflag=" to "pokemon.abilityflag && pokemon.abilityflag==" error is in the coding for meowstic, so I'd fix that as well.
     
    21
    Posts
    8
    Years
    • Seen May 13, 2016
    Meowstic is already programmed to determine ability based on gender.
    Try copying that code, replacing species name, ability, etc.
    Was using copy and paste for Meowstic for the mon, but decided to try it again.
    It sort of worked. It works only if their ability being changed by gender is the hidden ability.
    When try to change the abilityflag to either 0,1 it doesn't work anymore.
    Any reason why you would think that would be the case? Or maybe a workaround like have the map make the mon have the hidden ability all the time when encounter them in the wild instead of the typically 0,1 flags?
    Still relatively new to Essentials, so sorry if either of those questions are kind of basic I guess is the word for it.
     
    15
    Posts
    13
    Years
    • Seen Aug 9, 2016
    Was using copy and paste for Meowstic for the mon, but decided to try it again.
    It sort of worked. It works only if their ability being changed by gender is the hidden ability.
    When try to change the abilityflag to either 0,1 it doesn't work anymore.
    Any reason why you would think that would be the case? Or maybe a workaround like have the map make the mon have the hidden ability all the time when encounter them in the wild instead of the typically 0,1 flags?
    Still relatively new to Essentials, so sorry if either of those questions are kind of basic I guess is the word for it.
    It probably has to do with the way you receive or generate the pokémon to test whether it works.
    Try catching it in the wild, putting it in your party through Debug, and letting an NPC give it to you.
     
    21
    Posts
    8
    Years
    • Seen May 13, 2016
    It probably has to do with the way you receive or generate the pokémon to test whether it works.
    Try catching it in the wild, putting it in your party through Debug, and letting an NPC give it to you.
    Tried all 3 methods and all the females still didn't have Defiant.
    Only seems to work if it's specifically is pointing to the hidden ability instead of the natural ones.
     
    824
    Posts
    8
    Years
  • Tried all 3 methods and all the females still didn't have Defiant.
    Only seems to work if it's specifically is pointing to the hidden ability instead of the natural ones.

    I know what the issue is now. The ability will only be changed if you have it forced to give them their first ability.

    What you want is pokemon.abilityIndex, not pokemon.abilityflag

    This way, any Gillian that has the first ability slot will have it changed based on gender. pokemon.abilityflag works for Meowstic because it's Meowstic's Hidden Ability that gets changed, and HAs can only appear if the abilityflag forces them into existence.
     
    21
    Posts
    8
    Years
    • Seen May 13, 2016
    I know what the issue is now. The ability will only be changed if you have it forced to give them their first ability.

    What you want is pokemon.abilityIndex, not pokemon.abilityflag

    This way, any Gillian that has the first ability slot will have it changed based on gender. pokemon.abilityflag works for Meowstic because it's Meowstic's Hidden Ability that gets changed, and HAs can only appear if the abilityflag forces them into existence.

    Thank you so much! That Fixed! :)
     
    Back
    Top