# Need Help with Variables, Please!!

Hi There,

I have a scenario simulation which gives users different paths to take depending on the choices they make of how to handle different customer service scenarios. Based on their choices, they can make a score of 1-10, for example - Answer A = 2 points, Answer B = 5 points, Answer C = 10 points. I've added number variables with values to each of these possible answers, so that when the user gets to the end, they can see how they did... I'm just stuck on the Variable "Total" and how to add up the values so users can see their total score. Can you please help? Thanks!!

###### 7 Replies

Hi Chrisanna,

You will need to add 3 triggers (1 for each score; 45Days, 60Days and 90Days) to the results slide to adjust the 'Total' variable. For example;

Variable: Total

Value: Variable (select 45Days)

When: Timeline starts

Object: 5.2 Results

This will then give the user a combined total.

I hope this helps and nice course BTW

Antony

Here is a quick picture of what Anthony was talking about.

Just do this for 45, 60, 90 day periods to keep adding to the total.

Okay, I did this and it works great, but now I need to make sure the values go back to zero when the user "Tries Again." From StoryView, I made sure to set each of the "Pick One" slides to "Reset to Initial State Upon Revisiting," but that didn't seem to work. Is there another variable or condition I'm needing to set to ensure the values don't continue to add on top of one another if the user is going through the scenario multiple times?

Thanks again, everyone.

Hi Chrisanna,

Unfortunately, I cannot open your .story file from your earlier post and I can't quite remember how you have your project set up, but assuming that you have a [Retry] button on the result slide, you will need to add a further 3 triggers to this button to reset each variable. For example;

Variable: 45Days

Operator: =Assignment

Value: Value (input 0)

When: User clicks

Object: [Retry button]

When adding these triggers, you will need to make sure that they are above the trigger that jumps back to the start of your scenarios in your trigger panel - SL executes triggers from top to bottom, so you want to ensure that the variables are reset before you move to another slide.

I hope this helps but please feel free to post back if you have any further questions.

Antony

Hi Chrisanna! Looks like Antony and Jerson have you taken care of here, just let us know if you need anything further.

Thanks guys!