I’ve not used the Math.max before, but it looks handy.
In my case though, I want to calculate which of 6 properties has the highest value, and output that value for use in another trigger. Specifically, which of 6 decks has the highest deck_numPieces for an automated step of bookkeeping.
Is there a simple solution?
What I have come up with, assuming the deck names are A~F
Calculated property MaxAB: Math.max(A_numPieces,B_numPieces)
Calculated property MaxABC: Math.max(MaxAB,C_numPieces)
Calculated property MaxABCD: Math.max(MaxABC,D_numPieces)
Calculated property MaxABCDE: Math.max(MaxABCD,E_numPieces)
Calculated property MaxABCDEF: Math.max(MaxABCDE,F_numPieces)
This last gives me the highest number (only)
Calculated property BiggestDeck: A_numPieces==MaxABCDEF ? “DeckA” : B_numPieces …
This gives me a deck with a number of pieces matching the maximum number, but fails to randomise among decks that are equally large, and that’s also something I want to do. Or, at least, maybe I’ll randomise, maybe I’ll give players the choice with a popup.
Any help most appreciated.