Report Action property match request

It would be nice to have a “Trigger when properties match” entry added to Report Action traits.

For example: I am adding tons of report action traits to a module of mine, but I would like them to activate only when the ObscuredToOthers=false on the given piece. Without having to double up with triggers, that is.

Have you considered a beanshell conditional in the reporting field of the Report Action trait? This would do what you’ve asked for as an example:

{ObscuredToOthers ? "" : "this message triggers when ObscuredToOthers=false"}

For most report fields, including the Report Action trait, the null value will result in no output. In my experience, some rare cases, like Change Property (maybe), output a new line, but these are rare uses and probably down to a Vassal bug.

3 Likes

I had thought about that but dismissed it thinking I could not avoid the empty line. That works just as you say, thanks!

1 Like