Summing properties and showing results on a different piece

What’s the best way to do this. The idea is to have the player enter values in several different pieces and have their sum appear on another piece in a different area/zone of the same map?

Various options to sum the values, assuming that they are stored in Dynamic Properties on each piece. In each case, display the result in a Text Label on the target piece. Here’s 3 I can come up with:

  1. Sum up the entered values into a Global Property as they are amended on the pieces.

  2. Use some variant of SumMap() to sum the value. Use the Expression editor to get help with this (calculator icon next to the value field, e.g. in a Set Global Property trait.

  3. From the target piece, form an Attachment to each of the different pieces. You can then access the values directly. This is easy when the attachment is formed 1-1, using properties of the form <AttachmentName>_PropertyName. For 1-many, you’ll need to use GetAttachProperty().