i have been trying to think of ways to get the 22 different amounts in to the boxes with out them being the same as some of the others. i am doing this with logic bricks as i can not python script to save my life. any help or ideas would be very appreciated :eyebrowlift:
As this requires a dependency between the boxes, I think the best is to do this with Python.
Monster is right, you should use Python to do this. A very simple and effective method would to treat the boxes as a list. You can then randomize them using random.shuffle like so:
import random
# this is the list of 22 cash prizes in your game
boxes = [0.01, 1, 50, 100, ... 1000000]
# now randomize them
random.shuffle(boxes)
# now all you have to do to see what's in a box is just index the list
# I chose box 4
prize = boxes[4]
Here is a working example.
It basically creates a list of random values which matches the number of objects to receive them. The values are unique. Each value gets distributed to one receiver.
The blend shows two examples:
A) integer values at Font Objects
b) float values at Mesh Objects
Attachments
distributeRandomValues.blend (398 KB)
Thank you Monster for taking the time to help me but i have tried your example and it won’t work for my needs the generated values are not randomized when the min is 1 and max is 23 and their are 22 text values. the generated values stay the same every time i press play.