playMaker

Author Topic: Bug in PlayerPrefsx Get Array List [SOLVED]  (Read 992 times)

Evaldas

  • Playmaker Newbie
  • *
  • Posts: 21
Bug in PlayerPrefsx Get Array List [SOLVED]
« on: March 07, 2023, 01:08:57 PM »
Hello! Wanted to share a bug. I'm was saving a few string arrays in sequence, and upon loading I was iterating through [PlayerPrefsx Get Array List] action, and once used, the action does not load properly and gets the array list messed up.

Spent a whole day trouble shooting and searching where I made a mistake, and in the end just used an "Sequence event" action and created a bunch of duplicates for [PlayerPrefsx Get Array List] and when going through different actions and not the same one - now it loads correctly.

The problem is that I'm not sure how many arrays will the player need to load, so not sure how many duplicates I need to create, but that's a problem for future me.

Maybe it's a known limitation, not a bug? Or maybe there's a fix?
« Last Edit: March 10, 2023, 10:15:27 AM by Evaldas »

Evaldas

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Bug in PlayerPrefsx Get Array List
« Reply #1 on: March 07, 2023, 01:33:54 PM »
I think the action might be missing the option to enable Reset flag bool value, like in "PlayerPrefsx Set Array List"  ???  :)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7623
    • jinxtergames
Re: Bug in PlayerPrefsx Get Array List
« Reply #2 on: March 07, 2023, 11:30:19 PM »
Hi.
can you send the 2 scripts here so i can have a look to it

Evaldas

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Bug in PlayerPrefsx Get Array List
« Reply #3 on: March 08, 2023, 03:37:16 AM »
Here are the scripts. Set Array List has the reset flag which I use to iterate through action with no problems.

Get Array List does not have reset flag (i has "Array Auto Prefill", which I suppose should do the same thing, but does not work).

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7623
    • jinxtergames
Re: Bug in PlayerPrefsx Get Array List
« Reply #4 on: March 08, 2023, 08:56:35 AM »
Hi.
Array Prefill will clear your list, then add the variable type (only if start index is set to 0)

the only thing i could notice is that OnEnter
has :
Code: [Select]
  nextItemIndex = -1;
and the other not.

you can try if that fixes the issue

Evaldas

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Bug in PlayerPrefsx Get Array List
« Reply #5 on: March 09, 2023, 01:09:01 PM »
Sorry, could you please clarify - should I delete the line " nextItemIndex = -1; " from the action?

Because I've tried all the combinations with "Array Prefill" checked.

I understand that the description says it should clear the list and start over, but in practice it does not work and when calling the same action the loading starts from the last index which messes up the array list.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7623
    • jinxtergames
Re: Bug in PlayerPrefsx Get Array List
« Reply #6 on: March 10, 2023, 12:04:41 AM »
Hi.
Did you try with the updated action is send (attachment)

Evaldas

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Bug in PlayerPrefsx Get Array List
« Reply #7 on: March 10, 2023, 10:12:13 AM »
Oh sorry, I did not see the attachment. Now it works fine, thank you very much, the problem is solved!

Probably the action should be updated in Ecosystem? Because I got the original one from Ecosystem :)