• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
Resource icon

Resource Battle Debug Menu [BDM] for Essentials v.17-v.17.2 2018-08-18

Hollow_Ego

Cooltrainer
Member
Joined
May 19, 2018
Posts
115
Hollow_Ego submitted a new resource:

Battle Debug Menu [BDM] for Essentials v.17-v.17.2 - Adding Debug Functionality into Battles

Battle Debug Menu [BDM] for Essentials v.17+ (Preview)

Hi everybody,

some of you might have already thought of this while debugging their game: a debug menu that you can use in battle.

Now you can finally use it! This version might still have bugs. It allows for a wide variety of debuging so use it cautiously!

Functionality:
- Set stat changes reaching from -6 to 6
- Change the battlers ability to any implemented one
- Trigger On-Active Abilities (like Intimidate)...

Read more about this resource...
 

Krahssen

Novice
Member
Joined
May 31, 2018
Posts
33
Thanks for this resource! Where should be placed in the case of using EBS?
 

Hollow_Ego

Cooltrainer
Member
Joined
May 19, 2018
Posts
115
For EBS you do everything as you would normally, except for the button input.
You need to find this in EBS Scripts:
Ruby:
Expand Collapse Copy
alias pbCommandMenuEx_ebs pbCommandMenuEx unless self.method_defined?(:pbCommandMenuEx_ebs)
  def pbCommandMenuEx(index,texts,mode=0)
and in this def after
Ruby:
Expand Collapse Copy
if Input.trigger?(Input::C) || (defined?($mouse) && cw.mouseOver? && $mouse.leftClick?)  # Confirm choice
        pbSEPlay("SE_Select2")
        @ret=cw.index
        @inCMx=false if @battle.doublebattle && !USEBATTLEBASES && @ret > 0
        @lastcmd[index]=@ret
        break

add

Ruby:
Expand Collapse Copy
elsif Input.trigger?(Input::R) # is the same as S
        pbPlayDecisionSE
        @ret= 5
        break

I haven't tested it much so there might be case where it doesn't work correctly. This script was not made with EBS in mind but should work nontheless.
 

Krahssen

Novice
Member
Joined
May 31, 2018
Posts
33
For EBS you do everything as you would normally, except for the button input.
You need to find this in EBS Scripts:
Ruby:
Expand Collapse Copy
alias pbCommandMenuEx_ebs pbCommandMenuEx unless self.method_defined?(:pbCommandMenuEx_ebs)
  def pbCommandMenuEx(index,texts,mode=0)
and in this def after
Ruby:
Expand Collapse Copy
if Input.trigger?(Input::C) || (defined?($mouse) && cw.mouseOver? && $mouse.leftClick?)  # Confirm choice
        pbSEPlay("SE_Select2")
        @ret=cw.index
        @inCMx=false if @battle.doublebattle && !USEBATTLEBASES && @ret > 0
        @lastcmd[index]=@ret
        break

add

Ruby:
Expand Collapse Copy
elsif Input.trigger?(Input::R) # is the same as S
        pbPlayDecisionSE
        @ret= 5
        break

I haven't tested it much so there might be case where it doesn't work correctly. This script was not made with EBS in mind but should work nontheless.

Yes, that worked perfectly.

Thank you so much!
 

WolfPP

Discord wolfppontes
Member
Joined
Aug 24, 2018
Posts
136
Oh God, so nice to test battles!
But, i put everything and doenst show the screen when press R or S buttoms.
What could be?

EDIT: im usin v17.2 and ive Zmove scripts

Code:
Expand Collapse Copy
  def pbCommandPhase
    @scene.pbBeginCommandPhase
