Mask whole stack/number of counters

Hello,

Not sure the best place to post something like this but, working on a Vassal Mod and I’m wondering if there’s any way to Mask a whole stack of units, so the opponent can no longer see how many units are in the stack? Just a single blank counter etc.

I don’t want to remove stacking across the whole map.

Has anyone seen this implemented before?

Thanks!

One possibility would be to move the stack to a Private Window only accessible to the side who owns the counters, and replace it with a dummy counter.

Thanks for the quick reply. Yes, that’s the work around I’m using at the moment. Only annoying thing with that, When I click a stack of two or more counters, and trigger the action, it’s placing a marker per piece, which is annoying. Know any way to send the stack to the private window, and only have one marker drop on the main map?

It can be done, but a tad more complicated.

  1. When you select the pieces (whether in a stack or not), and you execute - say - Hide by Moving to Private Window, then that command is executed in turn for each selected piece.
  2. The command arrives at the one of the selected pieces.
  3. That piece should send a Global Hotkey - say MarkSelected - but this should be done under the condition that Selected is true - for example via a Trigger Action trait.
  4. The Hotkey then sends a command to all Selected pieces - say MarkForMoveToPrivateWindow
  5. That command then marks the selected pieces with some attribute - say ToMoveToPrivateWindow.
  6. The control goes back piece, which
    • Places a marker in its location
    • then executes the Deselect trait.
  7. It then issues a Global Hotkey - say MoveMarkedToPrivateWindow
  8. The Global Hotkey then sends a command, but only to those pieces with the mark - say MarkForMoveToPrivateWindow. The command could be MoveToPrivateWindow.
  9. The command is seen by all piece with MarkForMoveToPrivateWindow
  10. The pieces then moves themselves to the private window.
  11. Since there are no selected pieces, it means the rest of the pieces do not see the initial - Hide by Moving to Private Window.
  12. Pieces moved to the private window should have their MarkForMoveToPrivateWindow property reset.

Yours,
Christian

Thanks so much for sending a very detail reply there, I might be a little out of my depth with this though, Not so familiar with global hotkeys, or marking attributes.

I tried to go through these steps but not quite understanding.

Perhaps Its not such a big deal to manually move the pieces between the windows. lol

I have a crazy idea. In each map window, there’s an element related to stacking. If you open it up, you can set the “overlap” distance between pieces both expanded and unexpanded. What if you set these to zero? Would that make it look like there was only one piece in a stack? Just a thought.

@craig83 explicitly said …

… so I guess it’s not an option.

  • Global Key Commands - what I termed above as Global Hotkey are GlobalKeyCommand (GKC) attached to a module or map - i.e., commands that can be shown in the toolbar, or can be excuted by all pieces. A piece can initiate a module or map GKC via the trait Global Hotkey
  • Global Hotkey trait defines a constant property on a piece. A Dynamic Property trait defines a mutable property on a piece.

Thus, you define on your map

  • Global Key Commands
    • Button text: "" (empty)
    • Tooltip: "" (empty)
    • Button icon: "" (empty)
    • Hotkey: MarkSelected
    • Global hotkey: MarkForMoveToPrivateWindow
    • Preselect:
      • By Property: true
      • Property name: Selected
      • Comparison: ==
      • Value: true
    • Apply to counters on this map only: true
  • Global Key Commands
    • Button text: "" (empty)
    • Tooltip: "" (empty)
    • Button icon: "" (empty)
    • Hotkey: MoveMarkedToPrivateWindow
    • Global hotkey: MoveToPrivateWindow
    • Preselect:
      • By Property: true
      • Property name: ToMoveToPrivateWindow
      • Comparison: ==
      • Value: true
    • Apply to counters on this map only: true

Define on your piece(s) or, preferably, in a Prototype

  • Trigger Action
    • Command: Hide by Moving to Private Window
    • Key: Ctrl+H (or whatever you want)
    • Action Keys:
      • TrampolineMarkSelected
      • DeselectAll
      • TrampolineMoveMarkedToPrivateWindow
    • Expression: {Selected==true}
  • Global Hotkey
    • Command: "" (empty)
    • Key: TrampolineMarkSelected
    • Global Hotkey: MarkSelected
  • Deselect
    • Command: "" (empty)
    • Key: DeselectAll
    • Type: All
  • Global Hotkey
    • Command: "" (empty)
    • Key: TrampolineMoveMarkedToPrivateWindow
    • Global hotkey: MoveMarkedToPrivateWindow
  • Send to Location
    • Command: "" (empty)
    • Key: `MoveToPrivateWindow
    • Destination: Grid Location on Selected Map (for example)
    • Map: SideAPrivateMap
    • Location: some location

This approach can also be used if one wants to calculate the combat odds between selected pieces, or similar.

Yours,
Christian

Can’t thank you enough for helping out with this. I went through this very methodically this morning and when I run it on the piece, it doesn’t move. Is there a way I can see a log of the actions/commands to problem solve where the issue is?

Actually worked it out. Was an issue with my send to location trait. Now I just need to add something in to replace the stack on the map, with a single marker.

Only Issue I’m having now is that all pieces on the map are being moved to the off map window. So guessing its an issue with the Selected==true expression. Have been looking but can’t see where the error is.

Try {Selected} instead of {Selected==true}.

  • Trigger Action
    • Command: Hide by Moving to Private Window
    • Key: Ctrl+H (or whatever you want)
    • Action Keys:
      • TrampolineMarkSelected
      • DeselectAll
      • PlaceDummyMarker
      • TrampolineMoveMarkedToPrivateWindow
    • Expression: {Selected}
  • Place Marker
    • Key: PlaceDummyMarker
    • Path: …

Perhaps you want to set a global property to the UniqueID of the placed marker, and modify ``MoveToPrivateWindowto be aTrigger Actionthat first stores that global property in aDynamic Property, and only then does the Send to Location`. In that way, the moved pieces knows which dummy piece has taken their place, and you can therefore move them back to that piece.

