• 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.
Enhanced Battle UI [DBK Add-On] [v21.1]

Resource Enhanced Battle UI [DBK Add-On] [v21.1] v2.0.5

komeiji514

Elite Trainer
Member
Joined
Oct 28, 2023
Posts
267
I mean, I know how to fix it. I'm letting Ludicious know so they can fix it on their end for public release. But your current solution just displays it if the plugin is installed. || is "or". You'd want something like this.
Ruby:
Expand Collapse Copy
if (battler.tera? || battler.pbOwnedByPlayer? || !@battle.internalBattle)) && PluginManager.installed?("[DBK] Terastallization")
      pkmn = (illusion) ? poke : battler
      pbDrawImagePositions(@infoUIOverlay, [[@path + "info_extra", xpos + 182, ypos + 95]])
      pbDisplayTeraType(pkmn, @infoUIOverlay, xpos + 186, ypos + 97, true)
    end
  end
However, I suspect that Ludicious wanted to avoid using a PluginManager check because there are Terastallization plugins besides their own.
sorry for the mistake
 

Lucidious89

Champion
Member
Joined
Nov 12, 2020
Posts
1,222
If someone has this plugin but not the Terastallization plugin installed, the game throws an error as soon as you try to open the Battler UI (the selection menu is fine), because the function pbDisplayTeraType( does not exist. I assume that you intended this to be a moot point because the lack of a tera_type property of battlers would prevent that line of code from being run, but any player-controlled battler will still try to run that block of code.
Ruby:
Expand Collapse Copy
if battler.tera? || battler.pbOwnedByPlayer? || !@battle.internalBattle || PluginManager.installed?("Terastallization")
      pkmn = (illusion) ? poke : battler
      pbDrawImagePositions(@infoUIOverlay, [[@path + "info_extra", xpos + 182, ypos + 95]])
      pbDisplayTeraType(pkmn, @infoUIOverlay, xpos + 186, ypos + 97, true)
    end
  end
Will this work? Edit: There may be a way to resolve it better.
I uploaded a fix.
 

Lucidious89

Champion
Member
Joined
Nov 12, 2020
Posts
1,222
Lucidious89 updated Enhanced Battle UI [DBK Add-On] [v21.1] with a new update entry:

v2.0 Update

  • Overhauled how the plugin opens each UI page on the backend to make the code more efficient.
  • Improved the sprite outliner utilities so that it may now add outlines to item sprites, not just Pokemon icons.
  • Made some minor tweaks to Tera type displays so that a Pokemon that is unable to use Terastallization will no longer display a Tera type in the Battler Info UI.
  • Added button prompts to the battle scene to make the player aware of which button opens which UI. This may be...

Read the rest of this update entry...
 

Willix

Novice
Member
Joined
Feb 7, 2024
Posts
42
Hey, I love this new update! I tried to make an extra info UI on top of your plugin in the past, to show the player which key does what, but this one is much better than mine. Also love the ball shortcut idea, it is really handy. I've just one question regarding this though, I want to replace the default "back" arrow with my own animated one, similar to those left and right arrows, to better fit the style, but I can't seem to make it work. Can this be done with relative ease?
 

Lucidious89

Champion
Member
Joined
Nov 12, 2020
Posts
1,222
Hey, I love this new update! I tried to make an extra info UI on top of your plugin in the past, to show the player which key does what, but this one is much better than mine. Also love the ball shortcut idea, it is really handy. I've just one question regarding this though, I want to replace the default "back" arrow with my own animated one, similar to those left and right arrows, to better fit the style, but I can't seem to make it work. Can this be done with relative ease?
The back arrow is actually an item sprite, which is the same one used in the bag. It's found in Graphics/Items/back so you can replace that icon if you want. I doubt you can make it animated though. The ball menu always has 5 item sprites displayed at a time. Even if the slot is blank or displaying an arrow, they are still considered item sprites.

So to do what you wanna do, youll have to initialize your arrow sprites and have their visibility set to false by default. Then in the ball menu youll have to edit the loop to turn their visibility on and update their x coordinates whenever they should be visible in the ball inventory. You'll also have to turn off the visibility of the default arrow sprite the plugin uses by setting blankzero = true for that slot.

It's not necessarily difficult, just tedious if you're unfamiliar with the code.
 

Willix

Novice
Member
Joined
Feb 7, 2024
Posts
42
The back arrow is actually an item sprite, which is the same one used in the bag. It's found in Graphics/Items/back so you can replace that icon if you want. I doubt you can make it animated though. The ball menu always has 5 item sprites displayed at a time. Even if the slot is blank or displaying an arrow, they are still considered item sprites.

So to do what you wanna do, youll have to initialize your arrow sprites and have their visibility set to false by default. Then in the ball menu youll have to edit the loop to turn their visibility on and update their x coordinates whenever they should be visible in the ball inventory. You'll also have to turn off the visibility of the default arrow sprite the plugin uses by setting blankzero = true for that slot.

It's not necessarily difficult, just tedious if you're unfamiliar with the code.
Thank you so much that worked perfectly! I already had my arrow initialized without visibility and had been able to show it when necessary but I couldn't find the way to make the default back sprite dissapear. Didn't know that blankzero was what I was looking for. Thanks again!
 

MeiVongola

Rookie
Member
Joined
May 8, 2024
Posts
1
Hey Ludicious ! Awesome work. The script seems to have issues with your SOS Battles script.

When a new opponent joins the Battle, and therefore changes the battle from a 1v1 to a 1v2, Enhanced Battle UI seems to have some issues:

When you try to open the info UI outside the Move Menu:
Stack Trace:
Expand Collapse Copy
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]

