Select Item/Weapon/Armor get Icon ID

Okralord

Veteran
Veteran
Joined
Sep 4, 2016
Messages
35
Reaction score
2
First Language
English
Primarily Uses
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
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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?
 

Okralord

Veteran
Veteran
Joined
Sep 4, 2016
Messages
35
Reaction score
2
First Language
English
Primarily Uses
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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?
 

Okralord

Veteran
Veteran
Joined
Sep 4, 2016
Messages
35
Reaction score
2
First Language
English
Primarily Uses
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?
 

Attachments

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I don't see where you allowed the player to select the item when they choose weapon
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,115
First Language
English
Primarily Uses
RMMV
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,860
Messages
1,017,038
Members
137,568
Latest member
invidious
Top