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

Error after attempting to add gen 6 move and ability effects

56
Posts
10
Years
    • Seen Jul 8, 2023
    So, I had gen VI pokemon in the game, the abilities, the moves, etc. I forgot to add the effects, so I copied the scripts I needed from the gen IV project and then my game keeps giving me errors that I haven't had before (seems to be something with crafty shield):

    ---------------------------
    Pokemon Essentials
    ---------------------------
    Exception: RuntimeError

    Message: Script error within event 2, map 21 (House 5):

    Exception: NameError

    Message: Section074: 16in `initialize'uninitialized constant PBEffects::CraftyShield

    ***Full script:

    pbTrainerBattle(PBTrainers::TEAMCOMETGRUNT,"Ronald",_I("Beaten by a newb..."),false,0, false)

    Interpreter:243:in `pbExecuteScript'

    PokeBattle_Battle:332:in `new'

    PokeBattle_Battle:332:in `initialize'

    PTrainer_NPCTrainers:319:in `new'

    PTrainer_NPCTrainers:319:in `pbTrainerBattle'

    (eval): 1in `pbExecuteScript'

    Interpreter:794:in `eval'

    Interpreter:243:in `pbExecuteScript'

    Interpreter:794:in `command_111'

    Interpreter:320:in `execute_command'



    Interpreter:276:in `pbExecuteScript'

    Interpreter:794:in `command_111'

    Interpreter:320:in `execute_command'

    Interpreter:193:in `update'

    Interpreter:106:in `loop'

    Interpreter:198:in `update'

    Scene_Map:115:in `update'

    Scene_Map:113:in `loop'

    Scene_Map:126:in `update'

    Scene_Map:68:in `main'









    Crafty Shield Code:

    ################################################################################
    # Crafty Shield
    ################################################################################
    class PokeBattle_Move_137 < PokeBattle_Move
    def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
    if attacker.pbOwnSide.effects[PBEffects::CraftyShield]
    @battle.pbDisplay(_INTL("But it failed!"))
    return -1
    end
    pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
    attacker.pbOwnSide.effects[PBEffects::CraftyShield]=true
    @battle.pbDisplay(_INTL("Crafty Shield protected your team!",attacker.pbThis))
    return 0
    end
    end
     
    56
    Posts
    10
    Years
    • Seen Jul 8, 2023
    Never mind I fixed that, but now there is an error in a script section I can't even find, can someone tell me where PBBattleAnimation is?
     
    824
    Posts
    8
    Years
  • In the script editor, pressing ctrl+shift+f will allow you to search through all script sections, compared to ctrl+f that only lets you search through the one you're currently hovering over/editing. If you're looking for the code that makes a certain function work, type "def " in front of that function's name.

    However, I've personally noted that it's easier to go get the Gen VI Pack and remove the stuff you don't want than it is to try and canabalize basic essentials and the Gen VI Pack together.
     
    76
    Posts
    8
    Years
    • Seen Oct 6, 2017
    However, I've personally noted that it's easier to go get the Gen VI Pack and remove the stuff you don't want than it is to try and canabalize basic essentials and the Gen VI Pack together.

    I figured this out the hard way! I remember trying to bring parts of it into my game, then saying **** it and just using everything the pack gave me and redid all my scripts.
     
    Back
    Top