Forum Discussion
Storyline360 variables, calculating values with maximums
Calculations are performed via a series of triggers: one operation per trigger.
The attached file demos how this could work for your calculation.
It has two button sets: one set of 5 buttons to choose how many of Product A, and another set of 5 buttons to choose how many of Product B.
My number variables are called A_Cost and B_Cost. The buttons have triggers that first set the associated variable to the appropriate per-item cost. Then another trigger multiplies that by the quantity. (The buttons for choosing just one item don't need that second trigger.) Here's what all those triggers look like:
The button to calculate the Cart Total has similar triggers. The first trigger sets the Cart_Total variable to the value of the A_Cost variable. The second trigger adds the B_Cost value.
FYI: When you're editing triggers, every item with a dashed underline is editable. So, when adjusting a number variable, click "Set" to access the math operators.
Also note: I simply inserted a picture of your chart, and put buttons over that. That's fine for a quick demo, but not for accessibility purposes. You may have to set up your buttons differently. But I hope this gives you a good start on how to do it.