playMaker

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

Tonda

  • Playmaker Newbie
  • *
  • Posts: 31
Arraymaker / Move Item to Last Index
« on: August 30, 2018, 08: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: 7616
    • jinxtergames
Re: Arraymaker / Move Item to Last Index
« Reply #1 on: August 30, 2018, 11: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
Re: Arraymaker / Move Item to Last Index
« Reply #2 on: August 30, 2018, 03: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: 15500
  • Official Playmaker Support
Re: Arraymaker / Move Item to Last Index
« Reply #3 on: September 18, 2018, 09:38:30 AM »
Hi,

 ok, the latest arrayMaker package features this action.

 Bye,

 Jean