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,907
Reaction score
7,447
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,574
Reaction score
875
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,907
Reaction score
7,447
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,601
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

Ami
--- Diary ---

M.Mage: It's the F.Mage's Diary. While she isn't here,i can read it.

May, 10: I'm hurt after the battle with the Minotaur. But luckily,F.Healer heal me with her Heal-2. That why,i Fall in Love with her.

M.Mage: Eh???
So... some of my Desktop hardware has kicked it apparently (still trying to figure out what and how at the moment :/ ) .... yay?
Stream will be live shortly with some Darkest Dungeon! Feel free to drop by!
Made a HUGE (YYOOOOJJ) Update to Monstructs and moving towards a Steam Early Access release!

Forum statistics

Threads
104,224
Messages
1,004,808
Members
135,740
Latest member
Animalblack
Top