My latest problem is I have 9 Pieces which have the same Layer shared through a Protype Definition. I am attempting to apply a Restrict command so that only one of the Pieces will have a particular Level (StockerMG) displayed at the one time. There is only supposed to be one of the piece represented by these Levels in the game ( if that makes sense).
It can also only be available when there is a particular version of B-17 in play. So I tried the following Expressions for the Restrict Command
The first part of the Expression works but not the second.
What I want it to say is;
If the YB-40 is not displayed OR The number of Pieces in the game that has the StockerMG Level of 2 is greater than one, the Restriction will be applied. Is this the correct expression or is there another way. I can’t add a module link with instructions at the moment because Windows or something has installed a stupid “Snip” tool which is interfering with how I do my screenshots and now I have to go get some sleep.
It surely does, thank you very much for this. I can see now that Count(expr, map) is all that was needed and this is where I get stuck with Expressions - the where and how to start. I had to change it to …
…because the > I was using meant there were 2 Ammo Stockers displayed before the Restrict command worked and I wanted a limit of one but that was my fault as usual.
Yes and I made both of those expression I posted with it. They got the Green Tick. When I copied your Expression from here into the builder it showed a red cross but was OK when I reproduced yours from scratch using the Builder. Possibly because of what you said about not using the </>?
My apologies once again, time got away from me last night and a Microsoft update was causing me some grief so this post was rushed out while it was still in my head. I am not sure however if I can improve on my previous comments ( in the physical game? ) but will try.
There are 9 Pieces that share a layer called StockerMG through a Prototype Definition. There is one Level in the layer which represents an Ammo Stocker Game Piece. When the Ammo Stocker Level is shown on one of the pieces I wanted to use A Restrict Command to prevent the level from appearing on the other 8 Pieces, limiting the availability to one at any one time. The Expression I needed was for the Restrict Trait and Mark has come to the rescue.
I had previously provided a download for the Module and a savegame as well as the location of the Restrict Command yesterday. If there is another, better way I of limiting the Layers to one Piece at a time I am always grateful for suggestions.