playMaker

Author Topic: Looping & Iterating - How is it handled ?  (Read 1175 times)

drown

  • Junior Playmaker
  • **
  • Posts: 58
Looping & Iterating - How is it handled ?
« on: December 09, 2022, 04:30:22 AM »
I recently had a project that made heavy use of arrays (ArrayMaker), tables and the iterate action. Looping and iterating through huge arrays was kinda awful and in the end made me fallback to simply writing C#.

It seemed like some actions supported custom increments, some did not, some could loop until the end of the array was reached, for others I had to first get the right length of the array. It really made for a clunky experience, especially when 2D and 3D arrays were needed and I had to think more about circumventing the limitations than actually working with Playmaker.

Is there something I am missing or is looping through (nested) arrays / tables one of the weaknesses of Playmaker?


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Looping & Iterating - How is it handled ?
« Reply #1 on: December 09, 2022, 10:54:02 AM »
Hi.
If your loop is interrupted before reaching the last index and you want to loop again from the start, then you need to set the reset bool on the get next action to true (set a bool variable on it and set to true before starting the loop, the action itself will then 'Reset' and set the bool to false)

maybe that might help