Thanks to a very quick and useful answer to my previous post I hope to trespass on someone’s time a bit further…
I now have things successfully updating via a global command linked to a prototype Type description. However I would like to take this 1 step further…certain of the pieces may be placed by either side (and I have worked out the masking issues involved so each is masked from the other player) however I was not sure how to apply the global key command with a further refinement to select only a certain player’s units. This would be easy if all units belonged to only 1 player as I could use the Type description but with certain pieces being dual use I think I need a further refinement…and I thought of some “Belongs to” additional matching property.
Current Matching Property is as follows
However I am not sure how a dual use piece stores ownership or how to retrieve that ownership in a useful way…
PS I also do not know how to shut down my other topic on the forum…to save people wasting their time reading it.
It may be that I am missing something and there is an obvious/alternative way to do this.
However units are NOT static in “ownership”. For example in a 2 player game there are neutral units that may be played by either player (these sit alongside true factional/side units Evil/Good). So whilst their notional side remains neutral their ownership for a given tactical battle (within an overarching campaign game) may be either Evil or Good. And in a given engagement it is possible that both Good and Evil may have Neutral units on their sides. There is also the situation where the Good or Evil player has to play an entire army composed of Neutral units vs the other player (being either Good or Evil).
Perhaps the obvious solution would be to give Good and Evil each a Neutral palette (Neutral Good and Neutral Evil) replicating each of the units. However as there are approximately 300-400 neutral units I would like to avoid this if possible!
What I want to be able to do is select all neutral units (in play) that were PLACED by Good and then alter 1 stat on all those units using a GKC without at the same time slecting any “neutral” units placed by Evil. It would seem this should be possible as Vassal can recognise/differentiate ownership of 2 similar “neutral” units by who PLACED the unit for the purposes of masking etc. So I was hoping to utilise this recognition for the purposes of a GKC.
ie Type=Neutral “and was originally placed by Good” *where the bit in quotes is the piece I do not know how to do.
To my knowledge the information of who placed a piece is not available as a default, system property, though it is obviously used internally by a few traits. However, you can do this yourself with a dynamic property.
- Have each of your maps issue a command to all pieces ending movement on the map (via the map properties, near or at the bottom) - I always use the same command for all maps, in every module, and I try to keep it relatively obscure, i.e. ‘CTRL-SHIFT-T’ (trigger).
- On each of your pieces, set up a dynamic property ‘owner’ and use CTRL-SHIFT-T set the value directly to ‘$playerSide$’ (without quotes).
- Now you can use the following expression in your global key command:
owner = $playerSide$
Note that this will update the owner every time the piece is moved, so, for instance, the evil player might casually move one of the good pieces - say, to correct its position, and the game would then think that the good piece belonged to the evil player. You can set it up to only set the property once, but it is slightly more sophisticated - give the dynamic property a default value of, say, ‘null’, wrap the dynamic property assignment in a Trigger Action and use a property match expression on the Trigger Action:
owner != null
Also note that in 3.1.18 some types of automated piece movement (vs. drag-and-drop) may not trigger the ‘piece ending movement on this map’ command - I seem to remember having problems with Return To Deck, for instance. It is still pretty easy to manually force it to fire by wrapping the offending command in a Trigger Action and putting CTRL-SHIFT-T (or whatever) at the end of ‘Perform these commands’ - but I don’t think it will be necessary for the situation you’re describing.
Let us know if you run into any problems.
You can put a Dynamic Property on the piece that holds the value of the player side. For example
Ownership = 1, 2, 3, etc. …whatever player side owns the piece. You can also set up a key command on the Dynamic Property with the right click option of Change Ownership with the list of player sides to choose from. Whenever a player takes control of that piece, they can right-click it and select their player side.
You can also have a Layer trait with some sort of small graphic to depict who owns the piece based on the Ownership DP or a Text Label trait that just displays $Ownership$.
Then, as far as your key command goes, you can send it to
Type = Neutral && Ownership = 3
This will only affect Neutral units owned by player side 3.
To extend Dr. Nostromo’s solution, if you want to select both the evil pieces and the neutral pieces owned by side 3, you could use the following expression:
Type = Evil || Type = Neutral && Ownership = 3
Thank you both for all your help I will see what I can come up with.