random specific numbers?
POM
Member Posts: 2,599
hey is there a way to make a change attribute behavior to a random number from a specific list?
like-
change attribute ZZZ to random of 2,5,9,35,67
and not just min and max
could not figure it out hope you can help me..
like-
change attribute ZZZ to random of 2,5,9,35,67
and not just min and max
could not figure it out hope you can help me..
Comments
change attribute Z to random(1,5)
if Z=1 then change attribute ZZZ to 2
...
if Z=5 then change attribute ZZZ to 67
This would suck if your list of numbers is really long, but otherwise it would work!
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
it's such a simple task yet we can't do it..
Maybe the GS guys will add this option in a later version
ie...
set an attribute to tempRandomValue (tRV)
then changeAttribute tRV to random(1,3)...this splits the 30 numbers in thirds
then have 3 rule branches (1 for each result)
when tRV = 1
then tRV= random(1,5)...this splits the 10 numbers (of the third set into fifths)
when tRV = 1
then trV= random(1,2)...this splits the fifths in half.
when tRV= 1
.......ZZZ = 2 otherwise ZZZ = 5 (this assigns the first 2 values of the 30)
repeat each branch and sub-branch of the tree.
It is tedious...but it works! Plus its efficient as it only take 4 processing steps to get the sequence number vs...30 rule checks for the random number assignment.
In open coding...you can do this as a function or an array or whatever...but in GS...you have to use rules.