Create account / Log in

Card Order in a deck

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

Card Order in a deck

Postby Djangtchoub » July 30th, 2020, 7:52 am

I don't know if it's possible but :
Each player has a deck of chit.
Each turn you send a certain number of chit into a cup
You draw the chits one by one to activate your clans
Then you recover your chits

So I have my side deck I allow multiple card to be card, so by a right click I can select the chits I want. But after one turn, the chits are not in alphabetical order anymore and it's a little annoying.
Is there a possibility to fix the position of the cards in a deck ?
Djangtchoub
 
Posts: 17
Joined: April 26th, 2019, 7:32 am
Location: BRIVE - FRANCE

Re: Card Order in a deck

Postby m3tan » July 30th, 2020, 3:16 pm

The only way I know of to automatically arrange the order of cards in a deck is using the built-in UP and DOWN arrow key commands to send an individual card to the top or bottom of a deck. Theoretically, you could alphabetize the cards that way be the logic would be a kluge.

The approach I'd use is to create a Game Piece Inventory Window (GPIW) to view the deck contents because you can easily alphabetize from that view.
User avatar
m3tan
 
Posts: 189
Joined: August 12th, 2018, 11:49 pm

Re: Card Order in a deck

Postby Cattlesquat » July 30th, 2020, 6:44 pm

Couple of ideas:
(1) The "Draw Specific Cards" function of the Deck itself does allow you to present the Deck in an alphabetically sorted fashion. Obviously that may not be ideal for you, but just wanted to mention that it exists.
(2) As m3tan describes, you can send "UP" and "DOWN" Key Commands to the things that are in a deck to move them up or down.
(3) In the couple of situations where I've needed to build a somewhat fixed deck (in my case I needed to draw a random clump of 4 cards from one deck, then a random clump of 4 cards from elsewhere, and so on, creating a series of layers), I would first start with the target deck empty (so you could move any remaining chits out with a Global Key Command), and then put them back in the right order (put the ones you want on the bottom back in first, etc). If you need things strictly alphabetized that could be pretty slow (putting one card at a time back), but if you mostly needed them to go back in logical blocks it might not be too bad.

We need m3tan to write us a custom class to alphabetize a deck! :D

Brian
User avatar
Cattlesquat
 
Posts: 890
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA

Re: Card Order in a deck

Postby Tim M » July 30th, 2020, 9:58 pm

If I remember right - and I dont know if this is still there, but I thought Brent put in a GamePiece ID for everything a long time ago (counters, cards etc..). So if you play your cards right (haha!) and put them in to the module in alphabetical order, perhaps GamePiece ID can be exposed (I thought it could??) and you can use that property as your alphabetizer/sorter so to speak
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1816
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: Card Order in a deck

Postby Djangtchoub » July 31st, 2020, 6:55 am

Cattlesquat wrote:Couple of ideas:
(1) The "Draw Specific Cards" function of the Deck itself does allow you to present the Deck in an alphabetically sorted fashion. Obviously that may not be ideal for you, but just wanted to mention that it exists.


Hi I think you mean this option ?

1.JPG
1.JPG (17.27 KiB) Viewed 710 times


But event if I do this, I have this result after one turn :

2.JPG
2.JPG (18.24 KiB) Viewed 710 times


So I guess I should add something in my "sort card" Option.
Djangtchoub
 
Posts: 17
Joined: April 26th, 2019, 7:32 am
Location: BRIVE - FRANCE

Re: Card Order in a deck

Postby Djangtchoub » July 31st, 2020, 8:20 am

And I've just tried to create a Marker named position with number 1,2 etc and sort by $Position$
doesn't work either
Djangtchoub
 
Posts: 17
Joined: April 26th, 2019, 7:32 am
Location: BRIVE - FRANCE

Re: Card Order in a deck

Postby Cattlesquat » July 31st, 2020, 1:46 pm

What version of Vassal are you running? 3.2.17? 3.3.2? I know there was a bug where the sorter ignored the sort data from the cards if they were in a face down deck. It got fixed recently and I can't remember if 3.3.2 has the fix or if it isn't coming until 3.3.3. In any event I think that's the bug you're experiencing -- and it's a bug so hang tight. You're using the correct syntax.
User avatar
Cattlesquat
 
Posts: 890
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA

Re: Card Order in a deck

Postby Djangtchoub » July 31st, 2020, 1:57 pm

I use 3.3.2
Djangtchoub
 
Posts: 17
Joined: April 26th, 2019, 7:32 am
Location: BRIVE - FRANCE

Re: Card Order in a deck

Postby Cattlesquat » July 31st, 2020, 2:28 pm

Okay - problem should be gone when 3.3.3 comes out then.
User avatar
Cattlesquat
 
Posts: 890
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA


Return to Module Design

Who is online

Users browsing this forum: Bing [Bot] and 6 guests