How to make a key item required for consuming another non-key item?

Sorry, not certain if 'key' is the right term.

Essentially, I want to do what the skill weapon type requirement does, only with items.

I have a peace pipe of each culture in the game, and there are consumbales which require said peace pipe, such as tobacco; oak leaves; sage; etc. (note this item is used primarily in religious rights and ceremonies)

How do I make it so something like tobacco can only be consumed through such a device? There are multiple types of peace pipes for each culture and sub culture (sub culture being entities like the Rogues, and Thieves)

Any help is welcome.
First, wrong sub-forum.

Second, common events. So, let's say you have an item exclusive to the Rogues. It's an efficient mana potion that they concoct in-house, but to consume it, you need to be "able to handle it." So, do a quest, and get an item called "Rogue's Certification." It's a key item. Then, you have the EMP (Efficient Mana Potion). The EMP is a normal (consumable) item that calls a common event. That common event checks that they have this certification item, and then if they do, forces a skill use that gives them mana. If they don't have the item, though, then it adds 1 EMP to their inventory (since the original was consumed when the common event was called), meaning that as far as the player is concerned, they didn't consume an item.

Alternatively, you could use a custom formulae for it, but that's a bit harder to tweak when necessary.
I reaized later it may be better to post in Script Request, but I made the mistake.

I'm not sure how to have a consumable item call an event. But that does give me a better idea.
This doesn't need a script. What was just described is ordinary eventing.

I will ask to have this moved, as it is in the wrong forum.
I've moved this thread to Support, RPG Maker VX Ace. Please be sure to post your threads in the correct forum next time. Thank you.
do items in database have a spot for events? or would I create a common event? seems difficult to me.
In the other tab when you add a new effect.

Event Tab.png

You need to make sure to have the common event made.
Pipe = Normal Item

Leaves = Key Items

Trying to use Leaves Item does Nothing and does not consume them.

But if you try to use the Pipe, it will start common event than open key item selection

to load the Pipe, than depending on what you want there are several ways to event from here....

If you dont want leaves for key items, than this whole idea would not work 🙂 So working around some stuff with events needs detailed informatzion on how it should apear and be used ingame later on.
This doesn't need a script. What was just described is ordinary eventing.

I will ask to have this moved, as it is in the wrong forum.
 While this is true(just condition branch in a common event, in the eatable item), if you want it to be polished, you do

You can either use the more complex item/skill use condition scripts out there(Hime has one now I believe) or a simple thing like this will do:

Code:
# Super Cremno 64 Turbo HD's script class Game_BattlerBase   DISABLE_ITEMS_PER_SWITCH_REGEX = /<unusable:\s*(\d+)\s*>/   alias_method :disable_items_per_switch_usable_item_conditions_met?,               :usable_item_conditions_met?   def usable_item_conditions_met?(item)    disable_items_per_switch_usable_item_conditions_met?(item) &&      disable_items_per_switch_usable?(item)  end   def disable_items_per_switch_usable?(item)    item.note.scan(DISABLE_ITEMS_PER_SWITCH_REGEX).none? do |id, |      $game_switches[id.to_i]    end  end end
Pipe = Normal Item

Leaves = Key Items

Trying to use Leaves Item does Nothing and does not consume them.

But if you try to use the Pipe, it will start common event than open key item selection

to load the Pipe, than depending on what you want there are several ways to event from here....

If you dont want leaves for key items, than this whole idea would not work 🙂 So working around some stuff with events needs detailed informatzion on how it should apear and be used ingame later on.
How would I go about checking for the key item? I am interested in that method.

The other method of the script looks like I would have to memorize some commands.
How would I go about checking for the key item? I am interested in that method.

The other method of the script looks like I would have to memorize some commands.

Woops, forgot to post what you need to type in the note tag for such. 

in the note box for the item, put <unusable: 1> where the number 1 is, is the ID for whatever switch you want on, to make said item unusable

For Hime's script, you'll have to look at the instruction for such, but the above is all you need to do, if you use the script I posted.
would I have to replace the word (item) with the name or number of that item?
also, as the OP stated, the use of the items requiring a peace pipe are for ceremonial and celebratorial use. Not for battles. not certain if the script provided will work.
would I have to replace the word (item) with the name or number of that item?
No

What you do in this case, is have a switch on by default, and when you buy/get the key item, turn off the switch.

That Notetag goes into the notebox of the eatable item.
does it specify the key item? I imagine there will be more than one key item that aren't peace pipes.
does it specify the key item? I imagine there will be more than one key item that aren't peace pipes.
No, there no need to ever specify the key item in this case. The fact that you turned off a switch, would indicate you can use said item.

Where ever you pick up the Key item you want to allow you to use the eatable item, just turn off the switch you assigned to the eatable item.
could I use a different name for the class? none of the things I am thinking about are usable from the battle scene.

how would I enable the switch? like switch: pp = true ?
could I use a different name for the class? none of the things I am thinking about are usable from the battle scene.

how would I enable the switch? like switch: pp = true ?

It seems to work just fine out of battle, despite the fact the script specifies the battlescene.

Infact I use it to disable tents in dungeon maps or whatnot(except at save points), and it works perfectly.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-a-key-item-required-for-consuming-another-non-key-item.50694/