How to know tha a location is empty

Hello,
I want to “Send to Location” a piece, but I want to know first if the location is free of any piece, empty.
Is there a simply way to know This ?
I could try a GKC on the map to know where are all the pieces, and so, know if the location is on the list, but I would prefer something lighter in CPU

Global Properties to count in and out to a location on any piece of interest is perhaps the lowest CPU option. The simplest, low maintenance way would be to test CountLocation(). Shown here from the Expression Builder:

Taking the later approach, if all the pieces of interest share a unique property (Marker or Dynamic Property) - let’s call it mainPiece - and you’re sending to a LocationName stored in property targetLoc, then hook the Send to Location off a Trigger Action with a condition of {CountLocation(targetLoc, "Main Map", "mainPiece") == 0} My example assumes that the target location is on a map called “Main Map”.

2 Likes

Many Thanks, I try it and come back soon (after christmas :slight_smile: )

It works !
that’s the magic of christmas
many thanks

1 Like