Exception: NoMethodError
Message: undefined method `visible=' for nil:NilClass

Backtrace:
[[DBK] Enhanced Battle UI] [000] Main.rb:109:in `block in pbHideInfoUI'
[[DBK] Enhanced Battle UI] [000] Main.rb:108:in `each'
[[DBK] Enhanced Battle UI] [000] Main.rb:108:in `pbHideInfoUI'
[[DBK] Enhanced Battle UI] [002] Selection Menu.rb:10:in `pbToggleBattleInfo'
[[DBK] Enhanced Battle UI] [002] Selection Menu.rb:285:in `block in pbCommandMenuEx'
[[DBK] Enhanced Battle UI] [002] Selection Menu.rb:258:in `loop'
[[DBK] Enhanced Battle UI] [002] Selection Menu.rb:258:in `pbCommandMenuEx'
003_Scene_ChooseCommands.rb:15:in `pbCommandMenu'
009_Battle_CommandPhase.rb:29:in `pbCommandMenu'
009_Battle_CommandPhase.rb:222:in `block (2 levels) in pbCommandPhaseLoop'

When you try to do so from inside the Moves Menu:
Stack Trace 2, Electric Boogaloo:
Expand Collapse Copy
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]

Exception: NoMethodError
Message: undefined method `visible=' for nil:NilClass

Backtrace:
[[DBK] Enhanced Battle UI] [000] Main.rb:109:in `block in pbHideInfoUI'
[[DBK] Enhanced Battle UI] [000] Main.rb:108:in `each'
[[DBK] Enhanced Battle UI] [000] Main.rb:108:in `pbHideInfoUI'
[[DBK] Enhanced Battle UI] [002] Selection Menu.rb:10:in `pbToggleBattleInfo'
[[DBK] Enhanced Battle UI] [000] Main.rb:207:in `pbFightMenu_Extra'
[Deluxe Battle Kit] [003] Command Menu Refactor.rb:217:in `block in pbFightMenu'
[Deluxe Battle Kit] [003] Command Menu Refactor.rb:168:in `loop'
[Deluxe Battle Kit] [003] Command Menu Refactor.rb:168:in `pbFightMenu'
[Deluxe Battle Kit] [003] Command Menu Refactor.rb:243:in `pbFightMenu'
009_Battle_CommandPhase.rb:230:in `block (2 levels) in pbCommandPhaseLoop'

And when you try to use a move:
Stack Trace 3:
Expand Collapse Copy
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]

