Not sure why you're turning a self switch on and then off again - what does that achieve?
It's messy. If you allocate a self switch to each item - A:Map, B:Card, C:Letter ...
Code:
Text: Let's see what's in here ...
If self switch A is ON
Comment: the map has been taken
If self switch B is ON
Comment: the card has been taken
If self switch C is ON
Comment: the letter has been taken
Text: It's Empty
Else
Comment: there's a letter
Show Choices: Letter, None
When [Letter]
Jump to label: GetLetter
When [None]
Text: Maybe I'll grab it later
End
End
Else
Comment: there's a card
If self switch C is ON
Comment: the letter has been taken
Show Choices: Card, None
When [Card]
Jump to label: GetCard
When [None]
Text: Maybe I'll grab it later
End
Else
Comment: there's a letter
Show Choices: Card, Letter, None
When [Card]
Jump to label: GetCard
When [Letter]
Jump to label: GetLetter
When [None]
Text: Maybe I'll grab them later
End
End
End
Else
Comment: there's a map
If self switch B is ON
Comment: the card has been taken
If self switch C is ON
Comment: the letter has been taken
Show Choices: Map, None
When [Map]
Jump to label: GetMap
When [None]
Text: Maybe I'll grab it later
Else
Comment: there's a letter
Show Choices: Map, Letter, None
When [Map]
Jump to label: GetMap
When [Letter]
Jump to label: GetLetter
When [None]
Text: Maybe I'll grab them later
End
End
Else
Comment: there's a card
If self switch C is ON
Comment: the letter has been taken
Show Choices: Map, Card, None
When [Map]
Jump to label: GetMap
When [Card]
Jump to label: GetCard
When [None]
Text: Maybe I'll grab them later
End
Else
Comment: there's a letter
Show Choices: Map, Card, Letter, None
When [Map]
Jump to label: GetMap
When [Card]
Jump to label: GetCard
When [Letter]
Jump to label: GetLetter
When [None]
Text: Maybe I'll grab them later
End
End
End
End
Comment: If we reach this line, the chest was empty or the player took nothing
Exit Event Processing
Comment: Get the Map
Label: GetMap
Change Items: [Map] + 1
Text: Map obtained!
Control Self Switches A = ON
Exit Event Processing
Comment: Get the Card
Label: GetCard
Change Items: [Card] + 1
Text: Card obtained!
Control Self Switches B = ON
Exit Event Processing
Comment: Get the Letter
Label: GetLetter
Change Itesm: [Letter] + 1
Text: Letter obtained!
Control Self Switches C = ON
Exit Event Processing
What we're doing is turning on a self switch when the player takes something, so next time they look in the chest you know what they've taken and what's still there. Doing a series of conditional branches and the choices, but separating the results, means you don't have to put all the logic for each item in multiple times. There are 4 situations where the player could get the map - if the map is on its own in the chest, if it's with the letter, if it's with the card, or if all 3 items are in there. You don't want to have to do the "get map" logic 4 times! Using self switches would allow you to have up to 4 items in the chest. If you did go for a 4th item with self switch D, your event would be nearly twice as long.
This way also means you don't have to have the second event page for an empty chest, though if you did want to (to make the chest disappear or change the graphic), it's just a matter of checking the other two self switches when you turn one on, and if they are both on, also turn on self switch D, which will condition the next page (in that case, you could only have 3 items unless you had a 'more self switches' script/plugin):
Code:
Comment: Get the Map
Label: GetMap
Change Items: [Map] + 1
Text: Map obtained!
Control Self Switches A = ON
If Self Switch B = ON
If Self Switch C is ON
Control Self Switches D = ON
End
End
Exit Event Processing
(and repeat for the other two, but checking the two self switches for the other items)