• The moderator of this forum is jetou.
  • Welcome to Smogon! Take a moment to read the Introduction to Smogon for a run-down on everything Smogon, and make sure you take some time to read the global rules.

Programming Showdex - An Auto-Updating Damage Calculator Built into Showdown!

Feature request:

Can we get a native calculator within calcdex without opening a battle?
Because of the new calculator update we cant see megas unless we turn it to S/M and even then we then cant see other gens past S/M.

So getting a native calculator to open and use with ease would be good.

Thanks for the request! That's actually something we've been meaning to do at one point, but haven't gotten around to it yet.

As for not being able to see Mega formes, can you click on the Pokémon's icon/name (depending on your Swap Icon/Name Behavior Calcdex setting, with clicking on the name as the default if you haven't changed it) and see if the Pokémon's Mega forme appears in the tooltip? (See the screenshot below, which is from a Gen 9 Randoms battle that went on today.)

SCR-20230408-oa4.png


The Calcdex shouldn't prevent you from selecting Mega formes (even G-Max formes, for that matter) in gens & formats that don't have Mega Evos available, like in Gen 9 Randoms, so as long as the Pokémon has those formes to begin with.
 
I have a few suggestions:
1. Automatically update items every turn in random battle.
Eg Buzzwole deals Choice Band damage, but Showdex doesn't update and still shows as Choice Scarf. It should update the damage and show as Choice Band.
Similarly, if Guzzlord deals Choice Specs damage, it should be updated instead of AV.

2. Should be able to turn off DMax mode, when the opponent is DMax.
I want to know if my Pokemon can get revenge kill if the opponent doesn't DMax. However, once the Pokemon has DMax, it cannot be turned off.