#    @scene.pbResetCommandIndices
    for i in 0...4   # Reset choices if commands can be shown
      @battlers[i].effects[PBEffects::SkipTurn]=false
      if pbCanShowCommands?(i) || @battlers[i].fainted?
        @choices[i][0]=0
        @choices[i][1]=0
        @choices[i][2]=nil
        @choices[i][3]=-1
      else
        unless !@doublebattle && pbIsDoubleBattler?(i)
          PBDebug.log("[Reusing commands] #{@battlers[i].pbThis(true)}")
        end
      end
    end
    # Reset choices to perform Mega Evolution if it wasn't done somehow
    if !$forceMegaEvo
      for i in 0...2
        for j in 0...@megaEvolution[i].length
          @megaEvolution[i][j]=-1 if @megaEvolution[i][j]>=0
        end
      end
    end
      for i in 0...@zMove[0].length
        @zMove[0][i]=-1 if @zMove[0][i]>=0
      end
      for i in 0...@zMove[1].length
        @zMove[1][i]=-1 if @zMove[1][i]>=0
      end     
    for i in 0...4
      break if @decision!=0
      next if @choices[i][0]!=0
      if !pbOwnedByPlayer?(i) || @controlPlayer
        if !@battlers[i].isFainted? && pbCanShowCommands?(i)
          @scene.pbChooseEnemyCommand(i) if !@forceSwitching && !@skipturn
          pbEnemyShouldWithdrawEx?(i,true) if @forceSwitching
        end
      else
        commandDone=false
        commandEnd=false
        if pbCanShowCommands?(i)
          loop do
            cmd=pbCommandMenu(i)
            if cmd==0 # Fight
              if pbCanShowFightMenu?(i)
                commandDone=true if pbAutoFightMenu(i)
                until commandDone
                  index=@scene.pbFightMenu(i)
                  if index<0
                    side=(pbIsOpposing?(i)) ? 1 : 0
                    owner=pbGetOwnerIndex(i)
                    if @megaEvolution[side][owner]==i
                      @megaEvolution[side][owner]=-1
                    end
                    if @zMove[side][owner]==i
                      @zMove[side][owner]=-1
                    end                      
                    break
                  end
                  next if !pbRegisterMove(i,index)
                  if @doublebattle
                    thismove=@battlers[i].moves[index]
                    target=@battlers[i].pbTarget(thismove)
                    if target==PBTargets::SingleNonUser # single non-user
                      target=@scene.pbChooseTarget(i,target)
                      next if target<0
                      pbRegisterTarget(i,target)
                    elsif target==PBTargets::UserOrPartner # Acupressure
                      target=@scene.pbChooseTarget(i,target)
                      next if target<0 || (target&1)==1
                      pbRegisterTarget(i,target)
                    end
                  end
                  commandDone=true
                end
              else
                pbAutoChooseMove(i)
                commandDone=true
              end
            elsif cmd!=0 && @battlers[i].effects[PBEffects::SkyDrop]
              pbDisplay(_INTL("Sky Drop won't let {1} go!",@battlers[i].pbThis(true)))
            elsif cmd==1 # Bag
              if !@internalbattle
                if pbOwnedByPlayer?(i)
                  pbDisplay(_INTL("Items can't be used here."))
                end
              else
                item=pbItemMenu(i)
                if item[0]>0
                  if pbRegisterItem(i,item[0],item[1])
                    commandDone=true
                  end
                end
              end
            elsif cmd==2 # Pokémon
              pkmn=pbSwitchPlayer(i,false,true)
              if pkmn>=0
                commandDone=true if pbRegisterSwitch(i,pkmn)
              end
            elsif cmd==3   # Run
              run=pbRun(i) 
              if run>0
                commandDone=true
                return
              elsif run<0
                commandDone=true
                side=(pbIsOpposing?(i)) ? 1 : 0
                owner=pbGetOwnerIndex(i)
                if @megaEvolution[side][owner]==i
                  @megaEvolution[side][owner]=-1
                end
                if @zMove[side][owner]==i
                  @zMove[side][owner]=-1
                end                  
              end
            elsif cmd==4   # Call
              thispkmn=@battlers[i]
              @choices[i][0]=4   # "Call Pokémon"
              @choices[i][1]=0
              @choices[i][2]=nil
              side=(pbIsOpposing?(i)) ? 1 : 0
              owner=pbGetOwnerIndex(i)
              if @megaEvolution[side][owner]==i
                @megaEvolution[side][owner]=-1
              end
              if @zMove[side][owner]==i
                @zMove[side][owner]=-1
              end   
              commandDone=true
              
            elsif cmd==5 # Debug
              pbBattlerDebug
              commandDone=true if (@battlers[i].effects[PBEffects::SkipTurn])
            elsif cmd==-1   # Go back to first battler's choice
              @megaEvolution[0][0]=-1 if @megaEvolution[0][0]>=0
              @megaEvolution[1][0]=-1 if @megaEvolution[1][0]>=0
              @zMove[0][0]=-1 if @zMove[0][0]>=0
              @zMove[1][0]=-1 if @zMove[1][0]>=0 
              # Restore the item the player's first Pokémon was due to use
              if @choices[0][0]==3 && $PokemonBag && $PokemonBag.pbCanStore?(@choices[0][1])
                $PokemonBag.pbStoreItem(@choices[0][1])
              end
              pbCommandPhase
              return
            end
            break if commandDone
          end
        end
      end
    end
  end

