Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Robiwan on December 02, 2016, 10:50:28 AM

Title: Merging multiple arrays in Playmaker Editor
Post by: Robiwan on December 02, 2016, 10: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?
Title: Re: Merging multiple arrays in Playmaker Editor
Post by: Robiwan on December 04, 2016, 09:23:46 AM
*Bump*

Any tricks on how I can merge to arrays?
Title: Re: Merging multiple arrays in Playmaker Editor
Post by: djaydino on December 04, 2016, 07: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
Title: Re: Merging multiple arrays in Playmaker Editor
Post by: mdotstrange on December 04, 2016, 10:34:47 PM
If you use ArrayMaker you can use the Array List Concat action to do this.
Title: Re: Merging multiple arrays in Playmaker Editor
Post by: Robiwan on December 21, 2016, 03: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.