Heya! Thanks for the great suggestions! c:
  1. Choice items aren't revealed in battle by Showdown, so we don't update the item that was filled in by you or the applied set (Showdown reports the Pokémon's item as blank, which you can confirm by the nonexistent "Item:" line in the Pokémon's tooltip). Many people have suggested this (even some suggesting we guess the Pokémon's spread based on the outputted damages), which is all in the realm of possibility, but we ultimately decided not to implement this to keep Showdex competitively viable. We don't want it to be considered a "cheat tool" & therefore banned—especially in tourneys. (By the same token, we also hope that you devs out there don't implement this yourselves cause that'd make us look really bad! :c) We believe players should rely on their game sense to figure out that the Pokémon is Choiced. Sorry about that, hope you can understand!
    • However, other items, like Leftovers & Life Orb, will be automatically updated in the Calcdex once revealed in battle (since Showdown reports these items in the Pokémon's tooltip, we consider that fair game & will sync it for you).
  2. Will definitely add that as a setting for v1.1.5! What you're describing is the same problem with Tera, where once D-/G-Max'd, the toggle is disabled. This was a "feature" (looking more like a bug now lmao) we added back in v1.1.3 to help players remember if the Pokémon Max'd/Tera'd or whether their opponent used their one Max/Tera (i.e., if the toggle is enabled, your opponent hasn't used their Max/Tera yet). The toggle will re-enable once the battle ends, but I can understand the use case of toggling it off during a battle as well.
    • Also now that I'm thinking about it, I'll leave that setting off by default, so you should be able to toggle Max/Tera to your heart's content (so no need to fiddle with the settings when you eventually get the v1.1.5 update).
    • Could alternatively provide some kind of indication that your opponent used their Max/Tera for the battle too, without disabling the toggle altogether. I'll think about this one a bit.
 
Thanks for the request! That's actually something we've been meaning to do at one point, but haven't gotten around to it yet.

As for not being able to see Mega formes, can you click on the Pokémon's icon/name (depending on your Swap Icon/Name Behavior Calcdex setting, with clicking on the name as the default if you haven't changed it) and see if the Pokémon's Mega forme appears in the tooltip? (See the screenshot below, which is from a Gen 9 Randoms battle that went on today.)

View attachment 506385

The Calcdex shouldn't prevent you from selecting Mega formes (even G-Max formes, for that matter) in gens & formats that don't have Mega Evos available, like in Gen 9 Randoms, so as long as the Pokémon has those formes to begin with.

Yeah I know that much about the calcdex function. I was referring to the native pokemon showdown calc.
1681076649223.png


Right here it shows that there is no set for Mega Lopunny in Generation 9. There used to be an option for it up until get 9 updated for the calculator. This is the same for if I click S/S in this gen of the calculator as well.
And then As i said before, If i want to check Mega Lopunny Vs. lets say, Great Tusk, I would have to import a set into the calc since it doesnt show natively those two mons existing at the same time.
1681076865128.png


Example there for ya in that scenario.

Thats why having a native calc in Calcdex built in would be helpful.
 
Yeah I know that much about the calcdex function. I was referring to the native pokemon showdown calc. View attachment 506577

Right here it shows that there is no set for Mega Lopunny in Generation 9. There used to be an option for it up until get 9 updated for the calculator. This is the same for if I click S/S in this gen of the calculator as well.
And then As i said before, If i want to check Mega Lopunny Vs. lets say, Great Tusk, I would have to import a set into the calc since it doesnt show natively those two mons existing at the same time.
View attachment 506578

Example there for ya in that scenario.

Thats why having a native calc in Calcdex built in would be helpful.

Ah, oopsies. Sorry, misunderstood which calc you were talking about. Was quick to think that the forme switcher in the Calcdex broke hahaha. I understand your use case now, and I'll add it to our list of planned features.

Thanks for clarifying!
 
Patch 1.1.5 is out now!
We're back!
Packed in this release is support for Hydro Steam + Psyblade, proper FFA support (finally!), Tera syncing fixes, Calcdex optimizations to address some lag, other bug fixes & more! You can read the full patch notes here.
(Actually, not really, that's about it LOL ¯\(ツ)/¯)
We appreciate you all for your patience during these past couple of silent months & as always, we hope you enjoy! <3
  • Added Calcdex setting: Lock Terastallization After Use
    • If enabled (off by default), the Tera toggle button in the Moves table will disable once used by the player.
    • Once the battle ends, the toggle button will be re-enabled again.
    • This may be a helpful indication of whether a player can still Terastallize during the battle.
  • Added player's Max/Tera availability status in the Max/Tera toggle button tooltips.
  • Removed Hellodex footer buttons that link to specific pages on the GitHub.
  • Fixed Z toggle button appearing in Gen 6 formats.
  • Fixed the Max toggle button in the Moves table disabling once used.
    • Turns out this was more of a bug than a feature... oops.
  • Fixed player selector not appearing in FFA modes when playing.
  • Fixed incorrect SPD boost for Rock types during Sandstorm in Gen 3 formats.
    • This was purely visual (in the Pokémon's stats) & didn't affect the resulting damages.
  • Fixed base power of Last Respects dropping to 60 (w/ fainted allies) when Terastallized.
  • Fixed the "Copied!" badge not immediately appearing after clicking a damage range.
  • Fixed the Tera toggle button toggling off after a battle sync if the Pokémon had a nickname.
  • Fixed some of the lag. Maybe. Hopefully :)
    • This will hopefully improve the performance and result in less visual lag, especially when you have a lot of tabs open at once or a lot of Calcdex battles in memory (this would be the case if the “Clear Memory After Tab Closes” setting is off)
We wanted to get this bug patch out quick while we work on a newer more exciting feature update for the next patch. Stay tuned and thank you for the support and feedback. Also we just made a Discord for Showdex, check it out if you’re interested :) till next time!
 
Last edited:
Zamazenta automatically +1 when switch in, and Showdex shows Def as +1.

This is not correct.
+1 Def on Dauntless Shield will make Zamazenta +2.

1682519379210.png


As in this match, I made a mistake and thought that Cinderace was the Choice Band, because it did 29.4% damage.
 
In my battle, I thought Gengar had Explosion because the Showdex calc claimed it ([Gen 1] Random Battle). But when switching to gengar, he had Night Shade, not Explosion.

Pvz9vHN.png
 
In my battle, I thought Gengar had Explosion because the Showdex calc claimed it ([Gen 1] Random Battle). But when switching to gengar, he had Night Shade, not Explosion.

Pvz9vHN.png
they aren't guaranteed to have the specific 4 moves listed. Random battles pick moves from a pool of moves. You have to plan accordingly based on that pool.
 
Caldex doesn't accommodate for Protean automatically, and I ended up nearly losing a battle because I thought my Toxicroak would survive an Ice Beam from Greninja. Would it be possible for Calcdex to do so if Protean is still able to activate?
croak.PNG
 
Zamazenta automatically +1 when switch in, and Showdex shows Def as +1.

This is not correct.
+1 Def on Dauntless Shield will make Zamazenta +2.

View attachment 511686

As in this match, I made a mistake and thought that Cinderace was the Choice Band, because it did 29.4% damage.

Sorry about the late response!

Zamazenta receives a +1 DEF boost from the Dauntless Shield ability on switch-in, but I'm not entirely sure where the other +1 DEF boost is coming from before the Dauntless Shield boost (since it's switching in, should initially be at 0 stage boosts for all stats except for HP). Could you clarify that bit? Might be missing something here :smogthink:

From what I know, the O.G damage calc in Gen 8 (from your screenshot) will automatically +1 DEF if you set the ability to Dauntless Shield in order to account for the boost on switch-in (you can confirm by switching its ability to something else, like Defiant). So if you +1 DEF yourself, you'd be actually accounting for the Dauntless Shield boost twice, which could potentially report actual 1HKOs as 2HKOs!

This was actually something I had to patch out for Showdex, actually. The game reports +1 DEF from Dauntless Shield, but the internal calc logic (same one used on the O.G damage calc) also auto +1'd, mistakenly reporting +2 DEF :eeveehide:
 
How do you set it up for iPads?

I was made aware of this today, but the Enhanced Tooltips for Showdown on the App Store (which bundles Showdex alongside other useful extensions, maintained by cbruegg) is supported on iOS apparently.

So you can just install that, go into your Settings app & under Safari > Extensions, enable the Enhanced Tooltips for Showdown as well as allowing the extension on play.pokemonshowdown.com (+ any other sites you'd want, like psim.us; you have to click into them individually to select "Allow" — rather tedious, I know, but that's how Apple does things unfortunately).

There are some issues brought to our attention recently, like not being able to access the Showdex settings, but those were from iPhone users & might be different on your iPad (since you have a bigger screen).

Additionally, since that app isn't maintained by us, we can't officially support that version of Showdex with the latest updates until cbruegg updates it (but we're sincerely grateful he took the time to make it available to the Apple folk; getting an app on the App Store ain't cheap — $100/yr, actually!).

But if you have any other questions, you should contact him directly since I ironically can't get it working on my own iPhone :c
 
In my battle, I thought Gengar had Explosion because the Showdex calc claimed it ([Gen 1] Random Battle). But when switching to gengar, he had Night Shade, not Explosion.

Pvz9vHN.png

Following up on the great point Takatk made, you can see the entire move pool by opening the move's dropdown menu when a Randoms set is applied. You'll see a group of moves under the "POOL" heading (or not, if the Pokémon are only given 4 possible moves!).

Edit: On closer inspection, it appears that the Randoms set is actually being applied to your Pokémon, which shouldn't be the case. There seems to be an issue with syncing Pokémon reported by the server, as someone else recently had a similar issue as well. oof. ok, will be looking into this!
 
Last edited:
Caldex doesn't accommodate for Protean automatically, and I ended up nearly losing a battle because I thought my Toxicroak would survive an Ice Beam from Greninja. Would it be possible for Calcdex to do so if Protean is still able to activate?
View attachment 515466

oof, sorry to hear that, but glad you were able to clutch things out :o

That's actually a bug since syncing type changes (from Protean, Transform, Terastallization, etc.) is one of the core features of the Calcdex. Might be related to this issue previously reported on the GitHub.

But I'll be looking into this for the next upcoming patch. Thanks for your report! c:
 
recently, potential sets for my opponents have not been popping up and have been met with an infinite loading symbol on the set tab. tried various fixes on my end such as uninstalling and reinstalling, restarting my browser but no luck. Been happening across all formats for me as well. Expecting this is still a issue on my end but haven't been able to think of a fix.

1683947622555.png
 
When i'm using the showdex my builder gets weird, the mons loses their nicknames, that is a bit embarassing when you want to send a past of the team or puting nicknames (i'm using chrome)
image.png
 