Input R:
Code:
Expand Collapse Copy
      if Input.trigger?(Input::C)   # Confirm choice
        pbPlayDecisionSE
        ret=cw.index
        @lastcmd[index]=ret
        return ret
      elsif Input.trigger?(Input::B) && index==2 && @lastcmd[0]!=2 # Cancel
        pbPlayDecisionSE
      elsif Input.trigger?(Input::R) # is the same as S
        pbPlayDecisionSE
        return 5
      end
    end 
  end
 

Hollow_Ego

Cooltrainer
Member
Joined
May 19, 2018
Posts
115
Oh God, so nice to test battles!
But, i put everything and doenst show the screen when press R or S buttoms.
What could be?

EDIT: im usin v17.2 and ive Zmove scripts

Code:
Expand Collapse Copy
  def pbCommandPhase
    @scene.pbBeginCommandPhase
#    @scene.pbResetCommandIndices
    for i in 0...4   # Reset choices if commands can be shown
      @battlers[i].effects[PBEffects::SkipTurn]=false
      if pbCanShowCommands?(i) || @battlers[i].fainted?
        @choices[i][0]=0
        @choices[i][1]=0
        @choices[i][2]=nil
        @choices[i][3]=-1
      else
        unless !@doublebattle && pbIsDoubleBattler?(i)
          PBDebug.log("[Reusing commands] #{@battlers[i].pbThis(true)}")
        end
      end
    end
    # Reset choices to perform Mega Evolution if it wasn't done somehow
    if !$forceMegaEvo
      for i in 0...2
        for j in 0...@megaEvolution[i].length
          @megaEvolution[i][j]=-1 if @megaEvolution[i][j]>=0
        end
      end
    end
      for i in 0...@zMove[0].length
        @zMove[0][i]=-1 if @zMove[0][i]>=0
      end
      for i in 0...@zMove[1].length
        @zMove[1][i]=-1 if @zMove[1][i]>=0
      end    
    for i in 0...4
      break if @decision!=0
      next if @choices[i][0]!=0
      if !pbOwnedByPlayer?(i) || @controlPlayer
        if !@battlers[i].isFainted? && pbCanShowCommands?(i)
          @scene.pbChooseEnemyCommand(i) if !@forceSwitching && !@skipturn
          pbEnemyShouldWithdrawEx?(i,true) if @forceSwitching
        end
      else
        commandDone=false
        commandEnd=false
        if pbCanShowCommands?(i)
          loop do
            cmd=pbCommandMenu(i)
            if cmd==0 # Fight
              if pbCanShowFightMenu?(i)
                commandDone=true if pbAutoFightMenu(i)
                until commandDone
                  index=@scene.pbFightMenu(i)
                  if index<0
                    side=(pbIsOpposing?(i)) ? 1 : 0
                    owner=pbGetOwnerIndex(i)
                    if @megaEvolution[side][owner]==i
                      @megaEvolution[side][owner]=-1
                    end
                    if @zMove[side][owner]==i
                      @zMove[side][owner]=-1
                    end                     
                    break
                  end
                  next if !pbRegisterMove(i,index)
                  if @doublebattle
                    thismove=@battlers[i].moves[index]
                    target=@battlers[i].pbTarget(thismove)
                    if target==PBTargets::SingleNonUser # single non-user
                      target=@scene.pbChooseTarget(i,target)
                      next if target<0
                      pbRegisterTarget(i,target)
                    elsif target==PBTargets::UserOrPartner # Acupressure
                      target=@scene.pbChooseTarget(i,target)
                      next if target<0 || (target&1)==1
                      pbRegisterTarget(i,target)
                    end
                  end
                  commandDone=true
                end
              else
                pbAutoChooseMove(i)
                commandDone=true
              end
            elsif cmd!=0 && @battlers[i].effects[PBEffects::SkyDrop]
              pbDisplay(_INTL("Sky Drop won't let {1} go!",@battlers[i].pbThis(true)))
            elsif cmd==1 # Bag
              if !@internalbattle
                if pbOwnedByPlayer?(i)
                  pbDisplay(_INTL("Items can't be used here."))
                end
              else
                item=pbItemMenu(i)
                if item[0]>0
                  if pbRegisterItem(i,item[0],item[1])
                    commandDone=true
                  end
                end
              end
            elsif cmd==2 # Pokémon
              pkmn=pbSwitchPlayer(i,false,true)
              if pkmn>=0
                commandDone=true if pbRegisterSwitch(i,pkmn)
              end
            elsif cmd==3   # Run
              run=pbRun(i)
              if run>0
                commandDone=true
                return
              elsif run<0
                commandDone=true
                side=(pbIsOpposing?(i)) ? 1 : 0
                owner=pbGetOwnerIndex(i)
                if @megaEvolution[side][owner]==i
                  @megaEvolution[side][owner]=-1
                end
                if @zMove[side][owner]==i
                  @zMove[side][owner]=-1
                end                 
              end
            elsif cmd==4   # Call
              thispkmn=@battlers[i]
              @choices[i][0]=4   # "Call Pokémon"
              @choices[i][1]=0
              @choices[i][2]=nil
              side=(pbIsOpposing?(i)) ? 1 : 0
              owner=pbGetOwnerIndex(i)
              if @megaEvolution[side][owner]==i
                @megaEvolution[side][owner]=-1
              end
              if @zMove[side][owner]==i
                @zMove[side][owner]=-1
              end  
              commandDone=true
             
            elsif cmd==5 # Debug
              pbBattlerDebug
              commandDone=true if (@battlers[i].effects[PBEffects::SkipTurn])
            elsif cmd==-1   # Go back to first battler's choice
              @megaEvolution[0][0]=-1 if @megaEvolution[0][0]>=0
              @megaEvolution[1][0]=-1 if @megaEvolution[1][0]>=0
              @zMove[0][0]=-1 if @zMove[0][0]>=0
              @zMove[1][0]=-1 if @zMove[1][0]>=0
              # Restore the item the player's first Pokémon was due to use
              if @choices[0][0]==3 && $PokemonBag && $PokemonBag.pbCanStore?(@choices[0][1])
                $PokemonBag.pbStoreItem(@choices[0][1])
              end
              pbCommandPhase
              return
            end
            break if commandDone
          end
        end
      end
    end
  end

