playMaker

Author Topic: why there's no action "Array Get Previous"  (Read 1657 times)

do.games

  • Playmaker Newbie
  • *
  • Posts: 4
why there's no action "Array Get Previous"
« on: August 24, 2017, 07:10:38 AM »
Hello,

When using the basic array system (So not Array Maker), there s an action Array Get Next, (there's even an update Array get Next2), but there's no action "Array Get Previous"...

So how to loop in the reverse way in the array ?

Thx,

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: why there's no action "Array Get Previous"
« Reply #1 on: August 25, 2017, 04:48:37 AM »
Hi,

 - You can always iterate manually, maintain an index starting at (count-1), increment that down to 0 and get array at that index.

you can use the Iterate action on the ecosystem to speed the process above.

- you can also reverse using ArrayReverse the array and done :)

Let me know if you can't get it to work, I'll do that action and put it on the ecosystem.

 Bye,

 JEan
 

do.games

  • Playmaker Newbie
  • *
  • Posts: 4
Re: why there's no action "Array Get Previous"
« Reply #2 on: August 25, 2017, 11:08:26 AM »
Thank you very much for your answer Jean.
I'll try it next week and keep you inform about my progress.
But for sure, if you have any free time, an "Array Get Previous" would be very suitable ;)

Thx again,

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: why there's no action "Array Get Previous"
« Reply #3 on: August 28, 2017, 04:48:09 AM »
Hi,

 done, you can can get that action from the Ecosystem:

 Bye,

 Jean

fromfame

  • Junior Playmaker
  • **
  • Posts: 78
  • Sloppy PM Veteran
Re: why there's no action "Array Get Previous"
« Reply #4 on: April 28, 2022, 12:51:27 PM »
Hey Jean,

Want to point out the action isn't working, can you take a look at what's up?

fromfame

  • Junior Playmaker
  • **
  • Posts: 78
  • Sloppy PM Veteran
Re: why there's no action "Array Get Previous"
« Reply #5 on: April 28, 2022, 02:10:12 PM »
I solved it.

I've attached an image of what to do.

---

For those who are having difficulty understanding (I did), do this:

0) Use Array Get action, not Array Get Next action.

1) Make an Int Variable, call it index, set it on the INDEX Field of Array Get.

2) Add Add Int action on another state, set your INDEX int there.

3) Type 1 or -1 on Add Int action. Up to you.

4) Link it back to Array Get state, you'll see the INDEX changed the array.