Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Rabagast on August 15, 2015, 05:56:36 PM

Title: Arraymaker Duplicate
Post by: Rabagast on August 15, 2015, 05:56:36 PM
Hi!
I have an Arraylist with 4 differents objects. They have the colors Blue, Green, Red and Yellow. What I want to do, is to duplicate each of this 4 objects, so it will be two of each object in the scene when I create them. Like in a memory game. When you need to find two matching objects.
Is it a way to do this?
Title: Re: Arraymaker Duplicate
Post by: jeanfabre on August 16, 2015, 01:53:54 PM
Hi,

 There is no built in Actions to duplicate contents in the Scene.

As is, simply iterate trhough the list using "ArrayListGetNext" and use the action "CreateObject" Action using the current item in the loop as the source for the object creation. Usually you would reference a Prefab, but in this case it works too.

 Bye,

 Jean
Title: Re: Arraymaker Duplicate
Post by: Rabagast on August 16, 2015, 04:22:48 PM
Hi, Jean!
Thanks for the answer.

If I loop the ArrayListGetNext, it just add the next item in the list
I tried with ArrayListGet and always use index 0. Then I remove the item in the list every time I loop it, so it will add each item twice, but I got some few problems.
Title: Re: Arraymaker Duplicate
Post by: sebaslive on August 17, 2015, 10:42:33 AM
you can also reset using array list get next by setting the reset to true, that way it will start at 0 again.
Title: Re: Arraymaker Duplicate
Post by: Rabagast on August 17, 2015, 11:32:50 AM
I still having problems to duplicate each object. The only thing I want is to create two of each objects in the scene. Like in a memory match game where you need to find two matching objects. I'm very close to make it. It's just few problems. ​​

Array List Get will always be at index 0, but this has no LOOP.
Title: Re: Arraymaker Duplicate
Post by: Rabagast on August 17, 2015, 02:43:52 PM
I got it to work! :)

Now I only nee to make the logic. To open the cards and close it when it doesn't match and so on. :)
Title: Re: Arraymaker Duplicate
Post by: jeanfabre on August 17, 2015, 04:58:16 PM
Hi,

 Excellent! Never giving up is key!

Bye,

 Jean
Title: Re: Arraymaker Duplicate
Post by: Rabagast on August 17, 2015, 05:01:11 PM
Stubborn is my middle name! :)
Title: Re: Arraymaker Duplicate
Post by: Rabagast on August 17, 2015, 05:05:15 PM
Just one thing, Jean!

Do you know when Arraymaker will be updated? I can't use Array List Add Range. I get an error. So I need to add them in the Inspector window "Prefilled Data"
Title: Re: Arraymaker Duplicate
Post by: jeanfabre on August 18, 2015, 02:11:47 PM
Hi,

 can you refresh my memory on this issue? Is there a thread o nthis already?

Bye,

 Jean
Title: Re: Arraymaker Duplicate
Post by: sebaslive on August 18, 2015, 03:38:49 PM
Hey Jean, its an error with the current arraymaker. The Array List Add Range action is currently not working as expected. It does not show the variables in the array.
Title: Re: Arraymaker Duplicate
Post by: jeanfabre on August 18, 2015, 04:20:00 PM
Hi,

 Using the PlayMaker Beta or current Asset Store version?

 Bye,

 Jean
Title: Re: Arraymaker Duplicate
Post by: sebaslive on August 19, 2015, 11:48:24 AM
Current asset store version.
Title: Re: Arraymaker Duplicate
Post by: Rabagast on August 19, 2015, 03:33:25 PM
Hi,

 can you refresh my memory on this issue? Is there a thread o nthis already?

When I add "Array List Add Range" in a FSM, It does not show the variables in the array as sebaslive said, but also when I use "Array List Get Next", I get this error:

The fsmVar value <UnityEngine.GameObject> doesn't match the value <HutongGames.PlayMaker.FsmVar> on stateState 2 on fsm:FSM on GameObject:GameObject.

If I add the variables in the Array List Proxy in the Inspector window, then everything works find. At least I don't get this error.
Title: Re: Arraymaker Duplicate
Post by: jeanfabre on August 19, 2015, 09:25:21 PM
Hi,

 oh, yes, I can repro this, I get it now. Let me see what's wrong, I'll get back to you when this is fixed I am travelling until monday, so don't worry if I don't get back to you before.

Bye,

 Jean
Title: Re: Arraymaker Duplicate
Post by: jeanfabre on August 19, 2015, 09:50:33 PM
Hi,

 ok, found the issue, I corrected the Action ArrayListAddRange, now everything should behave properly including accessing these newly added data ( data was corrupted).

 Bye,

 Jean
Title: Re: Arraymaker Duplicate
Post by: Rabagast on August 19, 2015, 10:55:53 PM
Thank you Jean! Will it be available on the Ecosystem soon? :)
Title: Re: Arraymaker Duplicate
Post by: jeanfabre on August 20, 2015, 12:46:25 AM
Hi,
 
 It is already (https://twitter.com/JeanAtPlayMaker/status/634181594903785472) :)

 Bye,

 Jean
Title: Re: Arraymaker Duplicate
Post by: Rabagast on August 20, 2015, 12:52:45 AM
Ah, so nice! :) Thank you! But do I need to update Ecosystem? Because it says there that it's already imported.
Title: Re: Arraymaker Duplicate
Post by: djaydino on August 20, 2015, 01:49:01 AM
Hi,
you can press the delete button and then you can import it again
Title: Re: Arraymaker Duplicate
Post by: Rabagast on August 20, 2015, 02:15:24 AM
Hi!
Yes, I know, but I'm so afraid if I should mess up something, but I can take a backup of the project first. It's time to do that anyway. :)
Title: Re: Arraymaker Duplicate
Post by: djaydino on August 20, 2015, 02:29:25 AM
Hi,
yes alway make a backup :)
i do that almost everyday,
 i make a folder with a date on it and some extra info if i changed something major
and save the project folder there.
and @ the end of the month, delete those that i am sure of that i dont need anymore.
Title: Re: Arraymaker Duplicate
Post by: Rabagast on August 20, 2015, 03:45:48 AM
That's very good to do. :) I don't do it that often.

Time to backup! :)
Title: Re: Arraymaker Duplicate
Post by: jeanfabre on August 20, 2015, 01:55:02 PM
Hi,

 When you want to update an item already downloaded, simply "delete" it from the Ecosystem, and then you can download it again. I need to add a button "update" just to make things less scary... :)

 Bye,

 Jean