playMaker

Author Topic: Arraymaker / Move Item to Last Index  (Read 100 times)

Tonda

  • Playmaker Newbie
  • *
  • Posts: 31
    • View Profile
Arraymaker / Move Item to Last Index
« on: August 30, 2018, 05:39:45 AM »
Hey all! I'm looking for something like this:

Moves an item in a Playmaker Array List proxy component to the last index slot.


----

I suppose I could use a combination of:

Array List Remove,
Array List Get Length,
Array List Insert

But I was surprised there were no Arraymaker actions that dealt specifically with the highest Index number.

Please advise if I should:

A) Hold out hope for a new action
B) Use the above 3 action solution
C) Some alternative better way to do this.

thanks!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 3366
    • View Profile
    • jinxtergames
Re: Arraymaker / Move Item to Last Index
« Reply #1 on: August 30, 2018, 08:25:09 AM »
Hi.

An 'array list move' action might be a good idea......

So i made one!
Can you try if it works well as i don't have a lot of time for testing :)

To place to the last index, set 'Index Move To' to -1

Tonda

  • Playmaker Newbie
  • *
  • Posts: 31
    • View Profile
Re: Arraymaker / Move Item to Last Index
« Reply #2 on: August 30, 2018, 12:13:19 PM »
Awesome! Yeah that seems super useful!

So I gave it the full test work-through and it worked like a charm.

I was able to precede the action with 'Array List Contains' and store the index result of a specific item, and then use that variable with your Move action to put that variable in the last slot.

So that's exactly what i needed!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13305
  • Official Playmaker Support
    • View Profile
Re: Arraymaker / Move Item to Last Index
« Reply #3 on: September 18, 2018, 06:38:30 AM »
Hi,

 ok, the latest arrayMaker package features this action.

 Bye,

 Jean