I am attempting to setup an assert() flag that will end the macro if the getToken() function does not return any valid targets. Problem is I am not sure what exactly getToken returns when it fails to retrieve any token ids. The output displays [] if I do a direct print of the variable and does not regester to json.isEmpty()as being a valid comparison.
Code: Select all
[h: loc.RangeSet = json.set("{}", "from", 2, "upto", 2, "distancePerCell", 0)]
[h: loc.conditions = json.set("{}", "unsetStates", "['Dead']", "visible", 1, "range", loc.RangeSet, "npc", 1)]
[h: startList = getTokens("json", loc.conditions)]
[r, if(startList == "[]"): "No valid targets in range."]