A chest that closed when you leave the map?

jcmilkyway

Warper
Member
Joined
Sep 29, 2020
Messages
1
Reaction score
0
First Language
chinese
Primarily Uses
RMMV
hey guys thanks for check my question

I want to make a chest that closed when you leave the map, so that when you come back you can open it again.

here is what I have done(sorry for the Chinese)

I created a chest by default and deleted the tag page "2"
than I add erase event in the end, also show some text like "magic chest will respawn...etc"


here is the code
2.png


Then I add a erase event in the map so it can redo its job every time the character comes back.

like this
1.png


But I realized that this will cause all map event to redo its job.

is there any solutions to control only a single chest to closed when leaving the map?

thx
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,948
Reaction score
7,460
First Language
German
Primarily Uses
RMMV
no, erase event will ONLY erase the event the command is in, no other event.
So to affect that chest it needs to be in the chest event.

you'll need a different structure for this-
1) make the treasure quick event as usual. Do NOT delete the second page
2) add a third page conditioned to a general switch called "reset all chests" or so.
3) on that event page, control self-switch OFF to reset the chest, plus anything else you want to happen on reset.
4) switch the third page to parallel
5) on all exit transfer events, add asequence of three commands BEFORE transfer command:
control switch "reset all chests" ON
wait two frames
control switch "reset all chests" OFF

and before leaving the player will have all chests reset.
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,587
Reaction score
880
First Language
Dutch
Primarily Uses
RMMV
basicly, you dont need a third page,
you basicly put a different switch instead of a selfswitch,, use that switch on page 2,
when you leave that area, turn off the switch when you exit the map, and the chest
will resetted back.

easier and simpler, but you can use the switch for all chest you want to be resetted
when you change maps.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,948
Reaction score
7,460
First Language
German
Primarily Uses
RMMV
@ShadowDragon
there is a problem with your idea: if there is more than one chest with that switch, then all of them will switch to open as soon as the first chest is opened. That is the reason why the chest event uses a self-switch in the first place.

if you were to use a different switch for every chest and controll them off when leaving that would work, but it would use up much more switches than my solution...
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,966
Reaction score
13,603
First Language
English
Primarily Uses
RMMV
If you want the chest to disappear, it should just work by adding Erase Event instead of Control Self Switch.

You don't need additional pages or additional events or additional switches.

Chest appears, player opens it, chest opens, you get the loot, you get the message, chest disappears. Player leaves the map and returns, chest is there again, closed.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Yesterday I made my first step towards eating more healthily.
I saw candy on discount and did not buy it.
"They yearn for what they fear for."
I always told my DA fans how much I hate slot machines. They're fine in games as a risk-and-reward system. But when you're spending REAL MONEY in a Vegas casino to try and hit the jackpot (which very, very few people will), it can really hurt your budget. Gambling is a bad habit, and I don't like wasting my money on a slim chance. Go to Vegas for the experience, not the jackpot.
Took the kids to a corn maze. They gave us a map and had lights at certain points in the maze. Not overwhelming... or underwhelming... just... whelming.
Okay, vacuuming fruit flies out of the air is surprisingly effective.

Forum statistics

Threads
104,394
Messages
1,006,078
Members
135,928
Latest member
mich
Top