Create account / Log in

Sending finite number of selected pieces to XYZ.

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

Sending finite number of selected pieces to XYZ.

Postby Benkyo » October 23rd, 2020, 7:48 am

When I want to send a group of selected pieces to 10 different destinations, to line them up, for example, I usually use the following method when I don't have a full piece tracking system in place:

Zones 0-9
Global properties 0-9
Reset all 10 global properties to 0
Send a global command to any pieces already in the zones, to set corresponding global properties to 1
Calculate with ? : which is the first empty zone
Send a piece to the empty zone

This repeats for each selected piece until they are all nicely lined up from zone 0 to 9.

In Napoleon's Triumph, I can use a slightly tweaked version of this to straighten up a corps of up to 8 blocks and a commander piece, and to facilitate concealing unit order within a corps (a feature a player requested).

My problem is this: according to the rules, you can't take more than a corps into hand at one time (technically you could pick up 9+ individual units in the same location, but I can't see that being necessary), otherwise you could secretly switch units between corps. It's also more time and lag the more destinations I add, so I don't want to make it possible to just pick up ALL the pieces.

What's a good solution, both in design terms and technically possible with the Vassal editor? Is there an elegant way to abort the whole thing with a single Alert if 9+ blocks or 2+ commanders are sent?
Benkyo
 
Posts: 276
Joined: March 13th, 2013, 11:02 pm

Re: Sending finite number of selected pieces to XYZ.

Postby m3tan » October 23rd, 2020, 1:47 pm

Here are a few random thoughts in no particular order for what I have done / would do for stuff like this:

1. Perhaps I don't understand what the Global Properties are for, but I'm not sure why you need 10 of them. I usually use a single GP called "Counter" that ranges from 0 to 1 and use it for like 50 different things in a module. As long as none of those commands overlap i.e. another one starts before one finishes, it shouldn't be an issue.
2. To arrange pieces, I usually use the Advanced Options for Send to Location to offset the X or Y coordinates by a calculated amount. I've even done this with different sized pieces by assigning markers for each piece's height and width and integrating those into my expression for the offset. You need a single GP to track which piece (0-9 in your example) you are arranging.
3. I'd consider numerical names for regions or zones like "1450" "1475" "1500" etc... if it's a dedicated staging area. This allows you to send pieces directly to named locations. As long as you don't need to report movement, you can name them anything you want.
4. You could also send all the Pieces to a deck temporarily just to leverage a deck's ability to count the number of pieces by property expression.
5. To disable sending more than 9 pieces, I'd use the new COUNT function and Restrict Command if 9+ blocks or 2+ commanders are Selected==true. You could also send them to the temporary deck above, count by property expression, then send back if they exceed your limits, but that seems clumsy.
User avatar
m3tan
 
Posts: 209
Joined: August 12th, 2018, 11:49 pm

Re: Sending finite number of selected pieces to XYZ.

Postby Benkyo » October 23rd, 2020, 9:30 pm

Hadn't heard of the count function, sounds ideal.
Benkyo
 
Posts: 276
Joined: March 13th, 2013, 11:02 pm

Re: Sending finite number of selected pieces to XYZ.

Postby m3tan » October 23rd, 2020, 10:21 pm

I've used Count alot already and with good success. The only caveat is that it's a resource hog. Filter your list as efficiently as possible and use it sparingly. I try to Count or Sum only as needed and preferably somewhat behind the scenes while players are distracted by something else.
User avatar
m3tan
 
Posts: 209
Joined: August 12th, 2018, 11:49 pm


Return to Module Design

Who is online

Users browsing this forum: No registered users and 3 guests