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

[Error] Rare Candy Error

  • 13
    Posts
    5
    Years
    • Seen Dec 3, 2022
    Whenever I use a Rare Candy on my pokemon the game gives me the error and I have no idea what is causing it

    [Pokémon Essentials version 19.1]
    [EBDX v1.2]

    Exception: ArgumentError
    Message: wrong number of arguments (given 3, expected 2)

    Backtrace:
    089:Messages:256:in `pbChooseNumber'
    237:Item_Effects:740:in `block in <main>'
    035:Event_Handlers:199:in `trigger'
    236:Item_Utilities:80:in `triggerUseOnPokemon'
    236:Item_Utilities:614:in `block (2 levels) in pbUseItem'
    236:Item_Utilities:605:in `loop'
    236:Item_Utilities:605:in `block in pbUseItem'
    080:MessageConfig:566:in `pbFadeOutIn'
    236:Item_Utilities:601:in `pbUseItem'
    274:UI_Bag:490:in `block in pbStartScreen'
     
    Could we see your Rare Candy code? I think you've edited default Essentials code, but not properly.
     
    wait nvm found it I was looking in the wrong one
    ItemHandlers::UseOnPokemon.add(:RARECANDY,proc { |item,pkmn,scene|
    if pkmn.level >= GameData::GrowthRate.max_level
    newspecies = pkmn.check_evolution_on_level_up
    if newspecies && !pkmn.shadowPokemon? && Settings::RARE_CANDY_USABLE_AT_MAX_LEVEL
    pbFadeOutInWithMusic {
    evo = PokemonEvolutionScene.new
    evo.pbStartScreen(pkmn,newspecies)
    evo.pbEvolution
    evo.pbEndScreen
    scene.pbRefresh
    }
    next true
    else
    scene.pbDisplay(_INTL("It won't have any effect."))
    next false
    end
    end

    is this the right code?
     
    Last edited:
    Well this isn't the correct code, since none of the lines mentioned in your error message actually show up here.
     
    Back
    Top