- That's the problem I've had so far
- I'm not proficient in scripting
MZ Is there any way to get the array of armor ids for Player 1's equipment?
JS Plugin RequestsYes.
Edit: Okay that's long enough for the joke.
Edit: Okay that's long enough for the joke.
JavaScript:
$gameParty.leader().armors().map(armor => armor.id)
- hi
- I found that he doesn't get duplicate array of armor ids
I'm not sure what you mean by that.
- Let's say I have two identical armor with ID 1
- He only got one [1]
- Sorry, my English is not good
Ah, so you don't want duplicates?
no,I want all of them
- 我有一个新问题
- 从数组[1,1,2, 3]中删除1
- 让它产生[1,2, 3]
- The situation is this
- In my game
- Variable 1 is an array
- The variable 3 is a possible duplicate value in the array
- I want to remove one variable 3 from variable 1, not all of variable 3
You can use the .remove function for that:
[1, 1, 2, 2, 3, 3].remove(2) = [1, 1, 2, 3, 3]
[1, 1, 2, 2, 3, 3].remove(2) = [1, 1, 2, 3, 3]
- I have found a solution to the problem
- Thanks for your help!
Original thread: https://forums.rpgmakerweb.com/threads/is-there-any-way-to-get-the-array-of-armor-ids-for-player-1s-equipment.153849/