- Joined
- May 6, 2017
- Messages
- 54
- Reaction score
- 46
- First Language
- English
- Primarily Uses
- RMMV
So, there's some deliberately useless items that the party can accumulate. In the original game that I'm creating a conversion of, there was a menu command to (D)rop an item, then select the # of the item in the inventory list. In RMMV, it's going the other way, and in the Items screen you select the item, then for the useless ones it calls a Common Event in the Item's "Effects" section that lets you choose to drop some amount of that type. The problem is that so far, I can't see how to avoid having a separate Common Event for each kind of item you'd want to drop, because I've yet to find how to access the selected/used item's ID through scripting. Each CE looks very much like the code below, and works. Just trying to find a more elegant way to do this for multiple types of items in only one CE.
I don't want to do this with "Select Item" because then I'd either need a plugin to filter for only the kinds of items that can be dropped, or I'd have a much larger list of items that the CE has to check for and say "you can't drop that." There's also no stores or NPCs that buy/take items from you besides quest key items, so I can't get rid of them that way, plus the original functionality is to be able to look at the inventory anytime outside combat and clean house. And these aren't Consumable=Yes items, really; the Bottle is empty and created after consuming a Wine Bottle, and another is literally a "useless pile of rodent feces", so the Consumable route doesn't feel right.
Code:
◆Comment:Lets you choose to throw away a useless item upon Use
: :(clicked in Items screen) or keep it.
: :Until I learn how to get the itemID that sent us here,
: :need a CE for each item to throw away!
: :(using two temporary variables)
◆Control Variables:#0002 temp = The number of Bottle
◆Text:None, Window, Middle
: :You have \V[2] \I[176]\C[4]Bottle\C[0],
: :how many do you want to throw away permanently?
◆Input Number:RandomPercent, 1 digit
◆If:RandomPercent > temp
◆Control Variables:#0001 RandomPercent = temp
◆
:End
◆Change Items:Bottle - {RandomPercent}
I don't want to do this with "Select Item" because then I'd either need a plugin to filter for only the kinds of items that can be dropped, or I'd have a much larger list of items that the CE has to check for and say "you can't drop that." There's also no stores or NPCs that buy/take items from you besides quest key items, so I can't get rid of them that way, plus the original functionality is to be able to look at the inventory anytime outside combat and clean house. And these aren't Consumable=Yes items, really; the Bottle is empty and created after consuming a Wine Bottle, and another is literally a "useless pile of rodent feces", so the Consumable route doesn't feel right.