Hi all;
I am having issues with using the Refresh Counters option in the game window. Regardless what settings I use, all decks disappear and are unusable. There are 3 Decks with 3 Discard Decks. This does not seem to be happening with other modules. Any ideas where I should start looking? I was trying this out to see if I could add Module changes to a previous Save Game, it was not a good idea.
After some experimenting I noticed that cards in the Discard Decks remained and were still usable.
The Decks appeared again after being reshuffled…however…
I can no longer click on each deck to draw/place a card.
To explain, I have an invisible piece which is actually under (I think) each deck so that when I tap on the Deck with a left Mouse click a new card is drawn and placed on the board while the other cards in play move one space from the issuing Deck. So it seems that using refresh is doing something to these 3 invisible pieces (one for each Deck) so that it no longer works. Not a big deal? Yes it is! A lot of time has been spent to get this working and my concern is that if this problem occurs with Save Games there will also be issues with refreshing Pre-defined setups which means a lot more work for me when performing maintenance when this is available for download. Imagine my reluctance upload this module.
I can confirm this is the case, the Pieces used as push buttons for the Decks are disabled by the using the Pre-defined refresh in the Editor. I have 3 options now…
Don’t use Pre-defined Setups and have all options available in-game (more complicated - more time)
Remove the push button feature entirely which is weeks of work down the drain.
A Vassal Guru has an idea? I can make this module available for download if need be if someone wants to have a look.
Maybe 4. The problem might be with the invisible button being under the Deck. There is a Layer defined for the button but not for the Deck, no idea what level the Deck is but it must be higher than all other Pieces in the module. So I will try moving the buttons somewhere next to the Decks which will mean I now have to make a bigger board. Hopefully it will not alter the Location of the At-Start-stacks. Grrrrrrr!!
Right…so it looks like I have answered my own question and problem solved. Moving the Draw Buttons out from under the Deck and making them visible works. Refresh Counters does it’s thing and all remains functional. The moral of the story is don’t have a piece under a Deck but what I don’t know is if this could be classed as a bug or not.
I put buttons beneath decks all the time, but my purpose is different from yours. In my usage, when the deck is out of cards, one can now see a “reshuffle” button. I press it, and the deck is rebuilt from the discards. If cards are atop the button, then the button is inactive. I have never seen behavior as you describe. In fact, I don’t know how you ever got your behavior to happen.
A few points on my use:
The button is on my bottom-most map layer, and the cards are in a layer above it. I don’t know if this is relevant.
I never refresh pieces because I don’t trust it. If it comes to it, I’d rather just rebuild a scenario from scratch.
My use works only if I set up the button in an at-start stack. If I try to otherwise move it to beneath the deck, the deck gobbles it up instead.
Now if the button is invisible (mine aren’t), and the deck allows anything to enter it, and the deck does not auto-shuffle so anything put on the deck occupies the top slot, then the deck will use the top piece to render itself. If the top piece has no image, then the deck will appear to be gone. The top invisible piece hides it. It’s still there, but it’s become invisible.
My guess is that when you refresh pieces, your below deck buttons are losing a part of their at-start status, so they are joining the deck. Bug? Since the way I use it as a re-shuffle button is undocumented, I can’t see it as a bug.
Maybe that would explain why you have never seen this behaviour.
Do you know what Layer the Deck is? I don’t believe it is possible to have a Piece above the Deck, the Deck must be the “highest” Piece in the Vassal Module.
I am pretty sure you could still unintentionally press that button and reshuffle the Deck even if there is a full Deck above the button.
I don’t know where a deck sits with regard to map layers. Maybe it sits at the top, but then your application would never have worked. I think it’s possible that Vassal renders it where its pieces are. In my case, the cards are at a “cards” level, which is well above where I put the button. I have never tried swapping their positions because I have no application for it. What I’m more curious about is where do pieces go if they aren’t assigned a map layer? Someone who digs through the code would have to answer these questions.
I am quite confident though that my under-deck buttons will work unconditionally. I’ve used the technique countless times without fail. To suggest it might fail occasionally would suggest a race condition, and this is not a situation for that kind of problem.
I don’t know the answer about how a deck is drawn relative to defined Game Piece Layers, but at least with regard to pieces that are not in decks, we know from the GPL documentation that pieces not assigned to any GPL draw above all pieces that belong to GPLs.
I have returned here after a long hiatus because I discovered that I was very wrong about my belief. I (confidently) thought that if I put a button under a deck, then cards in the deck would block access to the button. The only time I could press the button to do something is if I removed all cards from the deck, which exposed the button. I would have bet money on this being true. Tonight I discovered that I was wrong, wrong, wrong. You could have knocked me over with a feather.
The reason I think I missed this until now is because when I draw a card from a deck, I click, hold down, and drag. This won’t press the button. However, if I clicked on the center of the deck where the button was, it would activate/press the button. Wow. I never actually just click on a deck because normally it’s pointless. Again, wow and oops. Fortunately, all my recent vmods are private, so I’m the only person affected, but still.
It was easy to fix. I added to the button a “restrict command” trait that disabled the button if Deck_numPieces > 0. I’m sorry if I led anyone astray.
That is very interesting to know and may help someone.
For example, I recall a request to make decks respond to left-click. Your discovery might offer a workaround to simulate that with existing Vassal.
[Update] I can’t get this to work myself. It still looks to me as if the Vassal deck over-rides anything one might do with Game Piece Layers, Action Buttons etc.
Now I’m curious. I spent time fussing with deck options and card traits to see if anything blocked the button. I didn’t find anything. I think I’ll look to my other modules to see if I can find anything. Maybe I can make a test module, and we can share it. Let me know if you discover anything.
Did you try changing the order of the Deck and At-Start Stack with the button in the map definition? I would assume that both end up in the default, top-most Game Piece Layer, and so which one ends up on “top” is entirely dependent on the order in which they are defined.
I used map layers. I put the button beneath the cards in the deck with respect to the layers. That is, “bottom” is at the bottom, and “cards” is above it. I have not tried rearrange button and deck is the editor listing, so maybe there is something there.
I have been having dropbox problems on one computer, so hopefully the link is meaningful.
If you click on the center of the deck, you should see “Hello!” in the chat window. All the button does is issue a report. And don’t click and hold. Click and release. I put a restrict-command trait in the button, which disables it if there are cards in the deck, but I disabled the trait for the test. Let me know how it goes.
Okay, so I tried swapping the order of the button and the deck in the in the vmod’s editor list (whatever it’s called), and it made no difference. The only traits the button has is Layer=bottom, no stacking (or movement), and an action button trait that triggers the report.
The deck has 3 cards with no special deck characteristics (face down, draw face up, shuffle always). Each card has Layer=cards.
The demo helped me see the Action Button working. I have also been able to test the same in my own module. What I couldn’t get working is the “Left Click” context menu feature of the Action Button trait.
Obviously, Vassal has to prioritise a deck’s Right-Click menu over that of a piece. So maybe this is why an Action Button left-click context menu won’t appear either.
I can see now that this is a separate topic, building on an existing request to add Left-Click context menu ability to Decks or allow an Action Button left-click menu to operate within a deck area.