Discarding Cards Directly From a Draw Deck to a Discard Pile

I have found a dozen posts which almost address this problem, but none that quite solved it. I need to send cards from the top of a draw deck (although since I have Always Shuffle on, the position isn’t critical) to a discard pile. I have a completely-functional Return to Deck feature as a Trait of the cards already, but of course it only functions after they are moved to the map board; I would like to be able to discard them directly from the draw deck. I tried installing a Deck Global Key Command, and it did add a right-clickable menu item (which did correctly report its activity to the log window), but no card appeared in the discard pile.
To further compound my misery, I realized that every card that I drew was now the same card (the first card in the deck folder). This problem has persisted even though I have deleted the Deck Global Key Command. I have no idea how to fix it (as I have no idea how it broke).

The first part is probably a trait order issue. Make sure the Return to Deck trait is listed after (below) the Mask trait in the same trait window. If it’s not that, re-check the gkc being sent to the cards itself.

The second part… do you mean the deck stopped auto-shuffling? There’s nothing in a deck gkc that would alter that (aside from matching properties). Did you ever solve your prototype bug? I can’t help but compare the two. I guess I’d suggest fixing the deck gkc part above first, then if the same card keeps being drawn, switch the deck to right-click shuffle instead, run that a couple times to make sure that works properly, then try going back to always shuffle. Good luck.

The problem is worse than that. I removed the GKC from the deck (which was the only change I had made to the deck) and it did not restore auto-shuffler functionality – I cannot at this time see any reason for its current behavior. It is as if my attempt to add a Deck GKC “broke” something hidden, and because it is hidden I cannot find it to fix it.
I had stopped trying to solve the prototype problem since not using the prototype worked, but you may be correct about the link. I currently suspect that something about the original deck creation event corrupted the module in an invisible way and what needs to be done is a scratch rebuild (which hopefully won’t be too painful since I presumably now know what I am doing). I wish I knew what caused the error or corruption, though, so I can avoid repeating it.

I should add that the problem is not just with auto-shuffle, since that alone could not cause the existence of multiple copies of a card which appears once in the deck. Whatever is wrong is allowing the deck to draw multiple instances of the same card. I’m not sure I could make VASSAL do that if I tried…

So at this point I would like to sort of merge this issue with my previous post thread ([url]https://forum.vassalengine.org/t/deck-behavior-unexpected-and-non-responsive/8797/1]). I rebuilt the module from scratch, using the Prototype that was abandoned (per previous thread) and all of the other commands exactly as before but leaving GKCs alone. The rebuilt module works exactly as it did before my attempt to achieve deck-to-discard functionality broke it; evidently the Prototype, which seemed to be at fault before, was not the root cause of the original deck failure.
Interestingly, the new module is less than half the size of the old module was (despite appearing to have the same number of image files), even before I attempted to add GKCs to the old module. It would seem that there was indeed some sort of file or directory corruption; I have retained the old module if it becomes of interest to anyone.
I intend to make a test copy of the new module for GKC tinkering; I will report anything that seems helpful.