In RPG Maker MV l have been stuck on making m chests go invisible after time runs out would like some help if this is possible Thanks

Hi guys for the past few days l have been trying to get this to work but only was able to get half to work where l use a item called Ariaflute and all chests that are invisible in the map are revealed for 30 seconds and if l didn't collect the chest within 30sec. The chests that haven't been collected will go invisible again and the Ariaflute will go on a 1 minute cooldown before you can use it again to reveal the chests. I got the chests to reveal when l use the item, but l cannot figure out a way for when the timer runs out the chest resets itself and goes back to event page 1. l made two chest 1 without the timer set up called Invis Chest 1 and another Invis Chest 2.
Ariaflute Item.PNG
Ariaflute Item Common Event.PNG
1.PNG
2.PNG

3.PNG

This chest does reveal when l use Ariaflute
4.PNG


5.PNG

6.PNG

7.PNG

Aria Condiion.PNG

l used the blue chest to indicate if the event is working otherwise l wouldn't be able to tell.
sdaf.PNG

Now when l used the item the Chest 1 revealed however chest 2 which should have been blue colour did not reveal it should have revealed in front of the green chest. l cannot figure out where l am going wrong with the events thanks in advance.
a timer use always needs two events: one to start the timer (one-time, never parallel) and one to check the timer (conditional branch, parallel)

you cannot have both in the same event because placing the start command in a parallel means that the timer is reset to start sixty times per second, never running out

And never call or attach a parallel process, that will not work co0rrectly because the parallel needs to be co0ntrolled by a switch
if you want to reset the timer and lose items, I would rather create
an array.
when a chests opens with Gold, push it to the array, if items, push it into it,
when you collect the amount of chests (variable chest += 1) and when
the conditions reads variable chest = 30, you give the items in the array,
if the time is up, empty the array = [] so the player has nothing.

the way you have it now wont work and is like Andar said.

it would be harder to track what items are collected and which not to subtract
those from the player.

another way around is, to make chest empty and just + 1 to the variable and text
what they get (no items/gold given) but added when they have it all within the
timer and variable is equal to the amount of chest (this might be easier for you)
if you dont know how array works 🙂
Why do you have the extra stuff going on with the treasure chest events and self switches?

You already have a switch that indicates the timer for your Ariaflute - the switch labeled Treasure Chest.

If you simply make page 2 of your chest events have a condition of Treasure Chest instead of the self switch, all the work is done for you - that page will be active for as long as your flute's timer is running, and it'll go back to page 1 when it's not.

Andar already described how your timer event itself looks to be incorrect, so I won't get into that, but that's the easy answer.
Hey guys thanks so much for all your responses could you help me with the conditions and the timing. Like what do l do?
Your treasure chest has 2 pages set to action button.
1st page has condition of switch FLUTE [gain gold, chest move routes etc, control self switch A on]
2nd page has condition self switch A [nothing]