Input R:
Code:
Expand Collapse Copy
      if Input.trigger?(Input::C)   # Confirm choice
        pbPlayDecisionSE
        ret=cw.index
        @lastcmd[index]=ret
        return ret
      elsif Input.trigger?(Input::B) && index==2 && @lastcmd[0]!=2 # Cancel
        pbPlayDecisionSE
      elsif Input.trigger?(Input::R) # is the same as S
        pbPlayDecisionSE
        return 5
      end
    end
  end
Are the Z-Move Scripts using the same button perhaps? Try defining a diferent button for the menu
 

WolfPP

Discord wolfppontes
Member
Joined
Aug 24, 2018
Posts
136
Are the Z-Move Scripts using the same button perhaps? Try defining a diferent button for the menu

i '(Input::Q)' and give me error maybe the game do not recognize lol Which other buttom can i use (acceptible)?
 

Hollow_Ego

Cooltrainer
Member
Joined
May 19, 2018
Posts
115
You have to define new buttons. I personally use Q as well.
Either look up how to implement new buttons or wait till I get to it :)
 

Hollow_Ego

Cooltrainer
Member
Joined
May 19, 2018
Posts
115
How to add a button shown by adding Q

in PSystem_Controls under module Input add
Ruby:
Expand Collapse Copy
Q      = 38
38 is to be replaced with the lowest unused number. So if your last button is defined with 31 then you would set Q equal to 32.

under def self.buttonToKey(button), before else; return [] add
when Input::Q; return [0x51] #Q

Check if this key is double assigned by looking for 0x51 in that part. By default Input::L contains A, Q, Page Up. Be aware of that when assigning your input.
 

WolfPP

Discord wolfppontes
Member
Joined
Aug 24, 2018
Posts
136
How to add a button shown by adding Q

in PSystem_Controls under module Input add
Ruby:
Expand Collapse Copy
Q      = 38
38 is to be replaced with the lowest unused number. So if your last button is defined with 31 then you would set Q equal to 32.

under def self.buttonToKey(button), before else; return [] add


Check if this key is double assigned by looking for 0x51 in that part. By default Input::L contains A, Q, Page Up. Be aware of that when assigning your input.

Oh my God. Eu te amo!

I got it <3

Ty ty!