Exception: NoMethodError
Message: undefined method `visible=' for nil:NilClass

Backtrace:
[[DBK] Enhanced Battle UI] [000] Main.rb:109:in `block in pbHideInfoUI'
[[DBK] Enhanced Battle UI] [000] Main.rb:108:in `each'
[[DBK] Enhanced Battle UI] [000] Main.rb:108:in `pbHideInfoUI'
[[DBK] Enhanced Battle UI] [000] Main.rb:176:in `pbFightMenu_Confirm'
[Deluxe Battle Kit] [003] Command Menu Refactor.rb:199:in `block in pbFightMenu'
[Deluxe Battle Kit] [003] Command Menu Refactor.rb:168:in `loop'
[Deluxe Battle Kit] [003] Command Menu Refactor.rb:168:in `pbFightMenu'
[Deluxe Battle Kit] [003] Command Menu Refactor.rb:243:in `pbFightMenu'
009_Battle_CommandPhase.rb:230:in `block (2 levels) in pbCommandPhaseLoop'
009_Battle_CommandPhase.rb:221:in `loop'

From my tests, it doesn't happen if I launch a regular 1v2 fight from the Debug Menu, only when one side changes sizes mid-battle.
 

Lucidious89

Champion
Member
Joined
Nov 12, 2020
Posts
1,222
Hey Ludicious ! Awesome work. The script seems to have issues with your SOS Battles script.

When a new opponent joins the Battle, and therefore changes the battle from a 1v1 to a 1v2, Enhanced Battle UI seems to have some issues:

When you try to open the info UI outside the Move Menu:
Stack Trace:
Expand Collapse Copy
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]

Exception: NoMethodError
Message: undefined method `visible=' for nil:NilClass

Backtrace:
[[DBK] Enhanced Battle UI] [000] Main.rb:109:in `block in pbHideInfoUI'
[[DBK] Enhanced Battle UI] [000] Main.rb:108:in `each'
[[DBK] Enhanced Battle UI] [000] Main.rb:108:in `pbHideInfoUI'
[[DBK] Enhanced Battle UI] [002] Selection Menu.rb:10:in `pbToggleBattleInfo'
[[DBK] Enhanced Battle UI] [002] Selection Menu.rb:285:in `block in pbCommandMenuEx'
[[DBK] Enhanced Battle UI] [002] Selection Menu.rb:258:in `loop'
[[DBK] Enhanced Battle UI] [002] Selection Menu.rb:258:in `pbCommandMenuEx'
003_Scene_ChooseCommands.rb:15:in `pbCommandMenu'
009_Battle_CommandPhase.rb:29:in `pbCommandMenu'
009_Battle_CommandPhase.rb:222:in `block (2 levels) in pbCommandPhaseLoop'

When you try to do so from inside the Moves Menu:
Stack Trace 2, Electric Boogaloo:
Expand Collapse Copy
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]

Exception: NoMethodError
Message: undefined method `visible=' for nil:NilClass

Backtrace:
[[DBK] Enhanced Battle UI] [000] Main.rb:109:in `block in pbHideInfoUI'
[[DBK] Enhanced Battle UI] [000] Main.rb:108:in `each'
[[DBK] Enhanced Battle UI] [000] Main.rb:108:in `pbHideInfoUI'
[[DBK] Enhanced Battle UI] [002] Selection Menu.rb:10:in `pbToggleBattleInfo'
[[DBK] Enhanced Battle UI] [000] Main.rb:207:in `pbFightMenu_Extra'
[Deluxe Battle Kit] [003] Command Menu Refactor.rb:217:in `block in pbFightMenu'
[Deluxe Battle Kit] [003] Command Menu Refactor.rb:168:in `loop'
[Deluxe Battle Kit] [003] Command Menu Refactor.rb:168:in `pbFightMenu'
[Deluxe Battle Kit] [003] Command Menu Refactor.rb:243:in `pbFightMenu'
009_Battle_CommandPhase.rb:230:in `block (2 levels) in pbCommandPhaseLoop'

And when you try to use a move:
Stack Trace 3:
Expand Collapse Copy
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]

Exception: NoMethodError
Message: undefined method `visible=' for nil:NilClass

Backtrace:
[[DBK] Enhanced Battle UI] [000] Main.rb:109:in `block in pbHideInfoUI'
[[DBK] Enhanced Battle UI] [000] Main.rb:108:in `each'
[[DBK] Enhanced Battle UI] [000] Main.rb:108:in `pbHideInfoUI'
[[DBK] Enhanced Battle UI] [000] Main.rb:176:in `pbFightMenu_Confirm'
[Deluxe Battle Kit] [003] Command Menu Refactor.rb:199:in `block in pbFightMenu'
[Deluxe Battle Kit] [003] Command Menu Refactor.rb:168:in `loop'
[Deluxe Battle Kit] [003] Command Menu Refactor.rb:168:in `pbFightMenu'
[Deluxe Battle Kit] [003] Command Menu Refactor.rb:243:in `pbFightMenu'
009_Battle_CommandPhase.rb:230:in `block (2 levels) in pbCommandPhaseLoop'
009_Battle_CommandPhase.rb:221:in `loop'

