playMaker

Author Topic: Array Compare  (Read 333 times)

shamo

  • Playmaker Newbie
  • *
  • Posts: 38
    • View Profile
Array Compare
« on: September 20, 2018, 03:39:49 PM »
Hi, need some help with the array setup. I have a pick and match game, using arrays to store and retrieve game objects. I had problems with (clone) added to instantiated objects but got around that using string instead.
Seems the 'Compare Array' gets befuddled with the names a bit too. Also, it will only recognize the exact sequence. Also, even though I have the 'Array get random' set to no repeat, it still throws out duplicates. There are some solutions on the Ecosystem, but most won't run on Unity 2018.
Long story short...any way to change the code on 'compare' to recognise all words/ gameobjects and not in sequence?
Thanks.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4525
    • View Profile
    • jinxtergames
Re: Array Compare
« Reply #1 on: September 20, 2018, 10:22:29 PM »
Hi.
The 'No Repeat  will still repeat indexes but it will not repeat the same index 2x in a row.
Maybe you can use : "Select Random Int" (on the Ecosystem) and use that as an index and then use array get (instead of random)

Select Random Int will select each number only once.
FOR HIRE:Playmaker/C#

Playmaker Samples <-------------> Easy Exporter <---------------------> TPA Actions

shamo

  • Playmaker Newbie
  • *
  • Posts: 38
    • View Profile
Re: Array Compare
« Reply #2 on: September 21, 2018, 04:15:10 AM »
Thanks for the reply. That definitely helped, still getting some repeats. It might just be the way I'm implementing it. I'm using it to populate the scene with varying amounts of objects, cycling on itself according to how many objects are needed if that makes sense?  Or is there another way to pull a certain amount of objects from the array all at once?