recently, potential sets for my opponents have not been popping up and have been met with an infinite loading symbol on the set tab. tried various fixes on my end such as uninstalling and reinstalling, restarting my browser but no luck. Been happening across all formats for me as well. Expecting this is still a issue on my end but haven't been able to think of a fix.

View attachment 515891
Oh no, that's not good! Huhhh that's a really weird issue, I haven't seen that before. A few questions:
  1. When does the bug occur? Is it right away at the start of the battle, or randomly at some point in the battle?
  2. Does it happen every battle? Or only sometimes?
  3. What browser are you using?
Also could you go into the settings from the Hellodex and click the "Export" button in the top right and then paste that into a direct message to me? Might be helpful to reference your settings in case something in there is causing a weird interaction.

My initial theory is that it could be a problem where the API fetch requests for the sets are being denied so it can't load the sets. Or that somewhere in the fetching process, it's getting stuck, whether because data isn't available at the time when it should be, or some other interference is getting in the way. I'm sure Keith will know more on that front, but just some ideas.

Sorry to hear that you're experiencing these issues, hopefully we can figure out a way to reproduce or narrow it down on our end (it's always tough to fix a bug if you can't reproduce it).
 
When i'm using the showdex my builder gets weird, the mons loses their nicknames, that is a bit embarassing when you want to send a past of the team or puting nicknames (i'm using chrome)
image.png
Interesting, what the heck! Huh, in the screenshot, it's actually replacing the nicknames with the Pokemon's name, which is bizarre because we don't touch that at all. All we do is read from your Teambuilder data, we don't edit it at all, so I'm quite confused.
Some questions:
  1. Could you give me more context around when the bug happens? Like in the screenshot you sent, was that a team you previously built and then you went back into the teambuilder and it was like that? Did you instead "Export" sets from Calcdex and then import them into teambuilder?
  2. Are you using Calcdex while editing your team in the teambuilder?
  3. Does this happen to all your teams or just some? By the same token, does this bug happen all the time or just sometimes?
  4. If you change the "Include Teambuilder" setting to "Never", does it fix the bug?
    1684198887325.png