From my tests, it doesn't happen if I launch a regular 1v2 fight from the Debug Menu, only when one side changes sizes mid-battle.
SOS add-on has been updated.
 

wrigty12

Tester-Coder Hybrid
Member
Joined
Jul 24, 2022
Posts
547
Hey Lucidious, what are the chances you support your Select Battler UI as a replacement for target selection for moves? I was thinking of looking into doing the change myself, but thought I'd ask if it was anywhere on your roadmap
 

Cainjeman

Rookie
Member
Joined
Mar 18, 2024
Posts
2
Hi! I have an issue where the window is not showing in battle.



All of the UI elements are in their folder, and the command box doesn't show me any error. The functionality is there and works just like it should! It pulls up the other windows and such when pressing A or S. Not sure what I've done here, if you have an idea of where to look I would appreciate it!

EDIT: This wasn't an SOS battle, but I see you've updated that so I'm going to see if that fixes it. I have the base DBK, SOS Battles and Enhanced UI.
EDIT2: Yup, that did it. Also an update for base DBK. This is what I get for starting development during the dark times of the old castle being down. Sorry to bother you!
EDIT3: I did notice that it doesn't show the correct form in the Pokemon overlay. My example above is against a Galarian Darumaka, but it shows the normal icon for Darumaka instead. Could be something wrong on my end- like not having the Pokedex set up either.
 
Last edited:

komeiji514

Elite Trainer
Member
Joined
Oct 28, 2023
Posts
267
Hi! I have an issue where the window is not showing in battle.



All of the UI elements are in their folder, and the command box doesn't show me any error. The functionality is there and works just like it should! It pulls up the other windows and such when pressing A or S. Not sure what I've done here, if you have an idea of where to look I would appreciate it!

EDIT: This wasn't an SOS battle, but I see you've updated that so I'm going to see if that fixes it. I have the base DBK, SOS Battles and Enhanced UI.
EDIT2: Yup, that did it. Also an update for base DBK. This is what I get for starting development during the dark times of the old castle being down. Sorry to bother you!
EDIT3: I did notice that it doesn't show the correct form in the Pokemon overlay. My example above is against a Galarian Darumaka, but it shows the normal icon for Darumaka instead. Could be something wrong on my end- like not having the Pokedex set up either.

I have tested in my own game and everything goes right.
Make sure you have Galarian Darumaka Icon in your game folder.
 

Lucidious89

Champion
Member
Joined
Nov 12, 2020
Posts
1,222
Hey Lucidious, what are the chances you support your Select Battler UI as a replacement for target selection for moves? I was thinking of looking into doing the change myself, but thought I'd ask if it was anywhere on your roadmap
Not on my roadmap, no. It wouldn't be a simple matter of just copy/pasting the selection menu UI over the default target UI's code. The target menu works entirely differently and is very specific. So it would essentially mean recoding the entire target menu to look like the selection menu, but in essence it would mean coding an entirely new UI. It's not really a priority for me.
 

wrigty12

Tester-Coder Hybrid
Member
Joined
Jul 24, 2022
Posts
547
Not on my roadmap, no. It wouldn't be a simple matter of just copy/pasting the selection menu UI over the default target UI's code. The target menu works entirely differently and is very specific. So it would essentially mean recoding the entire target menu to look like the selection menu, but in essence it would mean coding an entirely new UI. It's not really a priority for me.
Makes sense, looks like I got my next challenge for my game!
 

komeiji514

Elite Trainer
Member
Joined
Oct 28, 2023
Posts
267
I am using stellar Terapagos on my side and when viewing the opponent pokemon's information this happens.
The game didn't crash but the Battle scene become weird.
[2024-05-31 21:44:32 +0800]
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]

Exception: TypeError
Message: Argument 0: Expected string

Backtrace:
087:DrawText:1109:in `text_size'
087:DrawText:1109:in `block in pbDrawTextPositions'
087:DrawText:1108:in `each'
087:DrawText:1108:in `pbDrawTextPositions'
[[DBK] Enhanced Battle UI] [003] Battler Info UI.rb:364:in `pbAddEffectsDisplay'
[[DBK] Enhanced Battle UI] [003] Battler Info UI.rb:172:in `pbUpdateBattlerInfo'
[[DBK] Enhanced Battle UI] [003] Battler Info UI.rb:83:in `block in pbOpenBattlerInfo'
[[DBK] Enhanced Battle UI] [003] Battler Info UI.rb:28:in `loop'
[[DBK] Enhanced Battle UI] [003] Battler Info UI.rb:28:in `pbOpenBattlerInfo'
[[DBK] Enhanced Battle UI] [002] Selection Menu.rb:192:in `block in pbSelectBattlerInfo'
 

