Closed Messoras closed 1 year ago
Hi! Thanks for the time to bring this issue.
I did not noticed this since my decks usually don't run tokens. I assumed the YGOPRODeck endpoint with no filters would return all cards, but it seems its not the case.
I'm seeing if there is a simple way to add it to do this but it seems I will have to hardcode all card types for it to get tokens.
If this is necessary I will probably add a /tokens
command and add it to /all
, since tokens are technically not cards.
@Messoras
Ok, so I checked a bit and seems that /allcards
downloads tokens without errors.
I downloaded v2.1 and run '/allcards' on an empty pics
folder and trackers. All 12723 cards returned by the YGOPRODeck API were downloaded, including the 107 tokens.
So it is not an issue with all tokens and, maybe, is an issue with your current machine or configuration.
If the game happens to have more than 107 tokens and they are not returned by the API I don't see a reason for they to be downloaded if manually put into a decklist.
So,
I had no card pics at all and ran the "/all" command, which includes the "/allcards" command, but when I played some random duels vs AI, I realized that none of the tokens were downloaded. Explicitely the "Primal Being Token", the "Adventurer Token" and 2 different versions of the "Mecha Phantom Beast Token". All other cards were downloaded successfully, so I doubt that an anti-virus software blocks the specific download of tokens. Anyhow a "/tokens" command would be very useful so you could just download your deck and the tokens instead of spending alot of time and bandwidth on downloading all cards at once. I actually branched the project and made a draft. I will create a pull request for that.
Okay I think I might have located a possible source of error. When looking through the ygoprodeck Card Database filtering for tokens, there is exactly 1 Mecha Phantom Beast Token, with the ID of 904186. This corresponds to none of the following constants in the EDOPro constant.lua file, nor to any of the explicitely called ids in the scripts of Mecha Phantom Beast cards.
31533705 | TOKEN_MECHA_PHANTOM_BEAST 22110648 | TOKEN_MECHA_PHANTOM_BEAST_DRACOSSACK 20368764 | TOKEN_MECHA_PHANTOM_BEAST_HARRLIARD 67922703 | TOKEN_MECHA_PHANTOM_BEAST_TETHERWOLF
So it seems like EDOPro just doesn't use official tokens for some of the cards which makes the exact assignment of ids to token artworks very difficult.
I recently found that the "/allcards" option doesn't download tokens. I found the type parameter "Tokens" in the ygoprodeck API and wanted to include a branch to include a "/alltokens" command, but looking at the api calls for existing commands, I think the "get_all_cards" call should already include them, but it doesn't work. On the other hand, manually adding tokens to a decklist and downloading it does work. I'm not an expert in python and never used the ygoprodeck API before, so I thought submitting this as issue might be a good idea.
Greets, Messoras