# triggers with conditions not working

Jun 14, 2021

So this one has me absolutely stumped and I could use more than just my eyes on it:

This is for a game. Scoring is done through 2 variables. Results are determined through a combination between the 2 variables. When the game gets to the final screen, the game should produce a result by making an item "normal" when the timeline starts according the score of the variables.

I attached a Story file with just the slides that are killing me. Slide 1 - choose a number -3 through 3 and select the "Final Round" button and what should happen is the result should show on the top of the second slide.

###### 3 Replies

Ben,

When I created a chart of the conditions, I was able to figure out what at least one of your problems is:

When the timeline of the second slide starts, all triggers are evaluated every time. Those whose conditions are true are executed. When Overall Score is  - 3,  Pos - will show, then as the system continues through the triggers, it turns out that  - 3 is < -2, so Pos -- is shown, covering Pos -.  The same is true when NEG4 is -3. Depending on what Overall score is, one of the Med objects will show, then be covered by the corresponding Neg object, because  -3 is less than  - 2.  Changing them to "between - 1 and - 2" might solve that problem.

I didn't check for other problems, but I'm pretty sure they exist or will exist. I tested one combination (wasting time before I made the chart), and it didn't show any object, but I don't remember the combination that caused it. You will need to check that every possible combination has triggers to show the correct object.

I'm guessing that when the learner gets to this point, they will have answered other questions, which is why clicking here adds points to the totals.  Adding to a total every time a button is clicked is a huge risk, if the learner should idly click numerous times. Even if they change their mind,and try to innocently click a new choice, the total is invalid.

Far better to make the negative buttons a button set, and the positive buttons a button set. That way only one of them can be selected at any one time. Then when "Final Round" is clicked, before you jump to the next slide, calculate the final total. Do this by checking each button, and if it is selected, add the appropriate number to the total.

Hi Ben,

In addition to what Walt has mentioned above, I also noticed that, in some cases, you have conflicting triggers. In the example below, if the OverallScoreNed4 variable is -3, both the highlighted triggers will activate:

This is also the case if the OverallScoreNeg4 variable is -3 in this example:

This is why you are sometimes seeing more than one result showing.

In addition, you have provided no option for when Neg4 = -2, which is why, when selecting +2 on slide 1, there is no text visible on slide 2.

I have made an attempt to illustrate the problem with the following chart, where I have used different colours for each of the first three triggers to highlight the areas they affect. I have then added gradients and dashed outlines where the triggers overlap. I have also shown the significant overlap that then occurs when trigger 4 is added. Looking at this, I would suggest that you may have got confused between "greater than" and "less than" when working with the negative numbers.

Hopefully you can successfully implement something along the lines of what Walt has indicated above as your current variable system is a little confusing, so I am not surprised it is giving you some problems. When working with variables, simple is good.

Appreciate the feedback. Actually the problem I was seeing was not double results, it was no results. The more I test, the more it seems like the issue is focused around the trigger conditions that are between A & B.

Iterative process led to me the conditions in the triggers using only <> symbols since I was using real numbers, which caused problems, so I went to integers. So, it wasn't until i was trying to explain further what I was seeing that I realized that trying to express A is between -1 & -3 instead of a = -2. That resolved everything.

Thanks