playMaker

Author Topic: Array list delete duplicates error[SOLVED]  (Read 1747 times)

Microck

  • Playmaker Newbie
  • *
  • Posts: 22
Array list delete duplicates error[SOLVED]
« on: December 17, 2019, 02:55:48 PM »
Hi !
I have an array list made with the action "Array list get screens resolutions" but in the build, many resolutions are duplicated.

Unfortunately the action "Array list delete duplicates" give me this error:
Quote
Failed to compare two elements in the array.
UnityEngine.Debug:Log(Object)
HutongGames.PlayMaker.Actions.ArrayListDeleteDuplicates:doesArrayListContainsCount() (at Assets/PlayMaker Custom Actions/ArrayMaker/ArrayListDeleteDuplicates.cs:94)
HutongGames.PlayMaker.Actions.ArrayListDeleteDuplicates:OnEnter() (at Assets/PlayMaker Custom Actions/ArrayMaker/ArrayListDeleteDuplicates.cs:67)
HutongGames.PlayMaker.FsmState:ActivateActions(Int32) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:205)
HutongGames.PlayMaker.FsmState:OnEnter() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:175)
HutongGames.PlayMaker.Fsm:EnterState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2768)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2715)
HutongGames.PlayMaker.Fsm:UpdateStateChanges() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2643)
HutongGames.PlayMaker.Fsm:UpdateState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2784)
HutongGames.PlayMaker.Fsm:Update() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1995)
PlayMakerFSM:Update() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:579)

Quote
!!!!! Can't Sort this type in Array - Please untick option - Did not delete Duplicates *** Nothing happened
UnityEngine.Debug:LogWarning(Object)
HutongGames.PlayMaker.Actions.ArrayListDeleteDuplicates:doesArrayListContainsCount() (at Assets/PlayMaker Custom Actions/ArrayMaker/ArrayListDeleteDuplicates.cs:95)
HutongGames.PlayMaker.Actions.ArrayListDeleteDuplicates:OnEnter() (at Assets/PlayMaker Custom Actions/ArrayMaker/ArrayListDeleteDuplicates.cs:67)
HutongGames.PlayMaker.FsmState:ActivateActions(Int32) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:205)
HutongGames.PlayMaker.FsmState:OnEnter() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:175)
HutongGames.PlayMaker.Fsm:EnterState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2768)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2715)
HutongGames.PlayMaker.Fsm:UpdateStateChanges() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2643)
HutongGames.PlayMaker.Fsm:UpdateState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2784)
HutongGames.PlayMaker.Fsm:Update() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1995)
PlayMakerFSM:Update() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:579)

Quote
InvalidCastException: Specified cast is not valid.
HutongGames.PlayMaker.Actions.ArrayListDeleteDuplicates.SortOnDelete () (at Assets/PlayMaker Custom Actions/ArrayMaker/ArrayListDeleteDuplicates.cs:200)
HutongGames.PlayMaker.Actions.ArrayListDeleteDuplicates.doesArrayListContainsCount () (at Assets/PlayMaker Custom Actions/ArrayMaker/ArrayListDeleteDuplicates.cs:97)
HutongGames.PlayMaker.Actions.ArrayListDeleteDuplicates.OnEnter () (at Assets/PlayMaker Custom Actions/ArrayMaker/ArrayListDeleteDuplicates.cs:67)
HutongGames.PlayMaker.FsmState.ActivateActions (System.Int32 startIndex) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:205)
HutongGames.PlayMaker.FsmState.OnEnter () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:175)
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2768)
HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2715)
HutongGames.PlayMaker.Fsm.UpdateStateChanges () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2643)
HutongGames.PlayMaker.Fsm.UpdateState (HutongGames.PlayMaker.FsmState state) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2784)
HutongGames.PlayMaker.Fsm.Update () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1995)
PlayMakerFSM.Update () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:579)

Maybe this action doesn't work with vector3 ?
« Last Edit: December 20, 2019, 03:42:19 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Array list delete duplicates error
« Reply #1 on: December 18, 2019, 01:19:13 AM »
Hi,

- Make sure that the proxy has its type set to Vector3

- untick sort because the action can't sort vector3

if you still get errors can you make a screenshot of the values you have in the arraylist?

Bye,

 Jean

Microck

  • Playmaker Newbie
  • *
  • Posts: 22
Re: Array list delete duplicates error
« Reply #2 on: December 18, 2019, 06:39:28 AM »
I mean... not all heroes wear capes.  ;D

No error anymore (It was the type and the sort thing). BUT I still got "duplicated" resolutions in build.
I guess he take different Hz like:
1920x1080 120Hz
1920x1080 60Hz
1920x1080 45Hz

Values looks like this:
x: 1920 y:1080 z:60

I guess that if the action ignore z value, we don't get duplicated resolutions. Not 100% sure.

I will try to find a fix like "if width and height are the same than previous resolution = go next".
« Last Edit: December 18, 2019, 06:42:55 AM by Microck »

Microck

  • Playmaker Newbie
  • *
  • Posts: 22
Re: Array list delete duplicates error
« Reply #3 on: December 18, 2019, 07:13:38 AM »
I've made a custom action that ignore Z (refresh rate), so we only get width and height (vector2), preventing having duplicated resolutions in build.
Hope it helps !  :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Array list delete duplicates error
« Reply #4 on: December 20, 2019, 03:42:11 AM »
Hi,

Good idea for the action. Updated ArrayMaker package with that action featuring the option to ignore refresh rate. This will be more versatile then a second action just for that.

Bye,

 Jean