• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • 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
    8
    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)
     
    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)
     
    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.**
     
    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:
    **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