Game Development Reference
In-Depth Information
@>Conditional Branch: Variable [0009:TreasureChestSeed] == 7
@>Change Gold: + 500
@>Text: -, -, Normal, Bottom
: : Got 500 Gold!
@>
: Branch End
@>Wait: 30 frame(s)
@>Control Variables: [0010:ChestsToOpen] -= 1
@>Erase Event
@>
The first part of the event was copy-pasted from RPG Maker VX Ace's (RMVXA's) Treasure Chest quick event.
It displays the animation that the player sees when opening a treasure chest. Afterward, we have the seven different
possible chest contents, based on the value of the TreasureChestSeed variable. The player will earn the appropriate
item and be apprised of the fact via text box, and after a half-second pause, the value of ChestsToOpen will drop by 1,
informing the game that the player has opened a chest. Erase Event is an event command I have not covered up to
now, but it is as simple as can be. When an event processes Erase Event , it effectively ceases to exist until the player
leaves the map. As you might have inferred, this could cause problems in the execution of the minigame. This will
definitely be addressed in the Parallel Process event, when we get it to it.
Populating the Chests of the Treasure Chest Game
So, if we want to have randomized results and have all seven rewards represented with every seed, each chest has to
give different items for the same seed value. For example, if the chest in the upper-left corner gives a Potion when
the seed is 1, another chest could give the single Gold piece in that case. Think of the list of items in a numerical
sense. That first chest has its items in the order 1234567. My second chest (the one to the right; let's go in a clockwise
rotation) has the items in the order 6412753. When the seed is 1, the player will receive 200 Gold, if he/she opens the
second chest. The idea is that two chests not give the same item (except in the case of the pair of 1 Gold chests). This is
rather hard to figure out mentally, given the large number of possibilities (many of which actually don't apply, as they
would cause two or more chests to give the same item). I personally used random.org's (specifically, www.random.
org/lists ) list shuffler. I wrote down 1234567 and then let the site do its work. A lot of the shuffled lists will not be
valid, but it will give you a good idea of what item combinations you need, especially as you get closer to the last chest.
Check Table 7-1 to see the seven-number lists I came up with.
Table 7-1. The Seven-Number Lists That Determine What Chest Has What Item in the Treasure Chest Game
1
6
2
7
4
3
5
2
4
7
3
5
1
6
3
1
6
2
7
5
4
4
2
1
5
6
7
3
5
7
4
1
3
6
2
6
5
3
4
1
2
7
7
3
5
6
2
4
1
 
 
Search WWH ::




Custom Search