Another way to achieve this is via Attachment - the moved pieces are attached to the dummy, and vice-versa. That will allow them to communicate very efficiently. For example, the dummy piece can query the moved units for their properties, sum that, or count number of masked units.

What does "Global hotkey: MarkForMoveToPrivateWindow" actually trigger? Should there be another trait in the piece that assigns a property?

My mistake - forgot to write it in. Here’s everything revised

You define on your map

  • Global Key Commands
    • Button text: "" (empty)
    • Tooltip: "" (empty)
    • Button icon: "" (empty)
    • Hotkey: MarkSelected
    • Global hotkey: MarkForMoveToPrivateWindow
    • Preselect:
      • By Property: true
      • Property name: Selected
      • Comparison: ==
      • Value: true
    • Apply to counters on this map only: true
  • Global Key Commands
    • Button text: "" (empty)
    • Tooltip: "" (empty)
    • Button icon: "" (empty)
    • Hotkey: MoveMarkedToPrivateWindow
    • Global hotkey: MoveToPrivateWindow
    • Preselect:
      • By Property: true
      • Property name: ToMoveToPrivateWindow
      • Comparison: ==
      • Value: true
    • Apply to counters on this map only: true

Define on your piece(s) or, preferably, in a Prototype

  • Trigger Action
    • Command: Hide by Moving to Private Window
    • Key: Ctrl+H (or whatever you want)
    • Action Keys:
      • TrampolineMarkSelected
      • DeselectAll
      • PlaceDummyMarker
      • TrampolineMoveMarkedToPrivateWindow
    • Expression: {Selected==true}
  • Global Hotkey
    • Command: "" (empty)
    • Key: TrampolineMarkSelected
    • Global Hotkey: MarkSelected
  • Deselect
    • Command: "" (empty)
    • Key: DeselectAll
    • Type: All
  • Global Hotkey
    • Command: "" (empty)
    • Key: TrampolineMoveMarkedToPrivateWindow
    • Global hotkey: MoveMarkedToPrivateWindow
  • Trigger Action
    • Command: "" (empty)
    • Key: MoveToPrivateWindow
    • Action keys:
      • ClearMoveToPrivateWindow
      • MoveToPrivateWindowReal
  • Send to Location
    • Command: "" (empty)
    • Key: MoveToPrivateWindowReal
    • Destination: Grid Location on Selected Map (for example)
    • Map: SideAPrivateMap
    • Location: some location
  • Place Marker
    • Key: PlaceDummyMarker
    • Path: …
  • Dynamic Property
    • Name: ToMoveToPrivateWindow
    • Numeric: true
    • Commands:
      • set to true
        • Command: "" (empty)
        • Key: MarkForMoveToPrivateWindow
        • Type: Direct
        • Expression: {true}
      • clear
        • Command: "" (empty)
        • Key: ClearMoveToPrivateWindow
        • Type: Direct
        • Expression: {false}

Note, if you are sure the pieces are in the same location, you can probably avoid the trampolines to GKC, and do

  • Trigger Action
    • Command: Hide by Moving to Private Window
    • Key: Ctrl+H (or whatever you want)
    • Action Keys:
      • DeselectAll
      • PlaceDummyMarker
      • LocalMoveMarkedToPrivateWindow
    • Expression: {Selected==true}
  • Global Key Command
    • Key: MoveToPrivateWindow
    • Global key: MoveToPrivateWindowReal
    • Restrict range: true
    • Fixed range: true
    • Range: 0
  • Send to Location
    • Command: "" (empty)
    • Key: MoveToPrivateWindowReal
    • Destination: Grid Location on Selected Map (for example)
    • Map: SideAPrivateMap
    • Location: some location
  • Trigger Action
    • Command: ""
    • Key: PlaceDummyMarker
    • Action Keys:
      • PlaceDummyMarkerReal
    • Expression: {Selected==true}
  • Place Marker
    • Key: PlaceDummyMarkerReal
    • Path: …

This will move all pieces that have these commands, which are in the same location as the initating piece, to the private window, whether selected or not.

Yours,
Christian

when you build a counter or a game piece prototype definition, you can add “mask” and “invisible” function. So, when you play, you can select a unit will be masked or unmasked; That means opponent will see a neutral marker, a flag for instance, instead of the unit. But you will see the real unit. Its more confortable than put units outside the map. Secondly, you can choose the unit will be invisible from opponent view, but not for you.

Yes, but …

which precludes using the Mask or Invisible traits - unless one does more. Just Mask’ing pieces will still allow the opponent to count the number of pieces in a stack. You can of course make them all Invisible, but then you’d still need a piece to indiciate to the opponent that there is a stack at the location.

The above suggestions was based on @jrwatts suggestion to

Thanks all, well I’ve worked through this so many times and tried to get it to work in a smooth way, but unfortunately every time I can’t get it to function as desired, so I’ve decided to just go with a less automated option and have a manual command to drop a marker, then a separate command to move the counters. Works just fine, but not as elegant as I was hoping. Need to keep moving forward to actually have something playable.

Appreciate all the advice!

if you have 5 units in a stack you can make 4 units invisible and the last one masked; Opponent will see one flag but won’t know the number of units.

what is the name of the game? Perhaps it is possible to make something

I am acccustomized with the functions, playing often with masked units