playMaker

Author Topic: Merging multiple arrays in Playmaker Editor  (Read 440 times)

Robiwan

  • Playmaker Newbie
  • *
  • Posts: 10
    • View Profile
Merging multiple arrays in Playmaker Editor
« on: December 02, 2016, 08:50:28 AM »
Hi. I'm building a game that has multiple arrays I want to merge into one big array.

Basically each array consist of about 40-50 elements. And there are about 5 of these to be merged into one array. All of these are already built by manually.

I know of the function called "copy array" (or something similar), but the array will be used as one array throughout the game existence so I dont want to make this array for each time the game is made.

Basically I could always build the array manually, but it's very time consuming (and boring).

I guess that each FSM represent a script and the variables would be declared at the beginning of each script. Is it a possibility to open the script of the FSM that contains the arrays and copy/paste the declaration of the variable to a new merged array, save and then open it in Playmaker editor?

Robiwan

  • Playmaker Newbie
  • *
  • Posts: 10
    • View Profile
Re: Merging multiple arrays in Playmaker Editor
« Reply #1 on: December 04, 2016, 07:23:46 AM »
*Bump*

Any tricks on how I can merge to arrays?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2278
    • View Profile
    • jinxtergames
Re: Merging multiple arrays in Playmaker Editor
« Reply #2 on: December 04, 2016, 05:16:18 PM »
Hi.
I am not sure if this is what you mean but you could loop each array using 'array get next' and in the next state us 'array add' and add to "merged array"
then loop back to the 'array get next' state.

do this for each array

mdotstrange

  • Hero Member
  • *****
  • Posts: 549
    • View Profile
    • Can't code? Who cares! Make games anyway!
Re: Merging multiple arrays in Playmaker Editor
« Reply #3 on: December 04, 2016, 08:34:47 PM »
If you use ArrayMaker you can use the Array List Concat action to do this.
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

Robiwan

  • Playmaker Newbie
  • *
  • Posts: 10
    • View Profile
Re: Merging multiple arrays in Playmaker Editor
« Reply #4 on: December 21, 2016, 01:43:49 AM »
Thanks for the replies, I've done some more testing and still need help on this.
I am not sure if this is what you mean but you could loop each array using 'array get next' and in the next state us 'array add' and add to "merged array"
then loop back to the 'array get next' state.

do this for each array
Yes, I know. But then this has to be run each time the game is run. Since this array will be a constant, I want to create one big array that doesn't need to be created each time I run the game.

Hope this clarify my inital request.
If you use ArrayMaker you can use the Array List Concat action to do this.

Same as above, this would have to be run for each time the game is running.

I want one big array that is pre-buildt before the game start.