Ternery Expression in a Dynamic Property

Hi all;
I have global property called NoseAmmoEmpty which can be set automatically to true or false using triggers. I am trying to get an incremental value to change according to whether the global Property is true (0) or false (-2) using the expression field in the Dynamic Property here…

The Expression used here is ; {((NoseAmmoEmpty == "true") ? 0 : -2)} I have also tried
{-2 * ((NoseAmmoEmpty == "true") ? 0 : 1)} The increment is supposed to be 0 when true and -2 when false. The Global Property is changing from true/false correctly but the Expression does not seem to be working at all.


Why did you quote “true”?

1 Like

If you mean using the quotation marks in the Expression the answer is because I never know when to use or not use them. Quotations seem to work best in Property Matches but elsewhere I try both with and without to see what works. In this case I tried both and they do the same thing. If you can point me to some documentation that clearly defines when to use “” and when not to use “” it would be appreciated.

Anyway, I found the solution and the short story is that the problem was not with the Expression but with the Trigger I used to set the GP to true. The command I had in the “watch for” list was Ammoswap it should have been AmmoSwap [sigh] :roll_eyes: