Create account / Log in

Add Multiple Cards/Pieces - Sorting

Talk about module design ideas and techniques.

Moderators: Tim M, uckelman

Add Multiple Cards/Pieces - Sorting

Postby Chrompe » April 9th, 2019, 3:28 pm

When adding multiple cards or pieces I point to a folder and the list is always in a random order, clicking column headers doesn't sort the list. I really need items to be added in alphabetical order as I want players to be able to build decks based on the names of cards, that will be difficult if they're in a random order.

Is there any way to sort the list so that they import in order? I really don't want to have to right click and move every entry after import.
Chrompe
 
Posts: 2
Joined: April 9th, 2019, 3:23 pm

Re: Add Multiple Cards/Pieces - Sorting

Postby grouchysmurf » April 10th, 2019, 6:12 pm

The easiest... No, I find it an easiest way:

1. add one card to the deck;
2. unzip Vassal module;
3. open buildFile;
4. find entry corresponding to card added in #1.
5. duplicate it as many times as required.
6. change names and ids appropriately.
7. zip the module back, change extension to vmod.

I would even write a short code in bash / awk to do 5 for me but doing it manually would also work.
User avatar
grouchysmurf
 
Posts: 129
Joined: August 9th, 2011, 7:48 pm

Re: Add Multiple Cards/Pieces - Sorting

Postby Chrompe » April 10th, 2019, 8:55 pm

Hmm ok, a little more complex than I was thinking of but workable. So the way I just did it...

Since the name of the card is the first attribute on each line and each line is identical until it gets ot the line:

1. Added cards using the add multiple cards feature
2. Found the entries in the buildFile
3. Copied those into a new temporary text file
4. Used the GNU sort utility on the temporary file
5. Pasted the now alphabetically sorted lines back into the buildFile

Also how about this...
Say I want to have the cards as pieces in the game piece palette, I want to have them categorised by card type into different scrollable lists. What if I also want a scrollable lists for "all cards" in one list? Is it ok to have a duplicate id in that situation or will that mess things up? Or is there a better way of achieving that?
Chrompe
 
Posts: 2
Joined: April 9th, 2019, 3:23 pm

Re: Add Multiple Cards/Pieces - Sorting

Postby grouchysmurf » April 12th, 2019, 6:48 am

GNU sort utility. Lovely!

If cards are not in a limited supply i.e. there can be any number of them then the palette would work just fine and I believe it is OK to duplicate the entries / records for cards. You will simply end up with same card being in different scrollable list but that is fine with design that you are working on, as far as I have figured.

I would just initialize the lists with a single card and add others utilizing the method described above. Good luck.
User avatar
grouchysmurf
 
Posts: 129
Joined: August 9th, 2011, 7:48 pm


Return to Module Design

Who is online

Users browsing this forum: No registered users and 1 guest