Forum Discussion
Adding or Sum of Variables. Possible?
I'm making a simulation type game in storyline which has branching to different paths based on 3 different choices.
I made a variable called "Money from Company A", and i want this to be updated based on a given choice.
So let's say for simplicity:
Choice 1 - 10$
Choice 2 - 5 $
Choice 3 - 1$
If we have 5 questions in total, the maximum score should be 50$, and the minimum 5$, with a bunch of other possibilties.
The problem i was encountering was when a user is on the screen, and selects choice 1 then changes their mind to choice 2, the triggers i have set still add the points up. So a user can get more than 10$ on a question if they keep switching between choice 1 and choice 2.
I overcame this by making the variable change only when the user clicks the "submit" button at the end, so they have left the slide, and cannot change their answer.
All good up until this point.
But I was wondering whether or not I could calculate the sum of different variables, if I decided to add another company into my scenario? So in the results slide, I could show a total of the money earned from the two companies.
is there a function that could do %Money from A% + %Money from B% ? Or Sum(Variable1, Variable2)?
The only solution I have now, is to display the two variables in the results slide, and have the person add it up manually.
Deniz
- GustafSylvinCommunity Member
Thx Phil.
Exactly what I needed.
br
gustaf
Hi Gustaf! Glad you were able to find assistance in this thread. thanks for sharing
Hi Daniel!
You are welcome to share any feature requests via this link :)
- DANIELGIMNESSCommunity Member
Thanks Leslie!
- MarcusRummlerCommunity Member
Thanks guys and girls, I've found this post very helpful!
Glad that this older post was able to assist you as well Mimi :) Thanks for popping in to share.
- JorgProbstCommunity Member
Thank you, Phil, your example file was such a time saver!
Glad this was able to assist you as well Jorg :) Thanks for popping in to share.
- RozbudCommunity Member
Hi Susan,
As DANIEL said, it's tedious!
Your javascript doesn't add variables, but just put them close together (1+2=12).
Adding variables feature should be essential.
- MarkTurnerCommunity Member
Exactly what I was looking for. Thanks a lot Phil!