Problems with a conditional event that decides the transparency of some objects

Hello, everyone,
I am experiencing a bit of trouble developing an idea for a dungeon.

Basically I would like to make the following sitation happen:
If one of the characters wears a certain armor he can see graphics ( parallel events) in the map that he could not see without it.

Until I get said graphics to appear I haven't had much trouble, but when I remove the equipment I can't get these graphics to show up transparently.

I am sending you the screenshots of the events, in hope that someone can help me, maybe I am making trivial mistakes and don't realize it, but please help me!!!

The excavator event I left it completely empty hoping to handle everything from the parent event... but there are 4 others like that that should display together.
Be careful with parallel (and autorun) events. By default, they attempt to run every frame - that's 60 times a second.

Having those sitting around when you don't actually need it done that often is what contributes to lag in your game.

So your parallel events should almost always have some wait command at the end to make it not as engine-intensive.

And, like your third event, definitely shouldn't be parallel if it's not even doing anything.

Suggestion 1:
Rather than manually controlling all those transparencies back and forth, just use a game switch. Give the excavators two pages - the first page has no image, the second page has the image and a condition of the switch.

Then all you have to do in your main parallel event is turn the switch on and off.

Suggestion 2:
Instead of having a parallel event for this, you could use a plugin like OnEquipEval to turn the switch on and off automatically when equipping or removing the glasses.
Can you show us what page 2 of event 24 is doing?

Like, my guess is you're setting switch 41 to on and then the second page has that switch as a condition (?). If that is the case, then your code handling the de-equipping of the 3D glasses is still on the first page, which is now inactive, ergo it would be unable to run.
Be careful with parallel (and autorun) events. By default, they attempt to run every frame - that's 60 times a second.

Having those sitting around when you don't actually need it done that often is what contributes to lag in your game.

So your parallel events should almost always have some wait command at the end to make it not as engine-intensive.

And, like your third event, definitely shouldn't be parallel if it's not even doing anything.

Suggestion 1:
Rather than manually controlling all those transparencies back and forth, just use a game switch. Give the excavators two pages - the first page has no image, the second page has the image and a condition of the switch.

Then all you have to do in your main parallel event is turn the switch on and off.

Suggestion 2:
Instead of having a parallel event for this, you could use a plugin like OnEquipEval to turn the switch on and off automatically when equipping or removing the glasses.
Thanks for the advice ATT_Turan, you are always available in case of need....
I'll try what you recommended right away, I don't really know how this plugin works but I'll download it to learn more...
Can you show us what page 2 of event 24 is doing?

Like, my guess is you're setting switch 41 to on and then the second page has that switch as a condition (?). If that is the case, then your code handling the de-equipping of the 3D glasses is still on the first page, which is now inactive, ergo it would be unable to run.

Of course here is the second page of the event....
Be careful with parallel (and autorun) events. By default, they attempt to run every frame - that's 60 times a second.

Having those sitting around when you don't actually need it done that often is what contributes to lag in your game.

So your parallel events should almost always have some wait command at the end to make it not as engine-intensive.

And, like your third event, definitely shouldn't be parallel if it's not even doing anything.

Suggestion 1:
Rather than manually controlling all those transparencies back and forth, just use a game switch. Give the excavators two pages - the first page has no image, the second page has the image and a condition of the switch.

Then all you have to do in your main parallel event is turn the switch on and off.

Suggestion 2:
Instead of having a parallel event for this, you could use a plugin like OnEquipEval to turn the switch on and off automatically when equipping or removing the glasses.
I'm trying to follow your advice, but I still can't reactivate page 1 of excavator once the 3d glasses switch is ON.
Can you show us what page 2 of event 24 is doing?

Like, my guess is you're setting switch 41 to on and then the second page has that switch as a condition (?). If that is the case, then your code handling the de-equipping of the 3D glasses is still on the first page, which is now inactive, ergo it would be unable to run.

@ATT_Turan
I actually thank everyone but it was quite trivial, although even now although it works, I am convinced that the events are programmed well.
I feel very stupid in that it was logical that once the switch was activated he would stay on page 2 and have no indicayion why he would return to the OFF state.

Now it actually works--is there anything else I should change in your opinion to optimize it?
I don't think you need a separate switch for when the glasses are OFF, so Switch 42 seems completely superfluous. It doesn't seem like it is interacted with anywhere in your code either.

Likewise, the first page of Escavator is superfluous too. It is okay to just have the one page that requires Switch 41 to be on.

Strictly speaking, I don't think the conditional on event 24's first page needs an "else" case. Every possible state transition with regards to the glasses (glasses equipped to unequipped, and unequipped to equipped) is covered by the "are the glasses equipped" check on page one, and "are the glasses unequipped" check on page two. There is no need to check for "glasses unequipped to unequipped".

Lastly, I'd think about inserting wait commands at the end of your parallel processes to try mitigate potential lag. You could probably get away with inserting a wait time of 15 frames here (meaning the conditional will only run 4 times a second as opposed to 60 times), which would likely still be responsive enough for what you want. But that's up to you.

Original thread: https://forums.rpgmakerweb.com/threads/problems-with-a-conditional-event-that-decides-the-transparency-of-some-objects.160025/