Variables
Jan 15, 2015
By
June Ganes
Can someone tell me if a variable will go into the negative? I'm creating a game with a point system for each question; if the answer is right they get 5 points and if the answer is wrong it will minus 5 points. The first slide if the answer is wrong the variable does not change so I was thinking this may be the problem.
Thanks,
June
18 Replies
They should go negative unless you have a condition to prevent this
Yes, if you keep subtracting values from a numeric variable, it will eventually have a negative value.
Do you have any idea why the first slide will not subtract the points?
If you post your .story file here, we could have a look.
Can you post a slide without seeing the triggers there can be many reason, but it is likely trigger order
Have not added a story file before I will have to search on how to do this. Thanks
This post was removed by the author
@June: You should share the .story project file, not the published content. To share your file (or a portion of it) here, click the Add Attachment button the bottom of the post window and select the .story file.
This post was removed by the author
This post was removed by the author
Still not quite what we need to look at the variable setup :-). You need to attach the actual Storyline project file (the one you wok on in Storyline. It has the .story file extension.
This is embarrassing, one more time...
I can open the file. I just don't know what's supposed to happen. I can select a game piece, I drag the game piece to the first position and then what?
When you choose the Hat game piece it will go to a question, select all the choices to get an incorrect answer. When this happens it does not subtract the points.
I'm probably missing something here, but when I get an incorrect answer for Question 1, 6 points are subtracted, as I would expect.
Shouldn't it be -6 instead of zero? Since this is the first slide the first incorrect answer would be -6 or am I wrong?
The Default value of your Points variable is set to 6. With that, a correct answer for the first question would result in 12 points, while an incorrect answer would result in 0 Points. If you want 6 points for correct and -6 for incorrect, then you need to set the default value of your variable to 0.
Thank you so much for helping me, I hope I'm not driving you crazy. I understand what you are saying but I'm confused on the default setting. The trigger states Add value of 6 when user clicks which is what I want it to do. Should I change the 6 to zero and if so how does the value get the points?
Michael, thank you so much for all your help I found the default setting in the variable. You are truly a Hero!
You can't drive me crazy, I already am! :-) I was referring to the default (aka 'starting value') value that is set in the Variable edit window. To open that window, click the 'X' button I the Trigger panel, select the variable and change its value, e.g. to 0.
Hello June,
Glad to see you got this sorted out. let us know if you need anything further!
This discussion is closed. You can start a new discussion or contact Articulate Support.