Select Item/Weapon/Armor get Icon ID

Yo, yo yo.

I'm looking for a plugin that lets the player select an item, weapon, or armor from their inventory and stores the icon index in a variable.

I've spent some time looking for something like this and trying to come up with something myself but I'm not having any success. Thanks in advance, my dudes.

-Okra
For what purpose? If you explain what you're trying to accomplish (a higher level view) that will help determine the best way to do it.

How are they selecting the item/weapon/armor?
For what purpose? If you explain what you're trying to accomplish (a higher level view) that will help determine the best way to do it.

How are they selecting the item/weapon/armor?

Hey Shaz, Merry Chrimbus!

I want the player to activate an event, select an item, weapon, or armor (like when you use the Event Command: Select Item), and then for the icon index of the item/weapon/armor the player selects to be stored into a game variable that I can assign ahead of time in a plugin parameter.
I have found a plugin that lets the player select a weapon/armor, but it stores the weapon/armor ID into a variable.

The problem I'm having is that I'm using Yanfly's item core that makes unique items which have unique IDs. So five different axes have five different IDs. However, five different axes share the same icon index. So I'm trying to identify the kind of weapon/armor/item by their icon index instead of databse ID.

(I'm already using the Type parameter to identify the weapon/armor's material type so I don't want to use that)

I apologize if this doesn't make sense. Lemme know if you have more questions to help me better explain my goal.
With the plugin you have - do you tell it whether to show weapons or armors? Otherwise how do you know whether the thing they selected was a weapon or an armor? Can it be modified to also show items?

If you have the id and you know if it was a weapon or armor or item, it's pretty easy to get the icon. Let's say your weapon/armor/item id is in variable 15. You can put the icon into variable 16 with this:
Code:
Control Variables [0016: Icon] = Script: $dataWeapons[$gameVariables.value(15)].iconIndex

So it may be easier to make small mods to your existing plugin (if you're not using it for anything else) than to write a new one. It could also be changed to save the icon index at the same time it saves the id, into a separate variable.

Are you using that plugin for anything else and would such mods "break" the way you want it to work?
I'm using this plugin to allow the player to select a weapon/armor:
https://forums.rpgmakerweb.com/index.php?threads/weapon-and-armor-on-select-item.66540/

I'm trying to use the code you suggested but the game isn't grabbing the icon index of the selected weapon/armor. I'm pretty sure it's because Yanfly's Item Core won't use an ID lower than 2000, and the game engine won't use one higher than 2000. So I think I need to somehow get the icon index through Yanfly's Item Core?
I don't see where you allowed the player to select the item when they choose weapon
That first line of script is for the plugin I'm using that allows the player to select a weapon/armor (https://forums.rpgmakerweb.com/index.php?threads/weapon-and-armor-on-select-item.66540/)
Hey just to make sure that the plugin you mention actually works -

Can you add a line after the player picks the weapon to display the value of variable #151?
Just a text message with \v[151] would hopefully display the weapon ID. Let's confirm that first and then continue investigating if that part is OK.

Original thread: https://forums.rpgmakerweb.com/threads/select-item-weapon-armor-get-icon-id.103668/