Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Microck 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:
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)
!!!!! 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)
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 ?
-
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
-
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
(http://img115.xooimage.com/files/2/9/5/resolutionlist-56df261.png)
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".
-
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 ! :)
-
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