• 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!
  • Cyndy, May, Hero (Conquest), or Wes - 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] Not sure why new move will not work

  • 1
    Posts
    7
    Years
    • Seen Sep 22, 2017
    I am creating a new move called Crasher Kick which is a multi-hit move, hitting 2 times (like bonemerang) however, the first hit is Ground type and the second hit is Fighting type.

    PBEffects:
    Code:
    CrasherKick=115

    PokeBattle_Battler below "@effects[PBEffects::Yawn] = 0":
    Code:
    @effects[PBEffects::CrasherKick] = false

    At around line 2869 in the "def pbProcessMoveAgainstTarget" section:
    Code:
    if thismove.function==0x187 && numhits>1 # Crasher Kick
      user.effects[PBEffects::CrasherKick]=true
    end

    Pokebattle_MoveEffects:
    Code:
    class PokeBattle_Move_187 < PokeBattle_Move
      def pbIsMultiHit
        return true
      end
    
      def pbNumHits(attacker)
        return 2
      end
    
      def pbModifyType(type,attacker,opponent)
        if attacker.effects[PBEffects::CrasherKick]==true
          type=getConst(PBTypes,:FIGHTING)
        end
      end
    end

    Finally in Pokebattle_Battle in the "End of round" section:
    Code:
    @battlers[i].effects[PBEffects::CrasherKick]=false

    I keep getting this error (attachment) whenever i try to use the move and i'm not sure why?
     

    Attachments

    • [PokeCommunity.com] Not sure why new move will not work
      Error Message.PNG
      14.7 KB · Views: 7
    Back
    Top