playMaker

Author Topic: Arraymaker Duplicate  (Read 7751 times)

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Arraymaker Duplicate
« 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?
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Arraymaker Duplicate
« Reply #1 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

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Arraymaker Duplicate
« Reply #2 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.
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Arraymaker Duplicate
« Reply #3 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.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Arraymaker Duplicate
« Reply #4 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.
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Arraymaker Duplicate
« Reply #5 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. :)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Arraymaker Duplicate
« Reply #6 on: August 17, 2015, 04:58:16 PM »
Hi,

 Excellent! Never giving up is key!

Bye,

 Jean

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Arraymaker Duplicate
« Reply #7 on: August 17, 2015, 05:01:11 PM »
Stubborn is my middle name! :)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Arraymaker Duplicate
« Reply #8 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"
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Arraymaker Duplicate
« Reply #9 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

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Arraymaker Duplicate
« Reply #10 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.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Arraymaker Duplicate
« Reply #11 on: August 18, 2015, 04:20:00 PM »
Hi,

 Using the PlayMaker Beta or current Asset Store version?

 Bye,

 Jean

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Arraymaker Duplicate
« Reply #12 on: August 19, 2015, 11:48:24 AM »
Current asset store version.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Arraymaker Duplicate
« Reply #13 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.
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Arraymaker Duplicate
« Reply #14 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