playMaker

Author Topic: How to put arrays into another array ? [SOLVED]  (Read 1442 times)

heyooo12

  • Playmaker Newbie
  • *
  • Posts: 3
How to put arrays into another array ? [SOLVED]
« 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 ?
« Last Edit: September 12, 2019, 02:15:05 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to put arrays into another array ?
« Reply #1 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

heyooo12

  • Playmaker Newbie
  • *
  • Posts: 3
Re: How to put arrays into another array ? [SOLVED]
« Reply #2 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
« Last Edit: September 12, 2019, 05:11:02 AM by heyooo12 »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to put arrays into another array ? [SOLVED]
« Reply #3 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

heyooo12

  • Playmaker Newbie
  • *
  • Posts: 3
Re: How to put arrays into another array ? [SOLVED]
« Reply #4 on: September 15, 2019, 10:41:47 AM »
Yes we didn`t understand each other but I made it work somehow ;) Thx anyway

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: How to put arrays into another array ? [SOLVED]
« Reply #5 on: September 15, 2019, 01:28:26 PM »
I think the OPs question was about multi dimensional arrays.