[SOLVED] How to enable an event when i select a key-item for the second time?

So i figured out how to call a common event when i select an item from the inventory.

What i need is when i select again, for the second time, the same item the common event to turn off
and when i select it again for the third time, to turn it on again. (A enable/disable Item setting..)
I would have it so that you turn a switch on and off in the common event for the item.
the second CE is the other stuff you want to happen when the switch is on. set to parallel process by the switch.
So basically this? You just need a switch that is only used by this item's CE (or other processes that force to activate / deactivate it elsewhere).

Code:
<>If Switch[1234] == ON
 <>(Whatever happens when item was already activated before)
 <>Set Switch [1234] = OFF
 <>
: Else
 <>(Whatever happens if item is not active or was deactivated before)
 <>Set Switch [1234] = ON
 <>
: End
<>

Or if you wanna change the item's name/icon/description aswell, you could make the CE remove the item from player's inventory, afterwards it adds another version of the item that when used also would call a CE that reverts that same process.

~炬燵あ
I will post my settings so far, so you can see my sceptic and correct me because i can't figure out..
i am wrong 100% i can tell.. but my mind is potato right now 😛

11111.png

22222.png

333.png
but my mind is potato right now
Interesting term, but yes.
in both CE, do not call the other CE.
in second CE (bow off) set trigger to parallel process and switch to XX (not 5,6,9,2)
then when you want to turn the switches off turn switch XX on and the CE will run turning all the switches off (don't forget switch XX last to turn off).

Since you are using a bow for this affect, this may not work. Because it makes me think you are doing this in battle.
This is not the way to do things in battle.
If it is for a turn in battle, explain the whole process of your goal.
Since you are using a bow for this affect, this may not work. Because it makes me think you are doing this in battle.
This is not the way to do things in battle.
If it is for a turn in battle, explain the whole process of your goal.
No i don't use it for battle (if you mean the default game's battle system)..
it haves it's own mechanics.
Actually i have linked dungeon's tools settings (the arrow more specific) with the "bow item" in the common event settings and what i want to do, is when i choose it from menu/inventory the player can use it and when it's clicked again (from inventory again) to turn it off..
in both CE, do not call the other CE.
in second CE (bow off) set trigger to parallel process and switch to XX (not 5,6,9,2)
then when you want to turn the switches off turn switch XX on and the CE will run turning all the switches off (don't forget switch XX last to turn off).
I am little confused.. 🙁
OK, so selecting the arrow turns a switch on.
Why do you need to select the item? (bow)
It makes more sense to me to call the common event when you select the arrow.
But you want to turn it off. I think I see a pattern there.
So the bow (when selected) turns switches on, then when selected again turns switches off.
Does that sum up the process?
If so then you just need one common event and do a conditional branch check for the switch.
But you want to turn it off. I think I see a pattern there.
So the bow (when selected) turns switches on, then when selected again turns switches off.
Does that sum up the process?
If so then you just need one common event and do a conditional branch check for the switch.
That's right!
can you help me with the conditional branch? what do i do?
can you help me with the conditional branch? what do i do?
That should be very easy.
1650980410132.png
How amazing are you anyway??? It worked! ;_;;_;;_;
i am trying from yesterday for this to work..
Thank you very much!!!

Original thread: https://forums.rpgmakerweb.com/threads/solved-how-to-enable-an-event-when-i-select-a-key-item-for-the-second-time.147081/