• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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] Need help with creating abilities

  • 3
    Posts
    5
    Years
    • Seen Sep 28, 2021
    Hello, I'm new to scripting and I've been trying to create a new ability, but i keep hitting a wall. Can someone explain to me how I would add a move like levitate, but for immunity to fairy types? I've already entered the ability in the abilities.txt and I've tried looking at other threads and mimicking the scripting, but nothing is working.

    If anyone could help it would be greatly appreciated.
     
    Have you tried searching the code for :LEVITATE ? I'm fairly confident that the code nearby one of the occurrences will mention :GROUND, and that's the one I'd expect you to base your new ability on.
     
    Yes, that's exactly what i did. I tried to mimic what was there but when i launched the game, I got a syntax error and nothing else
     
    Well a syntax error means that your Ruby is malformed. Perhaps you forgot an end or are missing a closing ). It's impossible to know unless you post the code that you wrote (and preferably a couple of the lines before and after).
     
    Last edited:
    Good point, I read somewhere else that it would go above the wonder guard script, but i wasn't sure which was the start of the script so here is where i put it: (above the mentioning of wonder guard and after the end of the scripts relating to the levitate script)

    if target.effects[PBEffects::Telekinesis]>0
    @battle.pbDisplay(_INTL("{1} makes Ground moves miss with Telekinesis!",target.pbThis))
    return false
    end
    end
    if isConst?(type,PBTypes,:FAIRY) && !target.hasWorkingItem(:RINGTARGET)
    if !user.hasMoldBreaker && (target.hasWorkingAbility(:OBLIVION))
    @battle.pbDisplay(_INTL("{1} makes FAIRY moves miss with OBLIVION!",target.pbThis,PBAbilities.getName(target.ability)))
    return false
    end
    end
    #### KUROTSUNE - 029 - START
    if target.hasWorkingAbility(:WONDERGUARD) &&
    typemod<=4 &&
    type>=0 &&
    !(target.moldbroken)
    #### KUROTSUNE - 029 - END
    @battle.pbDisplay(_INTL("{1} avoided damage with Wonder Guard!",target.pbThis))
    return false
    end
     
    Back
    Top