Unique random generator to show slide layer

Hi!  I have already been through several posts - and I'm using the random number generator to generate a number to correspond with slide layers:

var randomnumber = Math.floor((Math.random()*8)+1);
var player = GetPlayer();
player.SetVar("rndNumber",randomnumber);

What I'd like to do is improve this so that once it shows a particular layer, it won't show it again... 

I am HORRIBLE with Java - so hoping someone can help? I've attached a screenshot to hopefully illustrate what I have done so far!  Thank you in advance!!

 

5 Replies
Christina Heilig

Kristin,

I'm also searching for this solution. I figured out how to make the used layer not appear again, but I don't know how to automate the random number generator to "re-roll" the dice after noticing the layer has already been displayed. 

Thinking aloud...

How do we reset the available numbers from which the generator pulls? And if that is a possibility, how do we reassign that smaller pool of numbers to the remaining layers?

Would a True/False check of some sort work? 

What else could work?