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

[Question] Ability-Swapping NPC doesn't function? What am I doing wrong?

429
Posts
4
Years
  • I've added a NPC to Oak's Lab who is supposed to change the ability of the Pokemon in Slot 1 when asked. But he doesn't seem to be able to change the abilities of any of my Pokemon. Even when I try using a Pokemon with two different regular abilities and a different hidden ability.

    Here's his code(with all the in-character "Hi there!" talking removed):

    Select an Ability for your Pokemon in Slot 1.
    \ch[1,-1,
    Reset Ability,Ability 1,Ability 2,Ability 3,Exit]

    Then I've got the "Conditional branch variable, temp pokemon choice == 0" stuff, the same for choices 1, 2, 3, and Exit(which just jumps to the label above the "Okay, bye!" text at the end of his event).

    Reset ability does this:
    pkmn = $Trainer.first_able_pokemon
    pkmn.ability_index = nil

    Ability 1 does this:
    pkmn = $Trainer.first_able_pokemon
    pkmn.ability_index = 0

    Ability 2 does this:
    pkmn = $Trainer.first_able_pokemon
    pkmn.ability_index = 1

    Ability 3 does this:
    pkmn = $Trainer.first_able_pokemon
    pkmn.ability_index = 2

    This code seems simple and it should work, so what's going wrong? Why is it that when I talk to him and select an option, nothing happens to the ability of my Pokemon in slot 1?
     
    429
    Posts
    4
    Years
  • Turns out the trick is to use this:

    pkmn = $Trainer.party[0]

    Not this:
    pkmn = $Trainer.first_able_pokemon

    I have no idea why pkmn = $Trainer.first_able_pokemon worked for EV/IV and name editing but not for Ability editing.
     
    Back
    Top