Is there a way to see the ID of the item the player has just tried to use from their inventory?
I'm making about 30 items, and all of them will do the same thing when used: it will call a common event to change a variable. This variable will be set to the same ID of the item, so I know the player has used it.
I can make 30 different common events for this ... but is there a better way?
Set used item to a variable
● ARCHIVED · READ-ONLY
-
-
You could add this line to Game_Party.consume_item to put the item id into a variable:
Code:This should record the item id whether it's consumable or not, and should update the variable whether you use it from the Items menu or the Battle Items menu.$game_variables[x] = item.id if item.is_a?(RPG::Item) -
If you want the items name in a variable, you should be able to use the script option to set the variable. Try this, perhaps:
s = SceneManager.sceneitem = s.item_window.item.id$game_variables[number] = itemI believe that should work for the battle item window and the menu item window. -
Thanks Shaz, that worked perfectly.
Closed.