Need help with a complex randomizer

Basically I’m recreating the Vase Breaker from Plants Vs Zombies
For example there’s 15 vases,
I need each of those to have a random different selection of what’s inside them, no repeats, so there’s 15 options and each vase get ONE of them.
I have absolutely no clue how to make this work, (The vases are spawned btw)

1 Like

You can use starting value incrementing by 1 for each vase

No clue what that means, or where it would go.

Number(1) → (+) Number → (spawn)Spawn

So you want a number increasing from 0 to spawn the vase. So it will be spawned with;
1, 2, 3, 4, 5, 6, 7, 8, etc. Each time it is spawned it will get a unique Starting Value

You can get an object Starting Value with an Extractor.
The output from the Extractor should be the value that went into the “spawn” input.

Now each vase has a unique Starting Value ranging from 1-15. Now you will assign each number a unique item that you want to be dropped from the vase. The best way to do this is with a list, but if you don’t know how to do that you can use a router (but I would really recommend learning how lists work instead)

1 Like

If you’re spawning these in the same order each time and want to mix up which vase drops what, using a very simple list can solve this.

How to get random numbers for each vase

  1. Have a Number List with the values [1, 2, 3, 4, …, 15]
  2. Use the List Order behavior to shuffle the list.
  3. Set a Global to the shuffled list.

How to make sure each item is unique

  1. Using the Global to set a Number List
  2. When a player clicks the vase/whatever causes it to break get the Starting Value. (Make sure the starting value is set with the method I mentioned above)
  3. Connect Starting Value as the input into the “one” input on the Number List.