Disallow dragging more than one instance of a ship to the map

I searched around the forum but couldn’t find anything that answered this.

I’m creating a naval game and going to use a Vassal module to playtest it. Is there a way to allow only one instance of a piece (in this case a ship) to be dragged from the Piece Pallet to the map window?

Since these pieces represent a single ship, I don’t want the ability to even accidentally put two identical ships on the board.

Gary

No. You don’t use a piece palette for this. A piece palette is a factory. Make a pieces map window instead. Create all your pieces there.

Ah, I see. The pieces map window would just have the pieces for that scenario in it.

Thank you.

One further thought. If you stock all the pieces into a map window, and eliminate the piece palette, then I suggest not implementing the DELETE command (trait) on those pieces. Perhaps implement a SUNK command instead, which sends it to a Sunk Ships map window from where it could be retrieved if necessary.

Players could accidentally select the Delete command in a menu, or press CTRL-D when the wrong unit was selected. The UNDO button could bring it back, but that’s not perfect.

Just a thought.

Hi Gary,

If you want some inspiration I would point you to some of the modules I’ve done - for example Afrika Korps, D-Day, Gettysburg - Smithsonian Edition, Panzerarmee Afrika (all ch versions). In these module, I have a separate OOB WidgetMap with the Order of Battle chart (or “Order of Appearance”).

In fact, I would argue that a PieceWindow widget should only be used for transient pieces - such as markers and such, or if the game in principle allows for an infinite number of copies of a piece.

The units are then automatically moved on to the map on appropriate turns at appropriate places.

Some of them, notably Afrika Korps, D-Day, Panzerarmee Afrika also have the ability to “purchase” reinforcements etc., automatically spending points when units are moved from the OOB (or Cadre) to the map.

Some of them, for example Gettysburg - Smithsonian Edition have multiple OOBs for different scenarios. At the end of a special “Setup” phase of turn 1, all units that are not in use are automatically removed (including units excluded by optional rules being enabled or not). So far that reason, …

… I would still implement a DeleteTrait but make the triggering command be a key-command (e.g., wgDelete) rather than a hotkey (e.g., Ctrl-D).

Key-commands are not accessible directly by the user, while hotkeys are.

It would be nice if one could remove, at runtime, and entire MapWidget (or at least disable it), but I’ve not found a way to do that.

Anyways, my 2¢

Yours,
Christian

1 Like

FWIW, don’t delete (or not use) the piece palette as it provides a good template of your pieces for future maintenance. Instead, check the box to “hide” it from the players. That way it can still be accessed in the editor.

I’ve been in the situation of trying to maintain & update a module that didn’t have a piece palette and it’s a pain.

The terms a user will encounter in the Editor itself and the documentation are:

Key command is an umbrella term that encompasses Named Commands (like your example wgDelete) and keystroke commands (Ctrl-D). Hotkeys are key commands sent to and listened for by non-piece module components (a map window to open/close, an toolbar Action Button, a toolbar GKC, dice-rolling, etc).

Thanks all for your advice. I am still rather new at Vassal though I am learning fast, usually by finding a module that has a function that I want and seeing how it’s set up in the editor (I learned coding this way too).

As I understand from reading all the above:

  1. Don’t get rid of the piece pallet entirely as it is the “piece factory.”

  2. Use a piece map (like a player’s counter tray) to hold pieces - perhaps one for each player for player specific pieces and one general one for generic markers (markers can, for the most part, be cloned infinitely, unlike a physical game). This solves the original question of more than one instance of an individual ship piece on the map.

  3. Change the Delete command (how did you guys even know that trait was there—?) to something else (I like the ‘sunk’ suggestion moving the ship to a “Davey Jones’ Locker” tray). This would also help in determining victory as points are given for sunk ships etc.

Gary

If you make At-Start placements of pieces, and also have the same piece in a PieceWindow, then you will have two distinct copies of the same piece - on in the At-Start and one in the PieceWindow. That is, they are distinct in the sense that if you edit one, those edits will not be propagated to the other (and technically they have different gpid - unique identifiers).

Also, the VASSAL editor allows you to search the module so you should be able to find any piece relatively quickly.

For these two reasons, I do not see a benefit in keeping a copy of pieces in a PieceWindow if you have put it in an At-Start. In fact, I think one can argue that it makes maintenance harder.

I would not use a MapWindow (or MapWidget) to store the markers and such in. Instead, I would keep a PieceWindow for that. A MapWindow will have a finite number of markers, and the users would have to diligently move markers back there, or potentially run out. There’s something to be said for just Deleteing a marker when done with it.

A MapWindow for user pieces can be more than just a tray. Indeed, if your game has a specific order of appearance, or a limited number of resources, then a MapWindow can help you (and users) keep track of such things.

In that vain, I’d also like to direct your attention to the TurnTracker element which can help you and users keep track of things and even execute specific actions at specific times.

Perhaps make a MapWindow to be the “graveyard” or “dead pool”, and then a SendtoTrait to send units (ships) there. Of course, if ships can be repaired or rescued from the bottom of the sea, then that window could be a “shipyard” and could also help you and users manage resources.

Using the Sum... and Count... functions (search “VASSAL Count”, f.ex.) you can fairly easily count up number of sunk ships or tally the total victory points of each ship. Using a turn tracker element you can do this automatically on the last turn and then use Alert to tell the users who won.

Also, piece “trays” need not be separate MapWindows. It could be zones directly on the board, if that makes sense. Personally, I like separate windows to keep the playing surface less cluttered.

My 2¢

Yours,
Christian