If anyone else experienced this bug, do let us know! Since we don't edit or mess with the Teambuilder data, I just want to make sure it's a bug with Showdex and not something else. Thanks for bringing this to our attention, we appreciate it :)
 

Attachments

  • 1684198853140.png
    1684198853140.png
    46.6 KB · Views: 114
Interesting, what the heck! Huh, in the screenshot, it's actually replacing the nicknames with the Pokemon's name, which is bizarre because we don't touch that at all. All we do is read from your Teambuilder data, we don't edit it at all, so I'm quite confused.
Some questions:
  1. Could you give me more context around when the bug happens? Like in the screenshot you sent, was that a team you previously built and then you went back into the teambuilder and it was like that? Did you instead "Export" sets from Calcdex and then import them into teambuilder?
  2. Are you using Calcdex while editing your team in the teambuilder?
  3. Does this happen to all your teams or just some? By the same token, does this bug happen all the time or just sometimes?
  4. If you change the "Include Teambuilder" setting to "Never", does it fix the bug?
    View attachment 516647
If anyone else experienced this bug, do let us know! Since we don't edit or mess with the Teambuilder data, I just want to make sure it's a bug with Showdex and not something else. Thanks for bringing this to our attention, we appreciate it :)
1. Yea when i build a team / paste smth and go back to the teamlist, to after reclick onto the team it replace all Pokemon's name.
2. No i can't edit my team when calcdex is open cuz the mons aren't mons they are defined as (===) so it's not possible to edit the team, i can copy the move set but i need to replace the (===) by the nick of the mon/ supp the mon and paste the moveset for each mon so it's kinda long, i prefer to just close the calcdex edit the team and reopen it after. But if it's a team in a past, i just need to repaste the team and edit the sets.
3. It happens to all the teams who don't have nicknames, when the mons have nicknames they keep their mon name so the "bug" will not affect the team.
4. It was already setted at the option never so ig it don't fix the bug
1684306795405.png

also i forgot to said it last time but when i want to copy all my entire builder i can't cuz it looks like that
1684306903733.png

I hope that what i said was understandable, english is not my main language
 
