Can I reset and reuse variables after changing maps?

Hi Again Everyone I recently created a puzzle that allows my player to light three torch events in a specific order and then unlock a secret passage. For the most part it works but I suddenly noticed a small flaw while trying to recreate a similar puzzle using the same variables on a different map.

I'm currently using SRD Debug tool to keep track of my variables and watch how they work while I'm testing my game. When I light up all three Torches correctly on the 1st map the variable 'Torch Pattern' rests at a value of 4. When my player changes maps the value immediately drops to 0 without any added or changed logic. This alone is not a problem because I want the Variable to reset every time I start a new puzzle, but what I realized is that no matter what I try or events I change I can no longer change this variable even through the debug tool I can not change the value from 0 to 1 or any other number.

So I guess in short my first question is do I need to create a new variable for every map or even every puzzle? Or am I simply doing something wrong? If the answer is I'm doing something wrong than I will post all the relevant Events that I have in place.
You should be able to change Variable values using F9 during testplay. No need to use a Debug tool. If you can't change a variable, it's probably used by a Script/Plugin?
its best that each room when used by variable use their own (also for safety), because if it unlocks
a door that has variable x = 4, and it resets, its possible that you cant redo the puzzle so the door
stays locked.

so the logic must be correct if doing so to re-unlock the door.
each puzzle with another variable is the best way (which can be reset with a autorun and
erase event part. but to help you, we have to see your event page to see where you went wrong.
Alright good to know If its safer to make a new variable than I guess that's just what I'll do. the only reason I wanted to reuse variables in the first was because I know there are only so many slots available and I plan on making a full fledged puzzle game. but I guess if I run out of space I can learn use script instead.

Thanks Again ^.^
Well, so you reuse variable but the variable cannot be changed anymore after one use of puzzle?
I think the problem lies in the variable resetter event. Do you use common parallel event for that?

Usually for that kind of puzzle I always use resetter (common event, not parallel) on the door or event that leads outside of the puzzle area.
If you wanted the puzzle a one time puzzle only, meaning that once the door unlocked, it stay unlocked forever. you should utilize the page

For example, Door:
Page 1: Default, locked state
Page 2: Parallel with trigger Variable X, and will do selfswitch A
Page 3: unlocked state with selfswitch A trigger

You can call the resetter on Page 2 or page 3 depending on your preference.

if you wanted the puzzle object to stay lit for example, consider using Switch, and add it on page 2 or 3 on the door event.
Wow I Okay I think I figured it out. I did try a similar method and I used a touch event to reset my variables to 0. but Every time I entered the new map and attempted the second puzzle the variable would flash rapidly between 1 and 0. so I removed this event.

Trying the same thing again now I realized that last time I reset my variables After I transferred my player instead of before hand. After moving the reset variables to the top it works like a dream. So sorry for wasting Every ones time. I often overthink a problem.

But none the less thanks for your time and support.

Original thread: https://forums.rpgmakerweb.com/threads/can-i-reset-and-reuse-variables-after-changing-maps.122075/