[RM2K] Concerning switches (SOLVED!)

I am currently working on a RPG Maker 2000 game and I want to create a switch that will allow the hero to turn on or off an item by selecting that item in their inventory in the "Items" menu.

To explain further, this item will be called a "Flashlight" as an example:

ITEMS:

  • Name: Flashlight
  • Type: Switch
  • Cost: 0
  • Consumption Limit: No Limit
  • Description: It's a flashlight, use it to turn it on/off.
  • Switch Toggle ON/OFF: 0001: Flashlight
  • Occasion: [X] Field [_] Battle
When the hero picks up the Flashlight, it is an item that switches "0001: Flashlight" on/off. I want to make it that when they use it, the Flashlight turns "ON" (Switch = ON). And when they use it again, the Flashlight turns "OFF" (Switch = OFF). However, whenever I use this Flashlight during playtesting, it does nothing and stays "ON".

I was wondering if this was something I needed to create a Common Event for, but I cannot figure out how to make it work the way I want it to. So far I got this:

COMMON EVENT:

  • Name: Flashlight
  • Trigger: Parallel Process
  • Condition Switch: 0001: Flashlight
  • Contents:
    Conditional Branch: Switch [0001: Flashlight] is OFF
    > Control Switches: [0001: Flashlight] = ON
    Else
    > Control Switches: [0001: Flashlight] = OFF
    Branch End
So I was wondering if anyone have an idea on how to get this Flashlight item to work. Thanks in advance to anyone who can help me out!
You need a second switch that actually determines wether or not the flashlight is on.

So something like:

Common event: trigger "switch 1" parallel process

toogle "switch 2"

turn off  "switch 1"

the item turns on "switch 1"

the common event toggles "switch 2" either on or off

the common event then turns off "switch 1"

so that should work everytime^^
Thanks for the help, Zanazaru!

I tried this out and it works whenever I want to turn this Flashlight on, but it doesn't work when I tried to turn the Flashlight off. I'll write down what I have done and maybe you can point out where I made a mistake:

So I created two switches:

Switches: [0001: Flashlight]

Switches: [0002: Flashlight ON/OFF]

Here is the Flashlight item. I have left it alone, so nothing has been changed.

ITEMS:

  • Name: Flashlight
  • Type: Switch
  • Cost: 0
  • Consumption Limit: No Limit
  • Description: It's a flashlight, use it to turn it on/off.
  • Switch Toggle ON/OFF: 0001: Flashlight
  • Occasion: [X] Field [_] Battle
Now here is my common event, I hope I understood what you were explaining since this is new for me:

COMMON EVENT:

  • Name: Flashlight
  • Trigger: Parallel Process
  • Condition Switch:
  • Contents:
    Conditional Branch: Switch [0002: Flashlight ON/OFF] is ON
    > Control Switches: [0001: Flashlight] = OFF
    Else
    >
    Branch End
Thanks again!
Close ^^

Quick question is there no

COMMON EVENT:

  • Name: Flashlight
  • Trigger: Parallel Process
  • Condition Switch: [0001:Flashlight]
  • Contents:
    Control Switches: [0002: Flashlight On/Off] = trigger On/Off (that's one of the options it sets the switch to its oposite state)
    Control Switches: [0001: Flashlight] = OFF
So you don't need a conditional branch because it automatically set's the  0002:flashlight on/off switch to on or off depending on what it was before. It does that as long 0001: Flashlight switch is on so only once.

Oh and don't forget to change the switch that controls the actual flashlight event, that has to be 0002: Flashlight On/Off now ^^
Ah! It finally worked! Thank you so much, Zanazaru! Now the Flashlight works exactly the way I want it to; it turns on when you use it and it turns off when you use it again.
Glad I could help ^^

Original thread: https://forums.rpgmakerweb.com/threads/rm2k-concerning-switches-solved.52270/