I’ve had some issues when laddering with unregistered alts, or to be more precise when joining a game under my main account, and then using /nick into a player.

Sometimes, the calcdex option for my side will be in the down side of the Calc, and can’t be reversed after.

I see two means of fixing this:
Add an option do switch sides of the calc
Automatically set your side in the upper is you /nick, which seems the more natural option and the more practical

(apologies if you don’t get what I say)
 
1. Yea when i build a team / paste smth and go back to the teamlist, to after reclick onto the team it replace all Pokemon's name.
2. No i can't edit my team when calcdex is open cuz the mons aren't mons they are defined as (===) so it's not possible to edit the team, i can copy the move set but i need to replace the (===) by the nick of the mon/ supp the mon and paste the moveset for each mon so it's kinda long, i prefer to just close the calcdex edit the team and reopen it after. But if it's a team in a past, i just need to repaste the team and edit the sets.
3. It happens to all the teams who don't have nicknames, when the mons have nicknames they keep their mon name so the "bug" will not affect the team.
4. It was already setted at the option never so ig it don't fix the bug
View attachment 516975
also i forgot to said it last time but when i want to copy all my entire builder i can't cuz it looks like that
View attachment 516976
I hope that what i said was understandable, english is not my main language

Hmm, on closer inspection, it appears Showdown is failing to read from its internal dex object (e.g., Dex.species.get('Ferrothorn')), which probably explains why the Pokémon field (not nickname) is set to '==' (which strangely enough, is JavaScript's equality operator) & the type is "???".

That's certainly strange since as camboi mentioned, we don't mess with the Teambuilder or even the internal dex object at all (we only use it to read data about a Pokémon, move, etc.). I cannot for the life of me reproduce this issue on my end, including editing an existing team, building a team from scratch, importing one from PokéPaste, etc. (i.e., they all work as intended!).

Do you have any other extensions installed that runs alongside Showdex, perhaps (including Showdown Randbats Tooltip, Adblock Plus, uBlock Origin, etc.)? Also, could you post a dump of your DevTools console?

If you don't know how, here are some quick instructions:
  1. Go into your Teambuilder & let the bug happen again.
  2. Press F12 or right-click on the page & select Inspect.
  3. At the top, click on Console.
  4. Right-click anywhere where the logs are & select Save as...
  5. Browse to somewhere convenient & save the *.log file.
  6. Upload it as a reply or DM me if you're concerned about personal info being in there (though that shouldn't be the case).
Thanks!!

Edit: Also I've noticed that when you go to export your Pokémon, it shows it in the format as what's stored in LocalStorage (basically a modern day cookie), not the expected PokéPaste format. We do actually hook into one of the Teambuilder functions when you make changes to them, but only read the values to update Showdex's internal state & not alter any existing functionality. It's possible that somehow that hook breaks on your end, but again, I cannot reproduce your problem, so I'm just as lost as you are :c
 
Last edited:
I’ve had some issues when laddering with unregistered alts, or to be more precise when joining a game under my main account, and then using /nick into a player.

Sometimes, the calcdex option for my side will be in the down side of the Calc, and can’t be reversed after.

I see two means of fixing this:
Add an option do switch sides of the calc
Automatically set your side in the upper is you /nick, which seems the more natural option and the more practical

(apologies if you don’t get what I say)

Typically if you're spectating a game, you can have the Calcdex switch sides by hitting the "Switch sides" button underneath the battle frame (where the battle controls typically are).

But that's interesting, you're certainly the first I've heard using the /nick command mid-battle. To help me clarify this, say there is "Player A" & "Player B" in a battle, where "Player B" is your unregistered alt & also on the far side (so they appear on the bottom half of the Calcdex). In your Calcdex settings, you have My Location set to "Top". You join the battle as a spectator under your main account "Turtlek" (idk if it is, just an example). Then with your main "Turtlek" account, you use the /nick command & set your name to "Player B".

I'm assuming at this point the Calcdex doesn't realize you're now "Player B" in the battle, so it doesn't correctly respect the My Location setting. (Expected behavior being "Player B" moving to the top half of the Calcdex.) Let me know if I got this right. I'll try testing this out on my end as well (hopefully I'll be able to reproduce the issue you're having!).
 
Back
Top