You have 2 common events:
PLAYFLUTE (trigger NONE): start timer + control switch FLUTE ON
TIMER (trigger PARALLEL, switch FLUTE): IF timer = 0 -> stop timer + control switch FLUTE OFF, (+it's a good thing to also have a short wait time in parallel events)

Your flute item calls the common event PLAYFLUTE

EDIT:
For the flute cooldown mechanic you can make a 3rd common event
COOLDOWN (trigger PARALLEL, switch COOLDOWN): control variables cooldown +1, If cooldown > X -> [control variables cooldown = 0, control switches COOLDOWN OFF]

Then modify your PLAYFLUTE common event with a conditional:
IF COOLDOWN is ON -> The flute is too hot for my lips
ELSE -> start timer + control switch FLUTE ON + control switch COOLDOWN ON
Your treasure chest has 2 pages set to action button.
1st page has condition of switch FLUTE [gain gold, chest move routes etc, control self switch A on]
2nd page has condition self switch A [nothing]

You have 2 common events:
PLAYFLUTE (trigger NONE): start timer + control switch FLUTE ON
TIMER (trigger PARALLEL, switch FLUTE): IF timer = 0 -> stop timer + control switch FLUTE OFF, (+it's a good thing to also have a short wait time in parallel events)

Your flute item calls the common event PLAYFLUTE

EDIT:
For the flute cooldown mechanic you can make a 3rd common event
COOLDOWN (trigger PARALLEL, switch COOLDOWN): control variables cooldown +1, If cooldown > X -> [control variables cooldown = 0, control switches COOLDOWN OFF]

Then modify your PLAYFLUTE common event with a conditional:
IF COOLDOWN is ON -> The flute is too hot for my lips
ELSE -> start timer + control switch FLUTE ON + control switch COOLDOWN ON

what do you mean by
If cooldown > X -> whats the X?
X is just some number you make depending how long you want the cooldown to be. Like if the game runs 60 frames per second, then the cooldown variable increases by 60 every second (without waits), I think LOL.

So if you replace that X by 300 for example, then it would take 5 seconds to reach the cooldown.
X is just some number you make depending how long you want the cooldown to be. Like if the game runs 60 frames per second, then the cooldown variable increases by 60 every second (without waits), I think LOL.

So if you replace that X by 300 for example, then it would take 5 seconds to reach the cooldown.
oh ok also thanks so much the chest does go invisible when l interact with it if timer has run out. But l need the chest to go invisible as soon as the timer runs out and also isnt on the map when l enter so l had to use 3 pages.
1st page - image empty - if:flute is ON - Control self switch: A is on and 2nd event page. the same as you wrote in the 1st page but with self switch A ticked and also added before the line if flute is ON. Control Self Switch A = OFF. cause the chest needs to be hidden from the player innitially.

just now need to figure out how to make the chest go invisible automatically without interaction with the chest when timer runs out.
What?

If your chest first page has that switch condition, it is hidden initially, unless that switched is turned on.
And the chest goes invisible when the timer runs out, interacting with it shouldn't have anything to do with it?
Edit: Well, of course it doesn't go invisible if it's already opened, but an unopened chest should go invisible when the timer runs out.
What?

If your chest first page has that switch condition, it is hidden initially, unless that switched is turned on.
And the chest goes invisible when the timer runs out, interacting with it shouldn't have anything to do with it?
Edit: Well, of course it doesn't go invisible if it's already opened, but an unopened chest should go invisible when the timer runs out.
Timer ran out.png

this is what happaned when timer ran out its still visible ^ and the image below the chest went invis when l pressed enter. l havent added the cooldown event just yet
chest went invis.png
3.png
1.png
2.png
4.png
5.png
6.png
Can you post screenshots of the common events and chest event pages where you've set it up like I suggested?
Can you post screenshots of the common events and chest event pages where you've set it up like I suggest
i edited my last reply
@Latianempire
your screenshots do NOT follow the instructions you were given.
your first page is supposed to have condition switch flute, NOT the conditional branch
those are two different things.
and you were never told to make it a parallel either, it has to remain action button trigger to work with conditions.
The first page also needs the chest sprite, that way you only need two pages
if you you want to reset the items without having all the chests but gained,
do what I said unless you want them to keep, but you also need a scriptcall
to turn those SelfSwitches OFF if they fail what I dont see either.

if you want to have it working and use a timer, I can make something to work
for you in a few hours to make the mechanic work what you look for and study
that to implement in your own project.

you miss and makes things maybe to complicated which can be easier.
That is not set up like I suggested.

The way you have it set up now, is that the 2nd page will stay in effect even after the timer goes to zero, because you need to interact it with action button to turn off self switch A. And when you do interact with it, it returns to the first page and "turns invisible".
That is not set up like I suggested.

The way you have it set up now, is that the 2nd page will stay in effect even after the timer goes to zero, because you need to interact it with action button to turn off self switch A. And when you do interact with it, it returns to the first page and "turns invisible".
So if its not conditional where do l find the condition switch flute? under which event command

7.png
IT is NOT a COMMAND
The conditions are top left

All you need to do is:
1) right-click anywhere, quick event creation chest
2) open the chest event
3) activate condition switch top left
4) select switch flute in the condition
5) FINISHED - no other changes needed in the chest event

the chest will remain invisible as long as the switch is off, become visible when the start flute common event is processed and invisible again when the timer runs out - unless the chest was opened between those times.
IT is NOT a COMMAND
The conditions are top left

All you need to do is:
1) right-click anywhere, quick event creation chest
2) open the chest event
3) activate condition switch top left
4) select switch flute in the condition
5) FINISHED - no other changes needed in the chest event

the chest will remain invisible as long as the switch is off, become visible when the start flute common event is processed and invisible again when the timer runs out - unless the chest was opened between those times.
Thanks guys so much l appreciate it alot. l never use conditions besides self switch had no idea about that sorry about the frustrations

Original thread: https://forums.rpgmakerweb.com/threads/in-rpg-maker-mv-l-have-been-stuck-on-making-m-chests-go-invisible-after-time-runs-out-would-like-some-help-if-this-is-possible-thanks.161143/