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

[Scripting Question] EBDX stopped recognizing this drop script.

107
Posts
3
Years
    • Seen Apr 27, 2023
    I have a script that drops items in the battle system, it consists of rewriting the Def pbWildBattleSuccess like this:

    def pbWildBattleSuccess
    if @battle.battlers[1].pokemon.hasItem?
    dropitem = @battle.battlers[1].pokemon.item
    pkmnitem = @battle.battlers[1].pokemon.species
    if ITEMDROPQTY.key?(dropitem) && ITEMDROPQTY[dropitem] > 0
    qty=rand(ITEMDROPQTY[dropitem])+1
    elsif ITEMDROPQTY.key?(dropitem) && ITEMDROPQTY[dropitem] == 0 && PKMNDROPQTY.key?(pkmnitem)
    qty=rand(PKMNDROPQTY[pkmnitem])+1
    else
    qty=1
    end
    if $PokemonBag.pbStoreItem(@battle.battlers[1].pokemon.item,qty)
    itemname=PBItems.getName(@battle.battlers[1].pokemon.item)
    pocket=pbGetPocket(@battle.battlers[1].pokemon.item)
    @battle.pbDisplayPaused(_INTL("The wild {1} dropped\n{2} <icon=bagPocket#{pocket}> x{3}!",@battle.battlers[1].pbThis,itemname,qty))
    end
    end
    @battleEnd = true
    pbBGMPlay(pbGetWildVictoryME)
    end

    This seemed to work on early versions of EBDX in v18.1.
    But on the latest EBDX1.0.15 this is simply not recognized. Drops don't happen.

    How to fix?

    On EBDX it is written like this:
    def pbWildBattleSuccess
    bgm = "EBDX/Victory Against Wild"
    bgm = $PokemonGlobal.nextBattleME.clone if $PokemonGlobal.nextBattleME
    if [email protected]
    s = EliteBattle.getData(@battlers[1].species, PBSpecies, :VICTORYTHEME, (@battlers[1].form rescue 0))
    bgm = s if !s.nil?
    end
    pbBGMPlay(bgm)
    end
     

    JulyArt

    New Developer
    70
    Posts
    3
    Years
    • Seen Dec 17, 2021
    add the drop codes to the EBDX pbWildBattleSuccess.

    or make new method specifically for the drops, and add that method to EBDX. (This way, if EBDX changes again, you can simply add your drop method to it as a 1 liner)

    because they are the same def (pbWildBattleSuccess), the EBDX is overwriting the previous declared def method.

    e.g.

    def do_something
    echo "First Timer"
    end

    def do_something
    echo "Second Timer"
    end

    do_something => Second Timer (Because it's being overwritten)
     
    107
    Posts
    3
    Years
    • Seen Apr 27, 2023
    Well, I don't understand scripts and the translator doesn't help me...
    I did it like this:
    Spoiler:

    Well, but when doing this, this error happens:
    Spoiler:
     
    107
    Posts
    3
    Years
    • Seen Apr 27, 2023
    add the drop codes to the EBDX pbWildBattleSuccess.

    or make new method specifically for the drops, and add that method to EBDX. (This way, if EBDX changes again, you can simply add your drop method to it as a 1 liner)

    because they are the same def (pbWildBattleSuccess), the EBDX is overwriting the previous declared def method.

    e.g.

    def do_something
    echo "First Timer"
    end

    def do_something
    echo "Second Timer"
    end

    do_something => Second Timer (Because it's being overwritten)

    Hope you can save me, my release depends on it...
     

    JulyArt

    New Developer
    70
    Posts
    3
    Years
    • Seen Dec 17, 2021
    I'm not sure 'why' the error is occurring in sense of I cannot backtrace the error effectively. As I'm on Essnetial v19.1 and not utilizing EBDX.

    If you coded the drop method, it looks cool. Well done for sure.

    To debug, you just got to go to Luka's Scripting Utility line 299 to see what is happening. What is that line? and where is the 'undefined local variable or method' in the error located.

    Error in script "Scene Battle":
    NameError occurred.
    Object: undefined local variable or method `' for main



    I also suggest coding the drop method as it's own entity, so it's way easier to manage.

    Your custom drop method.
    Code:
    dmBattlerDrop
      if @battle.battlers[1].pokemon.hasItem?
        dropitem = @battle.battlers[1].pokemon.item
        pkmnitem = @battle.battlers[1].pokemon.species
        qty = if ITEMDROPQTY.key?(dropitem) && ITEMDROPQTY[dropitem] > 0
                rand(ITEMDROPQTY[dropitem]) + 1
              elsif ITEMDROPQTY.key?(dropitem) && ITEMDROPQTY[dropitem] == 0 && PKMNDROPQTY.key?(pkmnitem)
                rand(PKMNDROPQTY[pkmnitem]) + 1
              else
                1
              end
        if $PokemonBag.pbStoreItem(@battle.battlers[1].pokemon.item, qty)
          itemname = PBItems.getName(@battle.battlers[1].pokemon.item)
          pocket = pbGetPocket(@battle.battlers[1].pokemon.item)
          @battle.pbDisplayPaused(_INTL("The wild {1} dropped\n{2} <icon=bagPocket#{pocket}> x{3}!", @battle.battlers[1].pbThis,itemname, qty))
        end
      end
    end


    EBDX wildBattle with your drop method.
    Code:
    def pbWildBattleSuccess
    
    dmBattlerDrop   # Your custom drop method insert here, so it's way easier to read in flow, and way easier to customize if EBDX wildBattle method changes again.
    
      bgm = 'EBDX/Victory Against Wild'
      bgm = $PokemonGlobal.nextBattleME.clone if $PokemonGlobal.nextBattleME
      unless @battle.opponent
        s = EliteBattle.getData(@battlers[1].species, PBSpecies, :VICTORYTHEME, begin
          @battlers[1].form
        rescue StandardError
          0
        end)
        bgm = s unless s.nil?
      end
      pbBGMPlay(bgm)
    end

    Usually when I assist with these PKMN community threads, it's greatly due to the idea that I also need that very same knowledge for my own fan-project. So I try to figure the stuff out as I'll eventually use that knowledge as well.

    You're not own your own of course, it's just more difficult for me to assist in these scenario as I'm unfamiliar and unlikely to familiarize myself with EBDX, as I plan to use the overworld battle system.



    The effort Luka went through for his plugins is immense. and a lot have enjoyed it to the fullest. There's plentiful of experience and community ties.

    With all that in mind, I plainly just find Luka's personality and interactions to be displeasing. haha. There's a sense of egotism, seniority, down putting.

    You can be excellent in all your works, however, if you're just a dick, lol, well, that's another aspect in which others will have to turn a blind eye sort of idea. e.g. it's much easier to work with humble, easier to communicate mannerism.

    Personality can't change overnight though. How one lives, think, interact, etc.


    I simply couldn't get EBDX to do the things I'd like it to do, and that's fine of course. It's more on me as a coder.

    lol. I certainly have way less incentive, knowing the type of interactions Luka goes through. The man must be so annoyed by all the 'bugs comment', and the 'inadequacy' of others regarding using his scripts xD

    Perhaps I would turn into a sour grape too. We're all humans. Some of us are just lovelier than others.


    Which is all to say, you'll figure it out eventually, continue with your kind/humble interaction for sure, as that'll encourage others to work and communicate with you effectively.

    I don't enjoy messing with EBDX or that 'other stuff' as much as the 'community' around that, is a bit too toxic for me. I'm the sensitive type, I suppose. "I need that thick skin!"


    I joke. Thick skin is good, but I mean. There's no reason to surround oneself with toxic people sort of thing.
     
    Last edited:
    107
    Posts
    3
    Years
    • Seen Apr 27, 2023
    I'm not sure 'why' the error is occurring in sense of I cannot backtrace the error effectively. As I'm on Essnetial v19.1 and not utilizing EBDX.

    If you coded the drop method, it looks cool. Well done for sure.

    To debug, you just got to go to Luka's Scripting Utility line 299 to see what is happening. What is that line? and where is the 'undefined local variable or method' in the error located.





    I also suggest coding the drop method as it's own entity, so it's way easier to manage.

    Your custom drop method.
    Code:
    dmBattlerDrop
      if @battle.battlers[1].pokemon.hasItem?
        dropitem = @battle.battlers[1].pokemon.item
        pkmnitem = @battle.battlers[1].pokemon.species
        qty = if ITEMDROPQTY.key?(dropitem) && ITEMDROPQTY[dropitem] > 0
                rand(ITEMDROPQTY[dropitem]) + 1
              elsif ITEMDROPQTY.key?(dropitem) && ITEMDROPQTY[dropitem] == 0 && PKMNDROPQTY.key?(pkmnitem)
                rand(PKMNDROPQTY[pkmnitem]) + 1
              else
                1
              end
        if $PokemonBag.pbStoreItem(@battle.battlers[1].pokemon.item, qty)
          itemname = PBItems.getName(@battle.battlers[1].pokemon.item)
          pocket = pbGetPocket(@battle.battlers[1].pokemon.item)
          @battle.pbDisplayPaused(_INTL("The wild {1} dropped\n{2} <icon=bagPocket#{pocket}> x{3}!", @battle.battlers[1].pbThis,itemname, qty))
        end
      end
    end


    EBDX wildBattle with your drop method.
    Code:
    def pbWildBattleSuccess
    
    dmBattlerDrop   # Your custom drop method insert here, so it's way easier to read in flow, and way easier to customize if EBDX wildBattle method changes again.
    
      bgm = 'EBDX/Victory Against Wild'
      bgm = $PokemonGlobal.nextBattleME.clone if $PokemonGlobal.nextBattleME
      unless @battle.opponent
        s = EliteBattle.getData(@battlers[1].species, PBSpecies, :VICTORYTHEME, begin
          @battlers[1].form
        rescue StandardError
          0
        end)
        bgm = s unless s.nil?
      end
      pbBGMPlay(bgm)
    end

    Usually when I assist with these PKMN community threads, it's greatly due to the idea that I also need that very same knowledge for my own fan-project. So I try to figure the stuff out as I'll eventually use that knowledge as well.

    You're not own your own of course, it's just more difficult for me to assist in these scenario as I'm unfamiliar and unlikely to familiarize myself with EBDX, as I plan to use the overworld battle system.



    The effort Luka went through for his plugins is immense. and a lot have enjoyed it to the fullest. There's plentiful of experience and community ties.

    With all that in mind, I plainly just find Luka's personality and interactions to be displeasing. haha. There's a sense of egotism, seniority, down putting.

    You can be excellent in all your works, however, if you're just a dick, lol, well, that's another aspect in which others will have to turn a blind eye sort of idea. e.g. it's much easier to work with humble, easier to communicate mannerism.

    Personality can't change overnight though. How one lives, think, interact, etc.


    I simply couldn't get EBDX to do the things I'd like it to do, and that's fine of course. It's more on me as a coder.

    lol. I certainly have way less incentive, knowing the type of interactions Luka goes through. The man must be so annoyed by all the 'bugs comment', and the 'inadequacy' of others regarding using his scripts xD

    Perhaps I would turn into a sour grape too. We're all humans. Some of us are just lovelier than others.


    Which is all to say, you'll figure it out eventually, continue with your kind/humble interaction for sure, as that'll encourage others to work and communicate with you effectively.

    I don't enjoy messing with EBDX or that 'other stuff' as much as the 'community' around that, is a bit too toxic for me. I'm the sensitive type, I suppose. "I need that thick skin!"


    I joke. Thick skin is good, but I mean. There's no reason to surround oneself with toxic people sort of thing.

    I also felt the same thing. I know that unfortunately people pay more attention to bugs than to the wonder that was created.
    But interacting with the audience is like that.
    Deep down, everyone knows that this is an excellent job!
    Thanks for the help once again! I will always be bringing new problems like learning. I'm on my way to study programming, english and ruby. But until then, gratitude ❤️
     
    Back
    Top