playMaker

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

heyooo12

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
How to put arrays into another array ? [SOLVED]
« on: September 11, 2019, 07: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 11, 2019, 11:15:05 PM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15318
  • Official Playmaker Support
    • View Profile
Re: How to put arrays into another array ?
« Reply #1 on: September 11, 2019, 11:14:54 PM »
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
    • View Profile
Re: How to put arrays into another array ? [SOLVED]
« Reply #2 on: September 12, 2019, 02: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, 02:11:02 AM by heyooo12 »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15318
  • Official Playmaker Support
    • View Profile
Re: How to put arrays into another array ? [SOLVED]
« Reply #3 on: September 12, 2019, 10:07:59 PM »
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
    • View Profile
Re: How to put arrays into another array ? [SOLVED]
« Reply #4 on: September 15, 2019, 07:41:47 AM »
Yes we didn`t understand each other but I made it work somehow ;) Thx anyway

tcmeric

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