Forum Discussion
Is there a way to randomly select a scene?
Hey Jay,
I think the random variable option could be a good fit. I have attached a quick mockup of something that could possibly work.
Ron,
Thanks much for the example. It kick started my thinking about how to do what I want to do. I'm going to use your example, but now I need to dust off my JS knowledge and create a script that will generate three random numbers.
thanks again!
Jay
- MathNotermans-93 years agoCommunity Member
That part is easy.
https://360.articulate.com/review/content/ef03fcd8-c587-4313-9bdf-97dc94537e46/review
And here is the Storyline of that sample.- JayCooper3 years agoCommunity Member
Thank you sir!
Like I said before...I need to brush up on my JS as it's been awhile. The rest of what I need to do is assign the three random numbers to three variables within Storyline.
In the script you sent, what is ([...nums]);? Is that identifying the values within the set as numbers?
- MathNotermans-93 years agoCommunity Member
Yes an array with the 3 random numbers in it. I set it to 1 variable now...you can easily assign the 3 values to 3 separate variables.
Added it to the sample now.
Basically this is how you get a specific value from a Set.player.SetVar("val1",[...nums.values()][0]);
Updated in the sample and here is the Storyline.
Sets have the specific quality that they never can have duplicate values in it. Only unique values allowed.