Penelope

Trainer
Member
Joined
Sep 15, 2023
Posts
86
hello, i wrote a new ability:
Ruby:
Expand Collapse Copy
  def effectiveWeather
    ret = @battle.pbWeather
    ret = :None if [:Sun, :Rain, :HarshSun, :HeavyRain].include?(ret) && hasActiveItem?(:UTILITYUMBRELLA)
    ret = :Sun if ret == :None && hasActiveAbility?([:CHLOROPLAST, :BIGLEAVES]) # battles as if in sunlight
    return ret
  end
when i opened the battler info in battle, it crashed.
i found it checks battle weather rather than battler weather,(line 390 or so) i mean, since it is info of battlers maybe check battler.effectiveWeather is better.
 

Lucidious89

Champion
Member
Joined
Nov 12, 2020
Posts
1,222
I am using stellar Terapagos on my side and when viewing the opponent pokemon's information this happens.
The game didn't crash but the Battle scene become weird.
[2024-05-31 21:44:32 +0800]
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]

Exception: TypeError
Message: Argument 0: Expected string

Backtrace:
087:DrawText:1109:in `text_size'
087:DrawText:1109:in `block in pbDrawTextPositions'
087:DrawText:1108:in `each'
087:DrawText:1108:in `pbDrawTextPositions'
[[DBK] Enhanced Battle UI] [003] Battler Info UI.rb:364:in `pbAddEffectsDisplay'
[[DBK] Enhanced Battle UI] [003] Battler Info UI.rb:172:in `pbUpdateBattlerInfo'
[[DBK] Enhanced Battle UI] [003] Battler Info UI.rb:83:in `block in pbOpenBattlerInfo'
[[DBK] Enhanced Battle UI] [003] Battler Info UI.rb:28:in `loop'
[[DBK] Enhanced Battle UI] [003] Battler Info UI.rb:28:in `pbOpenBattlerInfo'
[[DBK] Enhanced Battle UI] [002] Selection Menu.rb:192:in `block in pbSelectBattlerInfo'
Did you edit the plugin at all? Because this error doesn't make any sense unless the code has been tweaked.
It has nothing to do with Tera or Terapagos, it's just simply saying that it's trying to display text on screen, but it's getting a number value instead of a string.
 

komeiji514

Elite Trainer
Member
Joined
Oct 28, 2023
Posts
267
Did you edit the plugin at all? Because this error doesn't make any sense unless the code has been tweaked.
It has nothing to do with Tera or Terapagos, it's just simply saying that it's trying to display text on screen, but it's getting a number value instead of a string.
I just added a new move flag and changed Move Info UI. Idk what caused that.
 

Lucidious89

Champion
Member
Joined
Nov 12, 2020
Posts
1,222
I just added a new move flag and changed Move Info UI. Idk what caused that.
Well, the error seems to be pointing specifically to displaying text for battler effects in play (like weather, terrain, Trick Room, etc). So I doubt it has anything to do specifically with Terapagos. I would just test a bunch of things until you narrow it down. Because it works perfectly fine for me.
 

komeiji514

Elite Trainer
Member
Joined
Oct 28, 2023
Posts
267
Well, the error seems to be pointing specifically to displaying text for battler effects in play (like weather, terrain, Trick Room, etc). So I doubt it has anything to do specifically with Terapagos. I would just test a bunch of things until you narrow it down. Because it works perfectly fine for me.
Strange, I tested just now and nothing happened.
Edit: Last time the opposing wild pokemon has mementos but this may be irrelevant.
 

Lucidious89

Champion
Member
Joined
Nov 12, 2020
Posts
1,222
Strange, I tested just now and nothing happened.
Edit: Last time the opposing wild pokemon has mementos but this may be irrelevant.
Yeah, it's irrelevant. Like I said, the error points specifically to where effect text is written. So my guess is one of the battlers in play had some sort of effect on them that caused the error. Still, it doesn't make any sense why that would happen. Perhaps you have some custom effect in your game that doesn't play well with the plugin.
 
Back
Top