Forum Discussion
Jump to Slide %Variable%
Surely there is a way to do this. I can create a trigger for each state of the variable. But this requires creating a trigger for each variable state on every slide that requires it.
It would be much simpler to jump to a slide where the slide name or number is stored in a variable.
Anyone know if this is possible? If not, why has articulate not added this seemingly basic feature?
I found one reference to this but the link does not work. https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwjRo9CJ5biIAxUnFTQIHUtqACAQrAIoA3oECCUQBA&url=https%3A%2F%2Fcommunity.articulate.com%2Fdiscussions%2Farticulate-storyline%2Fusing-variables-across-layers-to-control-slide-navigation&usg=AOvVaw2QUoGqGnutCZS6kf66SDFH&opi=89978449
Articulate responds that I don't have access, or it does not exist. Hmm.
- Nathan_HilliardCommunity Member
Note: Since Articulate doesn't officially support JavaScript, this could change in the future, but...
Jumping around via variables requires JavaScript. Articulate has exposed the JumpToSlide() method under GetPlayer().
On any given Storyline slide, the built-in variable Slide.Id holds the slide ID. Record the IDs of the slides you want to use and assign them, as needed, to a variable named slideID.
From JavaScript, inside a trigger, fetch the value of slideID from Storyline:
var slideID = GetPlayer().GetVar("slideID");
then, jump to your desired slide:
GetPlayer().JumpToSlide(slideID);
- GarrisonWilliamCommunity Member
This is very helpful. I'll give it a try. Thank you!
- GarrisonWilliamCommunity Member
Nathan. thanks for your input. But I can't seem to retrieve any built-in variables whatsoever. I can retrieve project variables using GetVar. All built-in variables return NULL values.
var player = GetPlayer();
var anyVariable = player.GetVar("Slide.Id");
alert( anyVariable );The built-in variable for the slide ID is "Slide.Id" that returns NULL. I have tried other built-in variables and all return NULL.
If I use a project variable, it works correctly. Any idea why I can't retrieve built-in variables with JavaScript? I can retrieve those variables slides by typing %Slide.Id%
Thanks
- Nathan_HilliardCommunity Member
I don't think you can (or I don't know how) in JavaScript. To read or assign a built-in variable, you need to do it via a trigger in Storyline. That's why I suggested creating new variable slideID in SL. Set it equal to Slide.Id in a trigger, or set the value manually. You can also manually set up an array of text values in JavaScript and set it there.
- Jürgen_Schoene_Community Member
a hint
GetPlayer().JumpToSlide(slideID);
is only available on Review 360 (-> "dark-spider mode")
- JudyNolletSuper Hero
Re: "don't have access, or it does not exist." Pages on the old community site that didn't have any activity within the last 3 years were not transferred to this new site. In other words, that content is no longer available.
Re: "jumping to Slide %Variable%." The "jump to slide" trigger only accepts "prev slide," "next slide," or a specified slide.
However, you can add multiple triggers to the Next button that jump to different slides, and use trigger conditions so a given trigger will only run if the specified conditions are met. Those conditions could check variable values.
See this post for examples: TIP: Let the user choose their path | Articulate - Community
- WaltHamiltonSuper Hero
Programmers have wanting this function in every coding language since the early 80’s. The closest any language comes is the CASE statement (which is just a series of triggers). So I think that’s why it doesn’t exist in SL. I don’t think Articulate’s authoring tool is going to be the first to solve that problem.
Judy’s idea is not only the industry standard, it is your best bet.
- GarrisonWilliamCommunity Member
I've been using this approach for quite some time. It is very cumbersome as you have to create a trigger for every possible variable value. In my case, there are a dozen navigation paths and therefore every slide needs a dozen triggers. And in my case, every slide in a scene needs all 12 triggers in order to return the learner to their source path.
Not sure what you mean by programmers wanting this feature. Passing variables between modules seems like a pretty basic concept in programming.
- WaltHamiltonSuper Hero
Passing variables is not a problem.
Jumping to [variable contents] is the problem.
See Nathan’s post below for a method.
- GarrisonWilliamCommunity Member
I think i found that.
Thanks for your help.