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

Making custom Function Codes and custom moves.

  • 49
    Posts
    9
    Years
    • Seen May 13, 2018
    I'm kinda brand new at this, putting my feet (toe?) into the water and I'm curious about something.

    I've been reading https://pokemonessentials.wikia.com/wiki/Function_codes but it doesn't say anywhere on the page how to create a new one, or combine effects.

    For example:

    Acid Rain is a move I thought of, it's a high damage charge turn move that lowers special defense. It would combine the effects of Razor Wind and Acid Spray. Would I put OC304F as the function code?

    Code:
    568,ACIDRAIN,Acid Rain,0C304F,120,POISON,Special,100,5,0,04,0,bef,"Charges noxious energy for one turn, then unleash a cloud of acidic vapor over the opponent that rains down searing acid. Sharply lowers special defense."
    I'm kind of assuming no, so how would I go about creating a new function code? I need to figure out how to do this, as I also want to create a bunch of Entry Hazards, and there's only 3 function codes total for those.

    On another note, as to not bombard anyone with the whole list I picked out three moves I've made, would anyone be willing to look over these lines and make sure they are correct? I think I did them right, but I want to check before I really get crazy making tons of new moves.

    Invasion: (Ghost version of brick break)
    Code:
    561,INVASION,Invasion,10A,75,GHOST,Physical,100,15,0,00,0,abef,"The user phases through any barrier, destroying it, and strikes its opponent."
    Parasite Injection: (More powerful version signature move version of Poison Jab, higher damage, 30% chance to badly poison)
    Code:
    560,PINJECTION,Parasite Injection,006,90,GHOST,Physical,100,20,30,0,0,abf,"Phases its stinger into its opponent, attempting to inject it with its parasitic toxin. It may badly poison the target."
    Dragon Flight: (Dragon version of Flame Charge)
    Code:
    563,DRAGONFLIGHT,Dragon Flight,01F,50,DRAGON,Physical,100,20,100,00,0,abef,"The dragon brandishes its wings and flys swiftly at its opponents. Raises the user's speed."
     
    Creating a new function code is more simple than you think.
    First thing you need to do, is give your new moves (providing they are different to any other move) a new code... In PokeBattle_MoveEffects, right at the bottom, it says this.
    PokemonEssentials said:
    #===============================================================================
    # NOTE: Shadow moves use function codes 126-132 inclusive. If you're inventing
    # new move effects, use function code 133 and onwards.
    #===============================================================================
    This is self explanatory really... So create this below this commented section.
    Code:
    class PokeBattle_Move_133 < PokeBattle_Move
      
    end
    One you've created that, you're practically done... Your move function is made... It just doesn't do anything... Once you figure out what you want it to do, you'll need to add parts in to it.
    You want the move to be a two turned attack, so the first attack gets ready... The second attack, strikes... So let's do this.
    Code:
    class PokeBattle_Move_133 < PokeBattle_Move
      def pbTwoTurnAttack(attacker,checking=false)
        @immediate=false
        if !@immediate && attacker.hasWorkingItem(:POWERHERB)
          @immediate=true
          if !checking
            itemname=PBItems.getName(attacker.item)
            attacker.pokemon.itemRecycle=attacker.item
            attacker.pokemon.itemInitial=0 if attacker.pokemon.itemInitial==attacker.item
            attacker.item=0
            @battle.pbDisplay(_INTL("{1} consumed its {2}!",attacker.pbThis,itemname))
          end
        end
        return false if @immediate
        return attacker.effects[PBEffects::TwoTurnAttack]==0
      end
      
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
        if @immediate || attacker.effects[PBEffects::TwoTurnAttack]>0
          pbShowAnimation(@id,attacker,opponent,1,alltargets,showanimation) # Charging anim
          @battle.pbDisplay(_INTL("{1} readied itself!",attacker.pbThis))
        end
        return 0 if attacker.effects[PBEffects::TwoTurnAttack]>0
        return super
      end
    end
    Here, your Pokémon uses the attack, BUT, only readies itself (the moves effect... NOTE: You can change the display message to whatever you like), unless holding a Power Herb...
    So once the attack hits, you'll want to reduce the opponents special defense by 2 stages (which will, in this case, be an another effect)... So add this.
    Code:
      def pbAdditionalEffect(attacker,opponent)
        if opponent.pbCanReduceStatStage?(PBStats::SPDEF,false)
          opponent.pbReduceStat(PBStats::SPDEF,2,false)
        end
        return true
      end
    That's all you need to know about how to make function codes... Many moves already do what you will want to create, so it's fairly simple to copy and paste from them.

    I haven't tested this, I just wrote this as a tutorial, if it doesn't work how you want it to, change it.

    EDIT: I know I stated that once you've made the class, the function is done but it doesn't do anything... This is not entirely true... The moves effects could happen elsewhere, and your new function code could merely be a standalone code that makes the move have no effect or additional effect, like being a two turn attack, reducing stats, increasing stats etc.
     
    Last edited:
    EDIT: NVM thank you, my move code was incorrect and had 0% chance to do the acid spray effect. Thanks for your help.
     
    Last edited:
    This helped a lot with making my Tsunami Rush effect, which is like Surf with an additional confusion chance.
     
    Back
    Top