playMaker

Author Topic: Array List Delete Duplicates & Array List Set Next Empty (Null)[SOLVED]  (Read 11586 times)

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Hi,

2 actions to deal with the duplicates in an array.

Delete duplicates options (v2).
  • Sort array then delete duplicates (fastest option for large array)
  • Sort array and then replace duplicates with null
  • Keep current order and then delete duplicates
  • Keep current order and then replace duplicates with null

Array List Set Next Empty (Null)
Find the first available empty (empty means Null) and input value. To be used with the above action for the rows with Null value.

Update Note: Added missing elements (Material, Audio, GameObject & Texture) + no need to select variable anymore + better debug log msg.

Hope it helps..
« Last Edit: March 09, 2021, 01:18:55 AM by jeanfabre »

PlaymakerNOOB

  • Full Member
  • ***
  • Posts: 219
Re: Array List Delete Duplicates & Array List Set Next Empty (Null)
« Reply #1 on: April 25, 2015, 11:20:38 AM »
Wow awesome.

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: Array List Delete Duplicates & Array List Set Next Empty (Null)
« Reply #2 on: April 25, 2015, 10:32:53 PM »
update bump

* did not save a change to file (sorry) before upload.. small bug when using failure event + sort array. error was corrected in delete duplicate action.
« Last Edit: April 25, 2015, 10:36:21 PM by dudebxl »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Array List Delete Duplicates & Array List Set Next Empty (Null)
« Reply #3 on: April 27, 2015, 02:51:44 AM »
Hi,

 Currently merging these actions into the ArrayMaker package:

 I don't think the "everyframe" option make sense in the ArrayListSetNextEmpty. Do you have a case for this? if that make sense I'll leave it, else I'll remove it because I is dangerous as it can lead to infinite loop.

 Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Array List Delete Duplicates & Array List Set Next Empty (Null)
« Reply #4 on: April 27, 2015, 03:26:14 AM »
Hi,

 Anyway, I have put them actions on the Ecosystem via Snipt. this will be easier for users to consume your actions:

https://snipt.net/jeanfabre/

 To get them from the Ecosystem, browse as usual.

Bye,

 Jean

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: Array List Delete Duplicates & Array List Set Next Empty (Null)
« Reply #5 on: April 27, 2015, 08:51:09 AM »
Hi,

"I don't think the "everyframe" option make sense in the ArrayListSetNextEmpty. Do you have a case for this? " I have no case for this nor do I use everyframe so i have no idea if it is useful, please remove if you feel it is best.. I will update it (remove everyframe) on here also.. Update: Removed everyframe based on feedback from JF.

Thx  for the feedback :)
« Last Edit: April 27, 2015, 09:38:26 AM by dudebxl »

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: Array List Delete Duplicates & Array List Set Next Empty (Null)
« Reply #6 on: May 05, 2015, 02:22:42 PM »
Update bump. Now the action is solid.. ;D

mweyna

  • Full Member
  • ***
  • Posts: 242
Re: Array List Delete Duplicates & Array List Set Next Empty (Null)
« Reply #7 on: May 05, 2015, 03:48:24 PM »
I'm looking in the 4.6 ecosystem and not finding the action, is there something I'm missing?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Array List Delete Duplicates & Array List Set Next Empty (Null)
« Reply #8 on: May 06, 2015, 10:11:15 AM »
Hi,

 Tt works here, I double checked ( searched for 'set next empty' and 'delete duplicate', both returned the right action)

Make sure you have the latest version of the ecosystem (0.4.2)

 Bye,

 Jean

ps: incredible stats for the snipts actions: 13k views on some this action in less than a week!

https://snipt.net/jeanfabre/

Vangelis

  • Playmaker Newbie
  • *
  • Posts: 13
  • VR ROCKS!
    • VR applications for the industry!
Re: Array List Delete Duplicates & Array List Set Next Empty (Null)
« Reply #9 on: November 15, 2016, 08:01:58 AM »
Hi,
   I have tried to use the Array List Delete Duplicates but I get the following error:
InvalidCastException: Cannot cast from source type to destination type.

Any idea why that would happen? (unity 5.2.1f1)
Same thing with the arraylist contains duplicates action.

 :-\ :-\
You can't have time, if you don't make time...

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Array List Delete Duplicates & Array List Set Next Empty (Null)
« Reply #10 on: November 16, 2016, 03:46:46 AM »
Hi,

-- what data is in your list?

Bye,

 Jean

Vangelis

  • Playmaker Newbie
  • *
  • Posts: 13
  • VR ROCKS!
    • VR applications for the industry!
Re: Array List Delete Duplicates & Array List Set Next Empty (Null)
« Reply #11 on: November 23, 2016, 04:18:13 AM »
Hi,
  the content is strings, but I would also like it to be integer or float in the future.
You can't have time, if you don't make time...

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Array List Delete Duplicates & Array List Set Next Empty (Null)
« Reply #12 on: December 02, 2016, 02:24:18 AM »
Hi,

 I can't repro this unfortunatly. Maybe you could send me the repro scene? pm if it's private.

 Bye,

 Jean

marv

  • Junior Playmaker
  • **
  • Posts: 50
Re: Array List Delete Duplicates & Array List Set Next Empty (Null)
« Reply #13 on: December 03, 2016, 05:13:56 PM »
This happens when I use the "delete/contains duplicate" actions on array lists created through "create array list" actions in runtime for me. They work fine on arrays created in the editor.

Vangelis

  • Playmaker Newbie
  • *
  • Posts: 13
  • VR ROCKS!
    • VR applications for the industry!
Re: Array List Delete Duplicates & Array List Set Next Empty (Null)
« Reply #14 on: December 04, 2016, 05:34:07 AM »
Hi guys,
  with further testing I have ascertained that the error happens when the examined arraylist is in a gameobject along with others arraylists. Regardless the fact that a unique reference is used for the array, it seems that the actions fail to complete.
 I have isolated the array in it's own gameobjects and the action works fine.
 My arraylists are not created through "create array list" actions. They pre-exist and are filled with data during runtime. Thank you all for your feedback.

   (I can't send the scene Jeanfabre, because it's big project and there are security issues. Thank you for your support.)
It would be great if this action could give a result of the duplicate values in a string.....
You can't have time, if you don't make time...