I am trying to switch to a cone shaped sight temporarily to check to see if targets are within a certain area. I had originally tried with GetTokenNames() using offsets but it was too slow. The issue is that if I try to change the vision to a cone at the beginning of the macro, then run the getTokenNames() using the visible check, then set the vision back to a circle, the output of the macro is ALL tokens visible in the CIRCLE not the cone. even if I take the output before I change the vision back.
Here is an example campaign to illustrate the issue: Here is the macro I am calling from the token:
Code: Select all
[h: setSightType("Front")]
[h: cond = json.set("{}", "visible", 1, "owned", 0, "unsetState", "['Dead']")]
[h: names = getTokenNames("json", cond)]
[names]
[h: setSightType("Normal")]
Another thing I have just noticed which I'm sure is related is that If I remove the [h: setSightType("Normal")] from the macro is sets the vision to the cone properly, but it still outputs the full list of all tokens surrounding the center token on first run. The second time I run the edited macro it outputs just the 2 expected target token names. It looks like the vision change is happening at the end of the macro no matter where in the code it is called.