playMaker

Author Topic: [Bug?] with "Array Get Next" action  (Read 146 times)

Graham

  • Sr. Member
  • ****
  • Posts: 269
  • I Love Playmaker!
    • View Profile
    • Portfolio
[Bug?] with "Array Get Next" action
« on: June 07, 2017, 12:43:07 PM »
The "Array Get Next" action appears to have a very frustrating quirk. It doesn't appear to iterate through the whole array every time it is passed.

In the attached example scene you can see the issue very clearly. Pressing the left mouse button will compare arrayA to arrayB. For now arrayA has only the int value of "5" in it, while arrayB has int values from 0 though 9. It should find the 5 every time in arrayB, however it only finds it every second search. If you add a second value to arrayA, it will only fail every third try etc.

Thanks for looking at this!

Graham

  • Sr. Member
  • ****
  • Posts: 269
  • I Love Playmaker!
    • View Profile
    • Portfolio
Re: [BUG] with "Array Get Next" action
« Reply #1 on: June 07, 2017, 01:15:46 PM »
It appears to only be an issue if the action was interrupted. I worked around this by letting it iterate through the entire array every time and just registering a bool and testing it after the comparison is done.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 11779
  • Official Playmaker Support
    • View Profile
Re: [Bug?] with "Array Get Next" action
« Reply #2 on: June 16, 2017, 06:16:22 AM »
Hi,

 yes, this action doesn't have a reset flag so you indeed need to let to loop till the end.

 However you may simply want to use the iterate action and increment an index that you then use to get data from the array, it's really quick to develop and prevents wasting processing cycles for nothing by iterating to the end when not necessary.

 Bye,

 Jean

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 1478
    • View Profile
Re: [Bug?] with "Array Get Next" action
« Reply #3 on: June 16, 2017, 11:07:57 PM »
Hi,
Or you can get 'Array Get Next2' on the Ecosystem
This one has a "Reset Flag" :D

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 11779
  • Official Playmaker Support
    • View Profile
Re: [Bug?] with "Array Get Next" action
« Reply #4 on: June 19, 2017, 02:20:58 AM »
Hi,

 d'oh, forgot about that version :)  thanks Djaydino!

Bye,

 Jean

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 1478
    • View Profile
Re: [Bug?] with "Array Get Next" action
« Reply #5 on: June 19, 2017, 05:58:09 AM »
Hi,

Hehe, np.

There are a lot of custom actions now so it is getting hard to remember them all ;)