I looked for an answer before posting this and couldn’t find any other threads about it, so I’m sorry if this has been answered elsewhere.
I was wondering if I could get some help with the expression to get a property from a piece in a given area/zone. GetProperty(map,zone,whatever) doesn’t work. I’m assuming it’s trying to find an area property, not a property from a piece inside it. So… How do I get to call a piece property inside a given area? Just as an example… Say the board has several areas to be conquered and I need to get, for instance, the “Influence” property from the piece inside Area1. How would I write that expression?
Thanks for the attention!
You have to do it indirectly, through a Global Property (GP):
- Create a GP to temporarily hold the value.
- Add a Global Key Command (GKC) to the piece that wants to retrieve the value, targeting the piece that you want the value from.
- Add a Set Global Property (SGP) to the targeted piece, triggered by the GKC, which sets your GP from step 1 to equal the local property you want.
Now, when you want to retrieve the value, you trigger the GKC then read the value of the GP.
Thank you. That seems like it’ll work. It’ll also be a lot more effort than I thought, considering the value also changes in the piece itself (but nothing a few Trigger cascades won’t solve at that point to recapture the value onto the Global Property). I’ll give it a try when I find the time this weekend.
Thanks again for the help!