How to make a group of pieces Invisible at Start

I’m currently trying to develop a vassal module of the 1983 Gazala The Clash of Armor boardgame. Since it is a game that uses “fog of war” hidden deplyment, I need to figure out a way for certain pieces (planned minefields) to be invisible from the opponent from the start of the game.

I would appreciate any advice as detailed as possible, since I’m a novice in vassal design.

Use the Mask or Invisible traits on the mine pieces.

The Mask trait shows a non-owning side a reverse side of the counter. That is, the counter isn’t revealed but known to be present.

Invisible trait makes a piece entirely invisible to the opponent.

The two traits can be combined. For example, the mines may initially be entirely invisible, but may be discovered by reconnaissance. However, on discovery, the opponent may see the masked side reflecting that the opponent does not know the exact constitution of the minefield. Only when a mine-sweeper or unit moves in will the piece be revealed (defused or explode).

Yours,
Christian

Pay attention to the order of traits - see Trait Ordering and YOU. Very important when using the above mentioned traits.

If you have multiple pieces that share a feature, consider to use Prototypes. In that way, you specify features and behaviours once and then reuse that definition across multiple pieces, making maintenance a lot easier. Start to use Prototypes already now and it will save you a world of pain later on.

Yours,
Christian

Thanks for taking time to reply Christian.
I am using prototypes (“Planned Minefields”) that have the Trait “Invisible”, thus making them invisible when I right-click on them one by one. My question was about how this “invisibility” for the opponent can be invoked at the very start of the game without any intervention by any player.

Good call.

What you probably need is to use the configuration Key Command to apply to all units ending movement on this map on your Map Window. Set this configuration to a named command a la WhenOnMap and then add a Trigger Action to your Planned Minefields a la

  • Trigger Action
    • Key: WhenOnMap
    • Property: {OldMap != CurrentMap}
      (to only trigger the trait when the piece arrives on the map)
    • Action keys: [MakeInvisible]

Note, you probably need a Planned Minefields Prototype for each side of your game, so that the contained Invisible trait can be configured to only make invisible to other sides.

Another option to set the pieces to be invisible from the get-go is to change the state of Invisible from false to true. This can be done by hand-editting the buildFile.xml of the module, though not easy and very error prone.

Another method is by patching the module using my pywargame Python module.

from wgexport import *

def patch(build,data,vmod,gverbose=False):
    game                = build.getGame()
    prototypesContainer = game.getPrototypes()[0]
    prototypes          = prototypeContainer.getPrototypes(asdict=True)
    
    for side in ['A', 'B']: 
        planedMines         = prototypes[f'{side} Planned Mines']
        traits              = planedMines.getTraits()
        hide                = Trait.findTrait(traits,HideTrait.ID)
        hide.setState(hiddenBy = side)
        planedMines.setTraits(*traits)

Yours,
Christian

I will give it a try. Thanks very much, I really appreciate your help.

Please remember to mark an answer - could be your own - as the Solution once you have found out what to do - only you - as the OP - can do that. That helps others with similar problems more easily identify a possible remedy.

Yours,
Christian