Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: heyooo12 on September 11, 2019, 10:41:44 AM

Title: How to put arrays into another array ? [SOLVED]
Post 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 ?
Title: Re: How to put arrays into another array ?
Post by: jeanfabre on September 12, 2019, 02:14:54 AM
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
Title: Re: How to put arrays into another array ? [SOLVED]
Post by: heyooo12 on September 12, 2019, 05:08:37 AM
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
Title: Re: How to put arrays into another array ? [SOLVED]
Post by: jeanfabre on September 13, 2019, 01:07:59 AM
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
Title: Re: How to put arrays into another array ? [SOLVED]
Post by: heyooo12 on September 15, 2019, 10:41:47 AM
Yes we didn`t understand each other but I made it work somehow ;) Thx anyway
Title: Re: How to put arrays into another array ? [SOLVED]
Post by: tcmeric on September 15, 2019, 01:28:26 PM
I think the OPs question was about multi dimensional arrays.