Golisopod User

he/him
Alola Reigon
Seen 5 Hours Ago
Posted 6 Days Ago
660 posts
5 Years
Improved Battle Menu and Summary Screen



(The Genesect in this battle has the Aerilate ability, that's why its Body Slam is Flying type. This was done to showcase the correct type displaying feature of the script.)


Overview:
This resource aims at replicating the feature in SM/SwSh which shows how effective a move is on an opponent (Super Effective, Not Very Effective etc) on the opposing Pokemon. However this resource builds upon this idea by allowing the player to see which moves receive Same Type Attack Bonus (or STAB) as well as the correct type of a move in the case of moves like Weather Ball and Abilities like Aerilate. Since with Essentials we don't have that much screen real estate to show the effectiveness with text, I've decided that highlighting the move's name based on the effectiveness is the best option for this.

Sun Moon Type Effectiveness Display vs Essentials Equivalent:




Features:
  1. Color Coded Type Effectiveness which can easily be customized.
    Example:
    Spoiler:

    Default Essentials:
    Improved Battle Menu:


    Default colors are Blue for Super Effective, Red for Not Very Effective and Light Grey of Ineffective.
  2. Displaying the types of Moves correctly in the Fight Menu. This applies to Moves like Hidden Power, Judgement, Revelation Dance, Weather Ball, Terrain Pulse and Abilities Like Refrigerate, Liquid Voice etc.
    Example:
    Spoiler:
    Default Essentials:
    Improved Battle Menu Displaying Correct Types:

  3. Displaying Highlighting for Moves if they receive Same Type Attack Bonus (or STAB) from Moves. This is displayed in 2 Different Styles.
    Example:
    Spoiler:

    No Highlighting:

    Bold STAB Highlighting:
    Shadow STAB Highlighting:

  4. Displaying all of the above in the Summary Screen when in Battle (New Style of Summary Screen)
    Example:
    Spoiler:

    Default Essentials Summary Screen:
    Summary Screen in Improved Battle Menu:
  5. Switches which can easily be used to control every aspect of the script.


Instructions[UPDATED]
Spoiler:

Installation of Script
  1. Place the contents of Improved Battle Menu and Summary Screen.txt in a New Script Section above Main
  2. Use Ctrl + Shift + F to look for FightMenuDisplay.new in PokeBattle_Scene and replace that line with this:
     @sprites["fightwindow"]=FightMenuDisplay.new(nil,battle,@viewport,-1)
  3. Paste the items in the folder to your Graphics/Pictures/Summary folder
  4. Edit the Customizable Options
  5. Start a new save (Not necessary, but just to be on the safe side)



Download Link
Please Credit Golisopod User if you use this script.

This script is not compatible with Luka SJ's Elite Battle System/Elite Battle DX.


Feedback would be greatly appreciated, especially about the summary screen. Please report any bugs you may find in the script.



Minor Issues:
Spoiler:
  • Loading moves for a Pokemon for the first time may take a second
  • The script still doesn't show type immunities for things like Powder Move and Leech Seed against Grass Types, Primal Weathers (Except Rayqyuaza), Prankster against Dark Types, Ground Types against Levitate etc. However the default games don't show this so I have decided not to either. Unless many people ask for this, I won't be adding it.


Changelog:
Spoiler:

v3.4
  • Fixes all issues with the new Summary Screen.
  • Changed how types are displayed in double battles
  • Added Text and Arrow Indicators to guide people when using the new summary screen. (Default Positions of Arrows may need to be changed)


v3.1
  • Fixes a small issue with the new Summary Screen.

v3.0
  • Should actually work with Zodiac Powers
  • Fixed all issues with double battles
  • Changed up how single targeting moves' effectiveness is displayed in double battles
  • Removed alot of unnecessary checks
  • Added support for displaying Type Highlighting in Summary Screen
  • Added new concise BW-style Summary Screen in battle, which displays only data important in battles

v2.0
  • Should theoretically work with Zodiac Powers
  • Fixed the default colours to look much more pleasing to the eye
  • Fixed most issues with double battles
  • Cleaned up alot of the script to be more efficient
  • Added a new style of Highlighting for STAB

v1.5
  • Added compatibility with Z-Moves and Dynamax
  • Added Highlighting for moves with STAB
  • Added Switches for more control over what is Highlighted and what isn't.
  • Fixed Bugs with Abilities that grant immunity to certain types.
  • Fixed the coloring of moves when selected (now they actually change color if the Customizable options are changed :P)

v1.0
  • Script Released
Male
Spain
Seen August 5th, 2021
Posted April 19th, 2021
48 posts
2.5 Years
This is a great script.

A lot of people that plays the main games, or the games that we made, have problems with the types and effectiveness, so this is a great help for them.

In my opinion, maybe some option (a switch, as you said) for turning on/off, for those that doesn't want it could be pretty cool.

I noticed that it doesn't display the buttons for Z moves, ultra burst or the recently added script for dynamaxing made by Lucidious89.

Could they be added?

Thanks for your effort and for this script, of course.

Golisopod User

he/him
Alola Reigon
Seen 5 Hours Ago
Posted 6 Days Ago
660 posts
5 Years
I noticed that it doesn't display the buttons for Z moves, ultra burst or the recently added script for dynamaxing made by Lucidious89.

Could they be added?
Ironically, the project I implemented this in first did have Dynamax and Z Moves, but I removed all of that functionality just so that the script would be compatible with the base version of Pokemon Essentials.

I'll be sure to make those edits in a later update, seeing that many people are gonna be using the new Dynamax Script.
Male
Seen 5 Days Ago
Posted 4 Weeks Ago
279 posts
3.4 Years
This is a cool script, and I even got it to work with Reborn-style Field Effect type modifiers, which is really useful for people who don't have move type changes based on a field memorized. However, there was 1 problem I encountered (even before changing it to work with field effects). When sending out a Kyogre (in doubles) knowing Detect, Metronome, Night Shade, and Origin Pulse, a message saying "But it had no effect" just keeps playing right after I click on the "Fight" option. The opposing Pokemon were Togekiss (with Fairy type) and Cherrim. I would guess the problem is with Night Shade or Origin Pulse because Protect and Metronome worked fine on my other Pokemon and maybe there's a problem with Night Shade's fixed damage or Origin Pulse's multi-target attribute.

EDIT: Something else I noticed was that when hovering over a grass move when the opponent has Sap Sipper raises the opponent's attack to +6 and keeps saying "Sap Sipper makes [move] ineffective". I think this is due to calling pbTypeImmunityByAbility in the effectiveness method you defined, which will display messages and make attack boosts each time it's called. I realize that this is also what is causing a problem with Kyogre's Origin Pulse, as the field I was on makes Water moves ineffective against Grass Pokemon as defined in pbTypeImmunityByAbility. I would recommend just removing this check because it also can reveal the opponent's ability in circumstances that one would normally not know at first like with figuring out whether Lanturn has Water Absorb/Volt Absorb, and whether Azumarill has Huge Power/Sap Sipper.

EDIT 2: Also, changing the colors in customizable options doesn't work. I think this has something to do with this section of code (in def update) using the values originally defined in the customizable options section instead of the variable names (it worked when I replaced them):
      if !PBTargets.notCheckedForType?(moves[i])
        if !battle.doublebattle || (battle.doublebattle && !PBTargets.targetsOneOpponent?(moves[i]))
          if typemod>8
            textpos.push([moves[i].name,x+96,y+8,2,Color.new(0,255,0),Color.new(0,155,0)])
          elsif typemod<8 && typemod>0
            textpos.push([moves[i].name,x+96,y+8,2,Color.new(255,0,0),Color.new(155,0,0)])
          elsif typemod==0
            textpos.push([moves[i].name,x+96,y+8,2,Color.new(164,164,164),Color.new(255,255,255)])   
          else
           textpos.push([moves[i].name,x+96,y+8,2,
             PokeBattle_SceneConstants::MENUBASECOLOR,PokeBattle_SceneConstants::MENUSHADOWCOLOR])
           end
        else
          if typemod>8
            textpos.push([moves[i].name,x+96,y+8,2,Color.new(0,255,0),Color.new(0,155,0)])
          elsif typemod<4 && typemod>0
            textpos.push([moves[i].name,x+96,y+8,2,Color.new(255,0,0),Color.new(155,0,0)])
          elsif typemod==0
            textpos.push([moves[i].name,x+96,y+8,2,Color.new(164,164,164),Color.new(255,255,255)])   
          else
           textpos.push([moves[i].name,x+96,y+8,2,
             PokeBattle_SceneConstants::MENUBASECOLOR,PokeBattle_SceneConstants::MENUSHADOWCOLOR])
           end
        end
      else
        textpos.push([moves[i].name,x+96,y+8,2,
           PokeBattle_SceneConstants::MENUBASECOLOR,PokeBattle_SceneConstants::MENUSHADOWCOLOR])
      end

Golisopod User

he/him
Alola Reigon
Seen 5 Hours Ago
Posted 6 Days Ago
660 posts
5 Years
EDIT 2: Also, changing the colors in customizable options doesn't work. I think this has something to do with this section of code (in def update) using the values originally defined in the customizable options section instead of the variable names (it worked when I replaced them:
<code>
I was literally fixing the Customizable Options when you posted this.

The script has been updated to v1.5.
Male
Seen 5 Days Ago
Posted 4 Weeks Ago
279 posts
3.4 Years
I found a couple more problems. At first I thought it was something that I changed about the script, but found the same problems when I put the unchanged (v1.5) code into default essentials 17.2. I took a couple of screen captures that show these problems. Firstly, it seems that non-damaging moves are still bolded for STAB if they match the user's type. Also, as shown with the Kadabra, Absorb (and all grass moves to my experience) displays as though it should be normally effective even though both opponents resist Grass. Another thing I realized was that Sky Drop doesn't seem to display type effectiveness, though it will be bolded for STAB.

EDIT: Note that Absorb correctly displays type-effectiveness in single battles.

Golisopod User

he/him
Alola Reigon
Seen 5 Hours Ago
Posted 6 Days Ago
660 posts
5 Years
I found a couple more problems. Firstly, it seems that non-damaging moves are still bolded for STAB if they match the user's type.
That's an oversight on my part. It should be fixed in the next update.

Also, as shown with the Kadabra, Absorb (and all grass moves to my experience) displays as though it should be normally effective even though both opponents resist Grass. Another thing I realized was that Sky Drop doesn't seem to display type effectiveness, though it will be bolded for STAB.

EDIT: Note that Absorb correctly displays type-effectiveness in single battles.
I just need to mention that the script behaves super weird in Double Battles. There aren't any crashes as such, just that the highlighting may be a little weird at times. I am working on fixing that though. (should be fixed in v2.0)
Male
Seen 5 Days Ago
Posted 4 Weeks Ago
279 posts
3.4 Years
There's 1 thing I noticed in double battles that is small, but probably easily addressed, as shown in the attached video. For some reason, the type effectiveness of the Pokemon initially selected doesn't seem to work properly, though hovering off it and back on fixes the problem (I have green for super-effective and yellow for not-very-effective). Perhaps there's an odd interaction with the move slot and Pokemon index? Confusion is in move slot 3 with Togekiss in battler index 3 (I think), while Photon Geyser is in move slot 2 with Gardevoir in battler index 2. This also matches up with Accelerock as also shown, as it's in move slot 3 which corresponds with Togekiss (therefore showing super-effective). I think the initial target battler index is always 1 unless it's like Acupressure and targets only the user or partner.

This is consistent with your video as well, though it's harder to see:
Genesect's Magnet Bomb is in move slot 3, while Genesect itself is also at index 3 (resisted against both Blaziken and Genesect)
Genesect's Aerilate Body Slam is in move slot 1, while Blaziken is also at index 1
Arceus' Judgment is in move slot 0, while Arceus itself is also at index 0 (resisted against both Arceus and Blaziken)

Maybe this is what you were talking about in the minor errors section, but this information could possibly help? I couldn't find out where this would be happening in the script, but if there's a simple fix, do you think you could point it out to me? I would rather not have to replace everything when the next version of this code comes out.
Seen February 22nd, 2021
Posted November 14th, 2020
12 posts
2.1 Years
I know i'm still on v17 of essential, but I have this error message when I load the move pages in battle.

Exception: NoMethodError
Message: undefined method `pbType' for nil:NilClass
Moves Highlighting:964:in `moveTextCalc'
Moves Highlighting:918:in `drawPageTwo'
Moves Highlighting:913:in `each'
Moves Highlighting:913:in `drawPageTwo'
Moves Highlighting:1156:in `pbScene'
Moves Highlighting:1118:in `loop'
Moves Highlighting:1159:in `pbScene'
Moves Highlighting:1174:in `pbStartScreen'
Moves Highlighting:697:in `pbBattleSummary'
Moves Highlighting:627:in `pbSwitch'

Golisopod User

he/him
Alola Reigon
Seen 5 Hours Ago
Posted 6 Days Ago
660 posts
5 Years
I know i'm still on v17 of essential, but I have this error message when I load the move pages in battle.

Exception: NoMethodError
Message: undefined method `pbType' for nil:NilClass
Moves Highlighting:964:in `moveTextCalc'
Moves Highlighting:918:in `drawPageTwo'
Moves Highlighting:913:in `each'
Moves Highlighting:913:in `drawPageTwo'
Moves Highlighting:1156:in `pbScene'
Moves Highlighting:1118:in `loop'
Moves Highlighting:1159:in `pbScene'
Moves Highlighting:1174:in `pbStartScreen'
Moves Highlighting:697:in `pbBattleSummary'
Moves Highlighting:627:in `pbSwitch'
That's a derp on my part. There is a small change that is to be made to PokeBattle_Battler that I forgot to include in the script. I'm sorry for the inconvenience. I'll be posting an update today. Please update your script when I post it. Till then I'd request if you didn't use the new summary screen.

Golisopod User

he/him
Alola Reigon
Seen 5 Hours Ago
Posted 6 Days Ago
660 posts
5 Years

I don't know if this breaks the rules about spam posting but I needed the people who downloaded v3.0 of the script to uptdae to this version so...

v3.1 Update!
Fixes a small issue with the new Summary Screen. A small update to PokeBattle_Battler was required for the Summary Screen to function. It didn't mess with any battle testing I did so it shouldn't cause any issues
Seen February 22nd, 2021
Posted November 14th, 2020
12 posts
2.1 Years
Or not, if my team is not full, i get this error message.

Exception: NoMethodError
Message: undefined method `egg?' for nil:NilClass
Moves Highlighting:1185:in `pbInitDummyPokemon'
Moves Highlighting:735:in `pbStartScene'
Moves Highlighting:733:in `each'
Moves Highlighting:733:in `pbStartScene'
Moves Highlighting:1173:in `pbStartScreen'
Moves Highlighting:697:in `pbBattleSummary'
Moves Highlighting:627:in `pbSwitch'
Moves Highlighting:602:in `loop'
Moves Highlighting:641:in `pbSwitch'
PokeBattle_Battle:1415:in `pbSwitchPlayer'

Golisopod User

he/him
Alola Reigon
Seen 5 Hours Ago
Posted 6 Days Ago
660 posts
5 Years
Or not, if my team is not full, i get this error message.

Exception: NoMethodError
Message: undefined method `egg?' for nil:NilClass
Moves Highlighting:1185:in `pbInitDummyPokemon'
Moves Highlighting:735:in `pbStartScene'
Moves Highlighting:733:in `each'
Moves Highlighting:733:in `pbStartScene'
Moves Highlighting:1173:in `pbStartScreen'
Moves Highlighting:697:in `pbBattleSummary'
Moves Highlighting:627:in `pbSwitch'
Moves Highlighting:602:in `loop'
Moves Highlighting:641:in `pbSwitch'
PokeBattle_Battle:1415:in `pbSwitchPlayer'
Thanks for reporting this bug. I'll try to fix as soon as possible.
Seen 4 Hours Ago
Posted 18 Hours Ago
426 posts
4.8 Years
Super cool script, something that stands out for me is the correct type for HP, judgement etc.

how compatible (minus the type effectiveness i'd say, as its in there) is it to add to ebs? guessing you've not tested but surely it could be done, and if not the new menu stab etc. but the correct type displayment would be great to add ^^

Golisopod User

he/him
Alola Reigon
Seen 5 Hours Ago
Posted 6 Days Ago
660 posts
5 Years
Super cool script, something that stands out for me is the correct type for HP, judgement etc.

how compatible (minus the type effectiveness i'd say, as its in there) is it to add to ebs? guessing you've not tested but surely it could be done, and if not the new menu stab etc. but the correct type displayment would be great to add ^^
I'm sure its doable. But I personally don't use the EBS so I don't plan on supporting it. I don't mind looking into it in the future though.
Seen 4 Hours Ago
Posted 18 Hours Ago
426 posts
4.8 Years
All fine, im sure the stab and new summary stuff is easy (As summary isnt even ebs really and ebs use move.type)

from what i see of the code, while im not sure WHY it fixes stuff, its movetype right? and it just replaces move[i].type ?

EDIT: got it working :O barely had to change how it worked either; tested with normalize on zangoose and yea, (unless it always shows normal rn but xP

Golisopod User

he/him
Alola Reigon
Seen 5 Hours Ago
Posted 6 Days Ago
660 posts
5 Years
EDIT: got it working :O barely had to change how it worked either; tested with normalize on zangoose and yea, (unless it always shows normal rn but xP

O.o Nice. Can you PM the code with me. I wouldn't mind putting it in the Main post.
Male
Seen 5 Days Ago
Posted 4 Weeks Ago
279 posts
3.4 Years
One really small suggestion. In the official games (at least in SM I haven't played SwSh lol), the effectiveness is initially displayed as the greater of the 2 effectivenesses on the opponents, but it's coded here as the average of the 2. This makes it a little odd especially if one opponent is immune to the attack and the other is normally affected by it (displays as not-very-effective before clicking on the move).
Basically what I'm recommending is changing
typemod=(moves[i].effectiveness(moveType,battler,opp)+ moves[i].effectiveness(moveType,battler,opp.pbPartner))*0.5
to
typemod=[moves[i].effectiveness(moveType,battler,opp),moves[i].effectiveness(moveType,battler,opp.pbPartner)].max