This should work:
I’m using Switch 2 and Switch 3 to trigger four things in a row, through a timer.
I want to use Switch 1 to trigger either Switch 2 or 3 but I want it to trigger 4 times in a row, each time.
So I need to get either 0 or 1 randomly, but to count up 4 each time - so that the Switch 2 (connected to pin 0) will trigger 4 times if 0 comes up and Switch 3 (connected to pin 1) will trigger 4 times in a row if 1 comes up.
Any ideas?
Why not just using a branch for switch one?
If I use the random bool it’ll go randomly between Switch 2 and 3 - I need to get it so if it goes to Switch 2 first it’ll trigger four times in a row, or if it goes to 3 it’ll trigger four times in a row.
The four wires going into the first sequence trigger one after another through a timer - I need to get the first switch to go either 0 four times or 1 four times in a row - or some other way that I can randomly go between Switch 2 and Switch 3, but always firing four times in a row - so that modules of a semi random music system will play in sync.
The four audio components on the left need to synchronise with four audio components on the right, but there are two possible sequences that can occur.
You can. You’d still need to roll the dice somehow, though. There’s like 10 ways of doing this, anyway. Was sticking to what OP had already. Not sure what is planned for this further down the line.
Besides, I feel this node is underused so I mention it every time I have a chance ;p
I need to get it so if it goes to
Switch 2 first it’ll trigger four
times in a row, or if it goes to 3
it’ll trigger four times in a row.
This is precisely what the code I posted does… Did you test it? When an impulse is sent to switch #1 and pin 0 is selected, the script will iterate through a loop once - the loop is 4 elements long so it will trigger switch #2 4 times in a row. The switch will pull the Index2 from the 4Array0 and fire one of its pins 4 times.
Did you want to fire the switch’s #2 and #3 pins consecutively instead?
By the way, your random integer is set incorrectly, it starts at 0. Now you have a 33.3% chance to trigger 0,1 or Default at switch #1
Sorry Everynone, I should have been more clear. Because the impulses from the audio components are on a timer, they send in 2 second intervals - so the impulses received by either switch #1 or switch #2 are arriving one after another, not at the same time, meaning the bool randomises with each impulse. I’m trying to get it so that if it goes to switch #1 first it will fire four times in a row, along with the two second timer or if it goes to switch #2 it will fire four times in a row.
I’ve made a video to clear it up
In that case, generate the random for #1 earlier, store it in a variable and use it 4 times. And only re-generate the random when necessary.
That’s what I’m trying but can’t figure out the BP needed!