Card drawing and duplication bug

World Deck has a global key command “worlddraw” which is limited to 1 card.

Two types of card,

1st type has

Trigger action worlddraw
increment
taketohand
reveal
check

increment increases a Global Property CardsDrawn by 1
taketohand sends the card to player hand
reveal flips card face up
check hits a trigger drawagain if CardsDrawn<3 or stopdraw if CardsDrawn==3

drawagain sends the GKC worlddraw to 1 card in the World deck
stopdraw generates a report, resets CardsDrawn to 0

2nd card type

Trigger action worlddraw
taketohand
reportdraw
increment
reveal

taketohand sends the card to player hand
reportdraw reports
increment sets a GP and GKC to move another token on the board
reveal flips the card face up and sets CardsDrawn to 0

This all works fine, most of the time. Sometimes, like after a player has viewed 3 logs, or after I have gone through 3 turns using different PlayerSides, the Deck GKC causes the same card to be duplicated in a player hand or another card on the board to be duplicated in the player hand. There are no Clone or Place Marker Traits.

When playing back a log created by a player for whom this bug occurs, the log does not show the duplication occurring. If the “duplicate” card is dragged anywhere other than where it exists for other players, other players see the original card move from where it should be, and no duplicate.

I haven’t really got a handle on this bug, or what it means or how it happens or is triggered. Anyone have any insight?

(I’m thinking the best fix might be to simply have the Deck GKC draw one card and be done, rather than try and get one click to draw up to 3, but that’s a step back I’d rather not take unless I have to.)

If anyone is curious, the module is here: drive.google.com/file/d/1n3bNyh … sp=sharing

But as mentioned above, reproducing the bug is not easy.

Your symptoms sounds similar to bug 13497 that occasionally affects users of C&C Napoleonics v3.4x, though I haven’t any reports of that one in v3.5.5 it is early days:

Some questions that might help with matching the bug to 13497:

  1. What do players see in the Card Inventory?

  2. What happens if one or other of the players Discard one of these rogue duplicates? Does everyone see the same thing on the board? Does anyone see the same card duplicated in the Discard pile (using “Draw Specific Card”) ?

  3. What is the affect of UnDo, when you spot the bug ?

Mark

  1. There’s no inventory that helps right now.

  2. Other players, viewing a log, see the original card move. The player seeing the duplicate has taken to placing it “on top of” the existing card, wherever it might be. No one else sees a duplication occur, if I understand correctly. In effect, we only know that the player who saw the bug experienced it through a) a screenshot and b) the fact that the command to draw 3 cards didn’t actually draw 3 cards for them.

  3. Undo seemed to undo correctly the one time it happened to me.

Looking at the other report, it may be worth emphasizing that this also happened to me offline, on my machine alone, from a fresh start with no outside inputs.

Seems like a different issue then, as I only ever heard of the other one occurring in online games and the duplication is not the same.

OK, so it might be a common bug, might be uncommon, no-one knows what triggers it, it can’t be reliably reproduced, can’t be viewed in a log, and undo appears to “fix” it. It is definitely still a problem in my module though, and the fact that it’s a Vassal bug rather than a module bug doesn’t make it any better.

My question to you all is:

How can I achieve the same effect in a different way, and thereby hopefully avoid the bug?

The aim is draw up to X cards, but stop drawing if a specific card type is drawn. One command.

“The aim is draw up to X cards, but stop drawing if a specific card type is drawn. One command.”

Have you tried putting the termination condition in the GKC itself and set the GKC to draw the max possible number (except it won’t because it will refuse to draw any more once the termination condition is reached)?

e.g if the LastCardType is stored triggered off a card draw, that condition is checked in the GKC. Depending on what the maximum draw is set to, this idea might not be feasible on performance grounds but I found for 6 cards, no difference with a trigger loop.

Mark

Let me see if I’ve got this straight:

Using a deck GKC, the only conditions I can add are “Matching expression” and “Affects”. You are saying I can set Affects to 3 instead of 1 by some manipulation of the Matching expression.

The GKC sends a targeted card to the desired location, but only if a Global Property VisionDrawn is false. If a Vision card is targeted, the card will also set VisionDrawn to true, and this can prevent the other 1 or 2 “affected” cards from being drawn?

I didn’t think Matching Expression could be used in that way, but it would simplify things considerably.

A potential problem is that VisionsDrawn is now true, and I can’t think of a good trigger to set it to false again. Maybe I could make all other card movement to Main Map reset the GP.

Have I got that correct?

Thanks! Seems to be working well, and if it has quashed the bug, I’ll be very happy.