Understanding Complex Trigger Actions

Hi Mike,

Why do you run things in an IDE? What do you hope to learn from that?

In your Global Properties definition, enable Is numeric. Then set the starting value to false.

The {...} says to evaluate the contained code as a BeanShell expression, so those should not be removed. It seems like your Change-Property Toolbar Button expression is messed up and is interpreted as a string. Did you put {...} around it:

{!AmmoPressed}

so that it is evaluated as BeanShell expression? Anywhere you want an expression to be understood as a BeanShell expression, you need to put {...} around it.

You could, of course, set the initial value of AmmoPressed to 0, and in your Change-Property Toolbar Button expression have

{AmmoPressed == 0 ? 1 : 0}

and in your Layer trait follow expression

{AmmoPressed != 0 && LowOnAmmo ? 2 : 1}

I think that’s because you probably didn’t enable the Is numeric check-box in your global property.

BTW, check How to format forum posts - a bit of formatting can make your posts much easier to read and understand your problem.

Yours,
Christian