Changing State of object using a variable
Oct 24, 2012
By
Rich Lesser
I have a course that has a main navigation screen with branching off that screen. When a student completes a section (that is set up as a seperate scene) it navigates back to the main navigation page so they can choose another option. On the bottom of the screen I have objects that change color to show the section has been completed. I wrote a variable with a value of 0. When the user clicks the next button on the last section page it changes the variable to 1. I then have a trigger to change the state of the object to show the "completed" version. when the variable is = to 1 or greater. Problem is the object is not changing states to show completed. Any body else have an issue like this??
Thanks!
23 Replies
Hi Rich,
You probably need to define the action triggering the state change. In your example I would probably write my trigger like this :
Change state of object looking complete / when Timeline Starts of object Main navigation slide / If Variable section complete Equal or greater to 1
Often, this is the "When" that is misunderstood, it needs to be an action.
Hope it helps and have a nice day!
Annie
Annie,
Thanks for the reply, but it still does not work. I have the trigger established on the navigation page that when the variable changes to =or >1, the state should change. We even added a text box that displayed the variable value on the navigation page and the variable changed correctly to show =1, but the object state still did not change...
Thanks
Can you post your file or a screen shot of your trigger?
It should look like this in the trigger dialog box :
AS Annie say's it must be a when timeline starts trigger and not when variable is changed. This is because the change has not happened on this slide but on another. So the variable is not actually changing.
Annie- see below:
The problem is the When...
When do you want to change to be made? When the user comes back to the main navigation slide or, if you prefer, when the timeline of the main navigation slide starts.
Storyline doesn't look at the variable at all time, you must tell it to look at the variable to see if it changed at a precise moment, that's why you identify the moment or action that makes it look at the value of your variable.
Hope it helps!
Phil,
How do I have a user perform an action on 1 slide that changes the value of a variable and when the user moves to another slide, an elment on the new slide changes based on the variable change. I was under the impression that variables are not page specific, but apply to the entire course...
Thanks!
A variable is a way of storing information. The when variable changes is a slide specific trigger because it is listening for the variable to change. If you want something to change on the slide you are on when a variable changes you would use that trigger.
If the variable does not change on that slide, then you need to find another way to change the object, this is because the variable did not change on this slide. Annie's suggestion to use when timeline starts is correct because this trigger fires every time the slide loads.
Phil.
Tried the timeline, did not work either.. any other ideas?
I would check that your variable is actually changing, add reference to see it change, also make sure that the trigger to change a variable is before the trigger to jump to a slide because no triggers fire after jump to triggers
If you want, you can post your file and we can take a look at it.
The last recommendation from Phil actually worked! the variable change was after the trigger..moved that up, and changed the when to the timeline..
Thanks All!
Glad it works, have a nice day!
What happens if a slide has a "jump to" trigger and also a "change variable" trigger? Does this mean that the change variable trigger wont work on that slide?
For example, I made a simulation, and when the user clicks next, it adds 1 to a variable, but it also jumps to a particular slide depending on what the variable is.
I'm also having some similar trouble. I set it up as you mentioned. Have the "when timeline starts" ------> Display State A --------> if Variable is =1. But sometimes it just comes up blank on the screen, and when i hover over and click on the object, it pops up. Ever encountered this issue?
Hi Deniz,
Triggers are executed in the order that they appear - so you'll want to check the order within the trigger panel. I'm not sure I fully understand your set up though - are you able to share a few slides of your .story file here with us?
I spent about 7 hours working on this! I love that all this is documented and easy to find! Happy Dance!
Hi Renee,
Glad that this helped you out and thanks for sharing here.
man, I've been fighting with this same problem for a few hours now... this thread help a lot!
my problem was that i was using "change variable" instead of "timeline starts"!
sooo, thanks!!!
Glad that you found value and assistance in this thread as well Michel! Thanks for popping in to share.
I have read through this post and still cannot make my project work correctly. I have the Next button set as disabled when the timeline starts. I want the user to click on each chess piece to navigate to different slides. After clicking each, the Next button should be normal. I have tried several things and it just isn't working. Any ideas would be greatly appreciated!
Hi Tammy
try changing your second trigger to this:
That worked! Thank you!
Glad to hear you got it working - good luck with your project
This discussion is closed. You can start a new discussion or contact Articulate Support.