LegoFigure11 / RaidCrawler

Raid Viewer for Pokémon Scarlet and Violet
GNU General Public License v3.0
166 stars 58 forks source link

Wrong sprites- discord webhook posts #117

Closed swimmy08 closed 1 year ago

swimmy08 commented 1 year ago

Describe the bug I use the discord webhook feature. Since the major update, sprites have been consistently wrong on the discord posts that pop up when a match is found. Everything else is working normally, and the sprite I see on raid crawler is correct.

Screenshots Screenshot 2023-01-24 091040

lfmundim commented 1 year ago

I believe that uses PkHeX integration, it's probably a bug on their side rather

when generating the webhook payload here https://github.com/LegoFigure11/RaidCrawler/blob/e6422d4132e2e2c33b0770c2308cbfc7f9fbd3a3/Structures/NotificationHandler.cs#L57

RaidCrawler gets the ID for the sprite from the PkHeX library https://github.com/LegoFigure11/RaidCrawler/blob/e6422d4132e2e2c33b0770c2308cbfc7f9fbd3a3/Structures/NotificationHandler.cs#L80

which is then fed, again, into PkHex: https://github.com/LegoFigure11/RaidCrawler/blob/e6422d4132e2e2c33b0770c2308cbfc7f9fbd3a3/Structures/NotificationHandler.cs#L101

how is PkHeX getting the sprite wrong I don't understand, as the code is very straightforward https://github.com/kwsch/PKHeX/blob/6a093113949c4d43af82b3b5026d35bd37e9bea5/PKHeX.Drawing.PokeSprite/Util/SpriteName.cs#L24

If the next time this happens you can provide a screenshot of the RaidCrawler UI it might be helpful to pinpoint what is going on, but so far it points to PkHeX

jnovack commented 1 year ago

I've seen quite a number of these, the GUI is correct with the Sprite (both in normal view, and the super awesome experimental view), it's only the webhook (which loads the file from the github repo) which is incorrect.

I think it has to do with the raid Pokemon numbers are not consistent with National Dex numbers. There really needs to be a translation table. And, if we're going through all the effort of making a translation table, I think the spirtes are way too ugly to be in a webhook and you might as well use better graphics since you are on the internet anyway.

You tell me what looks better:

image image
lfmundim commented 1 year ago

To make quick work we might use a public base such as serebii

// need to append a 0 to the left of the number if <3 digits
url = $"https://www.serebii.net/scarletviolet/pokemon/new/{encounter.Species}.png"

Might be a temporary patch until a table is build

jnovack commented 1 year ago

I'd rather do it once, and do it right. But the issue here is that at some point, the raid numbers get out of sync with the national dex. Grafaiai is 969 in the raid encounter tables, but 940 in the National Dex.

So, using things like serebii (is hotlinking permitted?) we need to pass 940, not 969. Also, Serebii does have a Shiny nomenclature and form nomenclature.

If PKHex returns national dex number (I think it does), that's easy. But will need a lookup table for other forms.

Eevee

Tatsugiri

Land Vezula (Tauros)

On a side-note, why do other sites know Grafaiai as 969? If you google that, it has results. Meaning that there is some sort of other numbering system.

LegoFigure11 commented 1 year ago

Closed by acad255