Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: heyooo12 on September 11, 2019, 10:41:44 AM
-
I have 3 different arrays that represent different sequences of activations of game Objects... Now, I would like to somehow put those arrays in another array and then suffle it so I can pick those sequences(arrays) randomly ?
-
Hi,
it's indeed missing, I just make a custom action for this, it's on the ecosystem:
ArrayConcatenate.
https://twitter.com/JeanAtPlayMaker/status/1172030317403750400
shuffle and pick is already available as actions. So you'll be fine with this.
Bye,
Jean
-
Yes thank you for adding that to the ecoSystem, but I still have a problem...If I store arrays into an array which you made possible, and I shuffle that array, I still can`t use ArrayGet action, because I can only store value ( the array which i pick from shuffled array) as a variable ? I would have to have an option to store value as an array, to use that array further. thx
-
Hi,
you lost me here :)
you can't pick an array from an array, you can only pick a given value from an array, so to get a random value from an array, you use the action ArrayGetRandom and that's it.
if you need to store multiple random values from your shuffled array into yet another array, then you simply iterate x times, pick x times a random value and add it to the final array.
now if you don't want to have duplicated values, you always need to delete the value you picked from the shuffled array so that you don't randomly pick it twice.
Bye,
Jean
-
Yes we didn`t understand each other but I made it work somehow ;) Thx anyway
-
I think the OPs question was about multi dimensional arrays.