• 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] undefined method pbOnEnteringBattle

  • 10
    Posts
    5
    Years
    • Seen Sep 9, 2020
    So i just recently started 2 days ago and have spent countless hours now just doing basics in client.

    Then i went on to working on gen 7 pokemon which i somehow managed.
    During an attempt to get Battle Bond to work (Which ended in me using a guide which i have crosschecked like 20+ times every place i changed the script) battling stopped working so i cant enter pokemon battles.

    I have spent hours now trying to fix this myself but without much success :( So now i hope any of you so kindly would be able to find out wtf i have fucked up :)

    https://gyazo.com/18fe0c7f4df60f024b12e98c1d62a66f

    The error message from trainer battle. Its a similar one with wild encounters etc etc but the issue is the same, Undefined method pb.OnEnteringBattle

    This is where if i have understood these messages correctly the issue should be
    https://gyazo.com/4bb79a61ef09227084f8241e9d9d8104

    Line 1308 is how these (prewritten before download) lines which are undefined looks like.
    https://gyazo.com/b9c74f66be556fe34d609a59567c01e4

    Any help is highly appreciated :)
     

    Poq

  • 144
    Posts
    6
    Years
    • Seen Aug 28, 2021
    During an attempt to get Battle Bond to work (Which ended in me using a guide which i have crosschecked like 20+ times every place i changed the script) battling stopped working so i cant enter pokemon battles.

    I have spent hours now trying to fix this myself but without much success :( So now i hope any of you so kindly would be able to find out wtf i have psyducked up :)


    If you look at your method definition screenshot,

    undefined method pbOnEnteringBattle


    you'll see that the method pbOnEnteringBattle is defined in class PokeBattle_NullBattlePeer. But your error screenshot:

    undefined method pbOnEnteringBattle


    indicates that the method is being called on class PokeBattle_RealBattlePeer, which obviously does not have a method called pbOnEnteringBattle. So the problem is not actually with the method being defined. It's with how your method is being called. That's your third screenshot.

    undefined method pbOnEnteringBattle


    The method is being called on the class variable @peer. So what's happening with your battles is that @peer is an object from the wrong class. So what you need to figure out then is how @peer is assigned (look for @peer=some value or code) and determine whether that assignment is working correctly
     
  • 10
    Posts
    5
    Years
    • Seen Sep 9, 2020
    Thank you very much :) Ill take a look around with these new clues. Hopefully i'll learn a bit from this.

    Edit: Ahaha...haha... The Solution were actually quite simple... Just hope my fix doesnt fuck up other things :P Everything works as it should right now at least that i have tested.
    Edit2: I changed PokeBattle_NullBattlePeer -> PokeBattle_RealBattlePeer (i just dont understand why this untouched code since download didnt work :( )
     
    Last edited:
    Back
    Top