I just completed my first prototype using Vassal. I am very impressed with the functionality it provides.
I have a deck of cards implemented using the DrawPile and CardSlot elements. If I right-click one of the cards from one of the player hand windows, it indicates “Rake CTRL R”. It then pulls up a dialog to select the destination (in my case, “Draw Deck” or “Discard”). I would like to have the card automatically go to the “Discard” pile without the dialog popping up. I would also like to change the hotkey to something other than Ctrl-R.
Is there a way to customize this behavior? I have not been able to find any documentation on “rake”. I copied the card functionality from Modules:Scum_Cards. This is an example CardSlot:
<VASSAL.build.widget.CardSlot entryName="10_of_spades" gpid="145" height="0" width="0">+/null/return;Rake;82,130;Discard;Select destination obs;;fancy_back.png;;B;?;player:;Peek\ prototype;PlayingCard\\ piece;;;10_of_spades.png;10_of_spades/ null;\ \\ null;0;0;145</VASSAL.build.widget.CardSlot>
Could someone please explain what all of the options of this mean?
Thanks for the help!
If you would like to simply send the card to a “Discard” deck (I’m assuming that’s what you mean by “pile”), add the Return to Deck trait to the card. Give it a menu command of “Rake”. Keyboard command and be anything you want include keywords like SendToDiscard. Uncheck the box asking if you wish to determine deck during game time and you’ll have the option to select a specific deck. You should now be able to just right-click the card and select “Rake” to send it to the discard deck
Okay, I understand a bit more now what is going on. You have introduced me to the concept of traits for the playing cards. That is where “rake” was defined. I saw that in the XML but didn’t understand what it all meant. When I pull it up in the Vassal editor I now see how it is used.
As I mentioned earlier, this is my first attempt at creating a game in Vassal. I have lots to learn still, but I see that it is a very powerful engine that should do what I need.
Yeah, it is quite powerful. Keep in mind that unless you need to do something specialized for your own needs, there is no need to do any Java coding at all. I’ve never used it and I’ve never needed to.
DrNostromo, I noticed in some of you other posts reference to “To Be King”. However, when I search for the module the link to drnostromo.com/tbk/index.html is not valid. Is there an updated link?
Alas, there is not. The version I had available for download was waaayyy back when I really didn’t understand how to use Vassal effectively and is pretty torturous to play. I regret posting it in the first place. I’ve tried a couple times to re-make it but I’ve run into complexity issues so I’m waiting for Vassal 4 (which I understand is C++ based - a language I understand enough of to customize, if necessary) before I try again.
I did complete a tabletop version of the game. You may want to check out my journal on it’s construction here. My buddies and I have played it in the garage over the course of a few weekends and it was quite fun.
I do have a CCG version for Vassal and it works pretty well but I didn’t get much public interest in it. My friends and I have played it a few times and it’s ok but it doesn’t measure up to the board game version. If you’re interested in checking it out, we can probably set up a session sometime. I live in California (PDT) and I’m retired so I’m pretty open as far as a time.
At this point I am mostly interested in example code that shows how to shuffle and deal out cards at module initialization. I have pulled down a bunch of modules but haven’t found any that do the procedure you have described. Do you know of any? It is a bit of a learning curve, so have examples goes a long way.
I’ve got a few samples lying around. I’ll post them later today.
First off, I don’t believe Vassal will automatically distribute cards when you start a new game. However, you can place a “Setup” button on the map somewhere (something I do all the time) and when you click it, it will set the game up as you like and you can have the button delete itself once it’s done.
I’ve posted a few example sample mods in the past. Here’s some links to those threads. Most are quite simple but they should give you some insight into manipulating cards.