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

[Scripting Question] Custom Ability

15
Posts
7
Years
    • Seen May 6, 2021
    I was trying to make custom abilities for my Pokemon game and i kept getting error messages.
    These are the abilities I'm trying to script:

    Snow Bank:
    Increase Def and SpDef stat by 1 if hit with water or ice moves.
    Also immunity to water and ice moves

    Pure Heart:
    Gives full immunity to all dark type moves

    Corrupt Heart:
    (It's basically like Bad Dreams but this works for all statuses except confusion and attraction.)

    Weak Focus:
    (Basically SpAtk version of Intimidate)
     
    971
    Posts
    7
    Years
    • Age 21
    • Seen Nov 28, 2022
    I was trying to make custom abilities for my Pokemon game and i kept getting error messages.
    These are the abilities I'm trying to script:

    Snow Bank:
    Increase Def and SpDef stat by 1 if hit with water or ice moves.
    Also immunity to water and ice moves

    Pure Heart:
    Gives full immunity to all dark type moves

    Corrupt Heart:
    (It's basically like Bad Dreams but this works for all statuses except confusion and attraction.)

    Weak Focus:
    (Basically SpAtk version of Intimidate)

    These aren't too difficult, what errors did you get? Also, can we see the code for the ability that's giving errors? Wrap the code around with [ CODE ] (no spaces)
     
    15
    Posts
    7
    Years
    • Seen May 6, 2021
    The Script kept giving me syntax error, heres the codes I used:
    Spoiler:


    Spoiler:

    Spoiler:


    **PUREHEART( which is the dark type version of levitate) was kinda to do because cant find the exact code for levitate, copy/paste and change ground type to dark type.**
     
    971
    Posts
    7
    Years
    • Age 21
    • Seen Nov 28, 2022
    The Script kept giving me syntax error, heres the codes I used:
    Spoiler:


    Spoiler:

    Spoiler:


    **PUREHEART( which is the dark type version of levitate) was kinda to do because cant find the exact code for levitate, copy/paste and change ground type to dark type.**


    Wrap the code in [ CODE ] next time to make it more readable. Spoiler isn't really necessary - nice in some cases - but [ CODE ] (without spaces) makes sure it keeps the formatting.

    As for the errors you're getting, when you're working with "if, else, or elsif" statements, be sure to "end" every single if statement. Here are a few examples of if statements (with random stuff in it):
    Code:
    if true
      .....
    end
    Code:
    if true
      .....
    else
      .....
    end
    Code:
    if true
      .....
      if !true
        .....
      end
    end
    Code:
    if true
      .....
      if !true
        .....
      elsif true
        .....
        if !true
          ......
        end
      end
    end
     
    Last edited:
    824
    Posts
    8
    Years
  • **PUREHEART( which is the dark type version of levitate) was kinda to do because cant find the exact code for levitate, copy/paste and change ground type to dark type.**

    The reason you're having trouble finding Levitate is that it's actually lumped in with a lot of other things - having Flying type, being under the effects of Magnet Rise, holding an Air Balloon - under a single function called def pbIsAirborne?, which is found on line 629 of PokeBattle_Battler. Other functions just call target.pbIsAirborne? rather than checking if the target has the ability Levitate.

    Unfortunately, that means you can't just copy Levitate's code, change Levitate to PureHeart, and change Ground to Dark.
     
    Back
    Top