EDIT: Hmmm, now when force MegaEvo to foe, give me that:
Code:
Expand Collapse Copy
---------------------------
Pokemon Essentials
---------------------------
[Pokémon Essentials version 17.2]

Exception: NoMethodError

Message: undefined method `fullname' for nil:NilClass

PokeBattle_Battle:1760:in `pbMegaEvolve'

PokeBattle_Battle:2873:in `pbAttackPhase'

PokeBattle_Battle:2868:in `each'

PokeBattle_Battle:2868:in `pbAttackPhase'

PokeBattle_Battle:2659:in `pbStartBattleCore'

PokeBattle_Battle:2658:in `logonerr'

PokeBattle_Battle:2658:in `pbStartBattleCore'

PokeBattle_Battle:2644:in `loop'

PokeBattle_Battle:2667:in `pbStartBattleCore'

PokeBattle_Battle:2467:in `pbStartBattle'

And when battle to a Wild Mega Charizard, hes back to normal Charizard :/ (same to Primal Kyogre). I use that script to wild megas and primal:
https://www.pokecommunity.com/showthread.php?t=360545

Ty ty!
 
Last edited:

Hollow_Ego

Cooltrainer
Member
Joined
May 19, 2018
Posts
115
Oh my God. Eu te amo!

I got it <3

Ty ty!

EDIT: Hmmm, now when force MegaEvo to foe, give me that:
Code:
Expand Collapse Copy
---------------------------
Pokemon Essentials
---------------------------
[Pokémon Essentials version 17.2]

Exception: NoMethodError

Message: undefined method `fullname' for nil:NilClass

PokeBattle_Battle:1760:in `pbMegaEvolve'

PokeBattle_Battle:2873:in `pbAttackPhase'

PokeBattle_Battle:2868:in `each'

PokeBattle_Battle:2868:in `pbAttackPhase'

PokeBattle_Battle:2659:in `pbStartBattleCore'

PokeBattle_Battle:2658:in `logonerr'

PokeBattle_Battle:2658:in `pbStartBattleCore'

PokeBattle_Battle:2644:in `loop'

PokeBattle_Battle:2667:in `pbStartBattleCore'

PokeBattle_Battle:2467:in `pbStartBattle'

And when battle to a Wild Mega Charizard, hes back to normal Charizard :/ (same to Primal Kyogre). I use that script to wild megas and primal:
https://www.pokecommunity.com/showthread.php?t=360545

Ty ty!
From what I can tell this is a problem with the fact that a wild Pokemon doesn't have a traine. That'S why it's throwing this error. What you need to do is implement a check for wild Pokes in pbMegaEvolve. Similar to what Rot8er_ConeX posted there as a fix
 

WolfPP

Discord wolfppontes
Member
Joined
Aug 24, 2018
Posts
136
From what I can tell this is a problem with the fact that a wild Pokemon doesn't have a traine. That'S why it's throwing this error. What you need to do is implement a check for wild Pokes in pbMegaEvolve. Similar to what Rot8er_ConeX posted there as a fix

All Right! I will do that :D Ty ty for your help :)
 

WolfPP

Discord wolfppontes
Member
Joined
Aug 24, 2018
Posts
136
Oh, sorry to flood (idk if edit the last will alert ya)
But one more thing:

When i force to charizard (or any pokemon than haves 2 mega forms) he will mega to '_1' form
How can we config to show us to force _1 or _2?

Ty ty!
 

Hollow_Ego

Cooltrainer
Member
Joined
May 19, 2018
Posts
115
Oh, sorry to flood (idk if edit the last will alert ya)
But one more thing:

When i force to charizard (or any pokemon than haves 2 mega forms) he will mega to '_1' form
How can we config to show us to force _1 or _2?

Ty ty!
Actually... I haven't thought about this at all. I would need to add that to the code somehow...
 

RTCanwind

Tower Tycoon
Member
Joined
Jan 15, 2021
Posts
38
Wow,the script is interesting!
I have an idea,if its possible to just add a scene to check pokemon's stats,field's effects and so on,just like Pokemon Sun&Moon did?
 

Hollow_Ego

Cooltrainer
Member
Joined
May 19, 2018
Posts
115
Wow,the script is interesting!
I have an idea,if its possible to just add a scene to check pokemon's stats,field's effects and so on,just like Pokemon Sun&Moon did?
That would be an entirely different project. It could be done by creating an overlay for the stats, that would block the whole screen. Not sure how practicall that is though.

Atm I'm busy working on a new debug menu for v18
 
Back
Top