• 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] Need help with ability

32
Posts
4
Years
    • Seen Apr 17, 2020
    Hi!
    I would like to add an ability which is called Oxidation and makes every Pokémon that has it to be invulnerable to steel-types moves (like storm drain) and if the Pokémon is hit by a steel-type move, its Attack and its Special Attack will raise.
    I tried to copy-paste the Storm Drain script and change a few things but the ability isn't working, I even tried to paste the script before and after abilities such as lightning rod but without success. Can anyone make a script for me for this ability?
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    Why don't you try posting the code your wrote so that people can correct your mistakes? People are much more willing to help someone learn than do all the work for them.
     
    32
    Posts
    4
    Years
    • Seen Apr 17, 2020
    Oh yeah, here it is :
    # Oxidation
    if targets.length==1 && isConst?(thismove.pbType(thismove.type,user,target),PBTypes,:STEEL) &&
    !target.hasWorkingAbility(:OXIDATION)
    for i in priority # use Pokémon earliest in priority
    next if user.index==i.index || target.index==i.index
    if i.hasWorkingAbility(:OXIDATION)
    PBDebug.log("[Ability triggered] #{i.pbThis}'s Oxidation (change target)")
    target=i # X's Oxidation took the attack!
    changeeffect=1
    break
    end
    end
    end
     
    32
    Posts
    4
    Years
    • Seen Apr 17, 2020
    the thing is, if I manage to get this work, it will only raise the Special Attack but want it to also raise the Attack
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    So that bit looks like it redirects the attack, but surely there's another part that makes the Pokémon immune and raises its Special Attack (which is where you'd want to put the code to raise the attack too).
     
    32
    Posts
    4
    Years
    • Seen Apr 17, 2020
    The ability doesn't work, I gave it to Melmetal and simulated a battle where a Magnezone hits it with flash cannon, sadly, the ability doesn't activate and Melmetal takes damage without any stats changes.
    BTW, how do you add the code to make the Attack raise?
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    Okay, so in that case you're actually missing half of the ability. There's two important places where Storm Drain appears, the one you've found that redirects attacks, and another that prevents the damage and increases the stats.
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    In that case you ought to test that Storm Drain works properly, because I can see the lines of code I'm thinking of in a clean v17.
     
    32
    Posts
    4
    Years
    • Seen Apr 17, 2020
    I already did it, and Storm Drain works perfectly, maybe there's a typo somewhere?
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    No, if Storm Drain works then you're definitely not searching for it properly because the code you posted above clearly doesn't do anything to prevent damage or boost stats.
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    Go through the battle scripts one by one and use regular Ctrl+F to search for Storm Drain? Just to confirm, you are searching for :STORMDRAIN, right? The internal names are what the code uses.
     
    Last edited:
    32
    Posts
    4
    Years
    • Seen Apr 17, 2020
    When I use ctrl+shift+f I don't find anythind and from my experience when I use ctrl+f it doesn't matter if it's capitalized or not, I just write down "storm " and search in every battle script, could you please search on your side ? I mean I don't want to be rude but we're not gonna go anywhere like that, when I asked for someone to make a script, it was to know where to put it and learn about it. If you're just going to guide me, trust me we will never get forward.
     
    Last edited:
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    Then we will never get forward, and you'll have to hope someone else is going to step in.

    I'm sorry, but being able to search the code for :STORMDRAIN is too simple a skill for you to not have. I can't see how you could learn anything from someone else doing the work because 90% of the work of adding this ability is being able to search.
     
    Last edited:
    32
    Posts
    4
    Years
    • Seen Apr 17, 2020
    That's not what I call help, you know that I'm struggling to find the ability, and you know where it is indicated but you don't want to tell it to me, that's unfair... so then if I don't find the ability I can just pass my way right? That's not how it works, I just want some help and I'm unable to get it :/ Thanks anyways, I guess I'll have to do my fan-game without having the possibility to receive some help then.
     
    32
    Posts
    4
    Years
    • Seen Apr 17, 2020
    It's not that the thing is easy or not, I don't find it. I made a ton of abilities and it's not because I struggle to find one to imitate that I'm unable to make a project or so, I just want someone to help me to get forward, and continue my project. I'll learn by myself, do you thing I'll copy/paste everything like an idiot ? No, definitely, I'll look forward the script and will try to understand why this script is placed here.
     
    Last edited:
    Back
    Top