I have this conditional expression : usingcvps==“No”?(gameyear>=1944?1:gameyear>=1942?2:3):3
It works, but the use of two instances of the ‘default’ value of 3 somewhat ‘offends’ me. I ask you knowledgeable people of this forum is there a better way of doing that expression so there is only default of 3?
As a bit of background, World in Flames has CVs (Carriers). Each CV has an at start air component value. This value increases by 1 in JAN/FEB 42 and by another 1 in Jan/Feb 44. But only if not playing with CV Planes (aka the usingcvps condition).
There are times when I just cannot see a tree because the forest hides it.
You could write it this way, but I’m not sure it’s clearer:
usingcvps == "No" || gameyear < 1942 ? 3 : (gameyear >= 1944 ? 1 : 2)
Joel, many thanks for you quick response. Sadly, the usingcvps==“No”, is a singular condition. The others are results if that condition is true. But you have opened, perhaps, another avenue of thought there.
I did forget to add that the expression decides which layer level to display.
For ex, a CV that comes onto the map with a 3 aircomponent level in 1941, increases to 4 in JF42 and then 5 in JF/44. The numbers 1,2 & 3 relate to the images for the base level at 3 and the increased levels at 2 and 1.
But what if?
Logic check here now. But I think, with your help Joel, got it.
I should have had this instead:
usingcvps != "No" || gameyear < 1942 ? 3 : (gameyear >= 1944 ? 1 : 2)
That’s not syntactically correct. You have three
? but only two
Works? Maybe a longer expression, but more definitive.
But, I suddenly remembered that the amend all contained counters has a very nasty foible. You change a common trait to all those contained counters, every counter will inherit exactly the same trait. All based on the first counter in that folder. You can add/delete traits, but trying to amend a common trait (each with their own level pics) will lead to disaster.
That is, if the first CV in a ‘container’ (folder?) has a 3/4/5 air component layer trait based on the game year, then every other CV in that ‘container/folder’ will also have the same layer trait post the amend all contained counters edit. That outcome is a way bigger problem than getting the conditional expressions better and amending the expression for every CV in the game. So, and apologies to Joel, in particular, for asking a question that is basically shot to shite before I even posed the question.