So, I was debugging a script where one part seemed to not be finding screen images that should be matched, and I was investigating this using the "Display" feature, that tells you whether, and where, an image matched on screen.
This behaved in a way I found non-intuitive (which is why it caught me out). Consider the following action:
The "If" block sets a variable if both the image is found onscreen, and the current variable is empty. I wanted to debug this, and turned on "Display", and run a test, and what I expected to see is the correctly matched image flash green on screen, so I could see the image was found, and therefore the problem I was having was not connected to failed image matching.
However, instead I see no matches, indicating that the image was not found on screen (leading me to try and figure out why). Even though the image actually was correct, and was matched OK.
Only if I cleared the variable currentPatchCategory, so that both if conditions were true, do I get a visible confirmation the image was found onscreen when testing this action - which makes the "Display" dependent somewhat on the if condition, and other variables, which is the non-intuitive behaviour I mention.
I would expect that the "Display" checkbox, to tell you whether an image was matched onscreen, should be local only to that screen image search step, and not be dependent on the other conditions in the If - because the Display is only there to visually show image matches, not to visually illustrate the sum of all your logic in that if block.
Has anyone else run into this?
(Ok, now I've posted this, I'm off to read the documentation again to see whether this behaviour is explained and expected.)
Thanks!