list itemid inside an array

someone know how to insert ids of a list( item1, item2 item3) inside an array? not a simple text but cards id( in this case) previously created inside an array that I will configure as an album, I only need this tips, how to recall inside the array a variable ( i think)

otherwise I must insert manually the card ids.
Or I'm wrong?
someone know how to insert ids of a list( item1, item2 item3) inside an array? not a simple text but cards id( in this case) previously created inside an array that I will configure as an album, I only need this tips, how to recall inside the array a variable ( i think)

otherwise I must insert manually the card ids.
Or I'm wrong?
Mostly involving a "for" Loop Statement with the Array "splice()" Method.

Anyways... just wrote a plugin for this. See below 🙂

CT_Bolt's InsertValues Plugin:
Spoiler
Description:
Insert object values from an array of objects into an array.

Features:
Insert object values from an array of objects into an array.
Insert object value(s) to anywhere the array.
Insert any value from anywhere to any stopping point in object array.

How to Use:
Add plugin via Plugin Manager

Script Calls:
Spoiler
Code:
  insertValues(array, object, [insertAt], [objectValue], [insertFrom], [insertStop]);
  array.insertValues(object, [insertAt], [objectValue], [insertFrom], [insertStop]);

Note: Only "array", "object" are needed.
Optional Values Default to the following:
insertAt: 0
objectValue: "id"
insertFrom: 0
insertStop: Array Length Of Object Array

Examples:
Spoiler
Code:
  insertValues([4, 5, 6, 7, 8], [{id:1},{id:2},{id:3}], 2, "id", 1, 2);
    Before: [4, 5, 6, 7, 8]
    After:  [4, 5, 6, 2, 7, 8]
Spoiler
Code:
[4,5,6,7,8].insertValues([{id:1},{id:2},{id:3}], 2);
     Before: [4, 5, 6, 7, 8]
     After:  [4, 5, 1, 2, 3, 6, 7, 8]
Spoiler
Code:
  [4,5,6,7,8].insertValues([{id:1},{id:2},{id:3}]);
    Before: [4, 5, 6, 7, 8]
    After:  [1, 2, 3, 4, 5, 6, 7, 8]


Download:

So for your case something like this...
Spoiler
Code:
var cardId_list = [];
var cards = [{id:1, value: 5}, {id:3, value: 15}, {id:2, value: 10}, {id:4, value: 20}];
Code:
cardId_list.insertValues(cards); // Inserts all card IDs into the array at the beginning.
or
Code:
cardId_list.insertValues(cards,cardId_list.length); // Inserts all card IDs into the array at the end.

Is that what you needed? ...Hope that's what you meant. ☺️

Let me know how it goes 🙂:popcorn:
the cards have different values, not only one, it's a triple triad plugin made by raizen, I must insert these cards in album in row and columns and I do not know how to do, have you some tips?
at mouse click or keyboard selection, the cards chosen show a little info window at the right, I can do almost all about this, but i'm stuck with that kind of command list with more columns.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/list-itemid-inside-an-array.115614/