CHAPTER 7

image

Arenas and Other Minigames

Eric and Noah’s adventures in our world have been relatively gloom and doom up to now. While they’re merely player-characters and don’t mind their status as such, their alter egos (a.k.a. the players themselves) would probably appreciate a change of pace. Minigames are a classic video game tradition. To take a somewhat recent example, Grinsia (which had a mobile release and a recent rerelease on the Nintendo 3DS) has a shooting gallery minigame. Sometimes, the player just wants to explore off the beaten path and do something unrelated to the main plot at hand. Sidequests are a good way to do that, and I’ll be talking about them in a later chapter. This particular chapter, however, is all about having fun within the fun that is a game. Meta, isn’t it?

Why an Arena?

Well, while being nominally less of a minigame than most other concepts (given that arenas usually involve battling, which you already do in most role-playing games [RPGs]), arenas require a decent amount of eventing and afford the opportunity to introduce features we haven’t talked about before. Besides, you get to beat up assorted baddies for fame, glory, and special prizes! What’s not to like?

What If I Want Another Minigame?

I have a few more ideas lined up for this chapter, including using eventing to come up with a similar treasure chest game as the one in The Legend of Zelda. For now, though, let’s press on with the arena.

Arena Overview

Just the mere mention of the word arena evokes gladiatorial combat, as in the times of ancient Rome. In an RPG, arenas can be loosely divided into two categories:

  1. One in which the player and/or his/her allies fight against predetermined encounters.
  2. One in which the player watches a group of combatants face each other and bets on the outcome.

The first type is much more common than the second, especially nowadays. You can look to Dragon Warrior 3 for an example of the second. Here’s a list of the things we’ll need to have or know:

  • A map in which we can host our arena. You can have both parts of the arena on one map, but we’ll split them into two, to make things a little less cluttered.
  • A nonplayer character (NPC) that allows the player to sign up for arena events
  • Another NPC that allows the player to trade in his/her hard-earned arena currency for rare prizes
  • A list of ranks to aspire to and battles to be fought, as well as the amount of special currency to award for each victory in a rank
  • Whether the player will have to fight alone or with the companions he/she has recruited during his/her quest n

Outlining Our Arena

This is one of those bigger projects for which it is better to write down everything you can before you actually sit down and start trying to event it. Let’s lay this out one step at a time.

  1. Number of Arena Ranks: 4 (D, C, B, A)
  2. Number of battles per rank: 3
  3. Currency awarded for clearing a rank (D = 2, C = 4, B = 8, A = 16)
  4. Rank D Battles
    • Slime*2
    • Bat*2
    • Wisp*3
  5. Rank C Battles
    • Large Snake*2
    • Scorpion*3
    • Orc*3
  6. Rank B Battles
    • Imp*2
    • Gazer*3
    • Puppet*2
  7. Rank A Battles
    • Chimera
    • Werewolf*2
    • Gargoyle*2

So, that’s the outline for the things we want to include within our arena.

Creating the Arena Exterior

So, how do we go about setting up the arena itself? First, we have to create the first map for the arena. This is where the player will land, upon accessing the location from the world map. Take a look at Figure 7-1 to see the layout of the first arena area.

9781484207857_Fig07-01.jpg

Figure 7-1. The building that contains the arena

The player enters the area from that opening near the southeastern end of the map. In front of him/her is the lobby that could be home to other arena fighters. The northwest corner of the map has an inn, if the player needs to recover from wounds, while the southwest holds the arena sign-up NPC (left) and the arena exchange NPC (right). Feel free to use this basic map idea and flesh it out to your heart’s content. Be forewarned that creating the arena as I did was a task requiring many long hours of trial and error. As we work through this, you’ll quickly see why.

Overview of the Arena Sign-up Event

The arena sign-up NPC (and the exchange NPC, for that matter) will have an Action Button trigger. The NPC will greet the player, welcoming him/her to the arena, and then ask what it can do for him/her. I use a Show Choices event command with three choices at this point. The choices are

  • Arena Battle: As the choice suggests, this will bring up a list of ranks that the player can challenge. At the start of the player’s arena career, he/she can only challenge the lowest rank (in this case, D).
  • How does this work?: Perfect for the first-timer. This will prompt the NPC to explain exactly how the arena works.
  • Bye: The player ends the conversation.

The preceding seems rather unassuming, but here’s what happens in the event code when the player chooses Arena Battle:

  • The game determines, via the analysis of various related switches, what ranks of the arena (if any) the player has cleared.
  • A Show Choices prompt appears, based on said analysis.
    1. If the player has not cleared any ranks, the prompt will show Rank D and Nevermind.
    2. If the player has cleared Rank D, the prompt will show Rank D, Rank C, and Nevermind.
    3. If the player has cleared Rank C, the prompt will show Rank D, Rank C, Rank B, and Nevermind.
    4. If the player has cleared Rank B, there will be two prompts. The first will contain Rank D, Rank C, Next Page, and Nevermind. Clicking Next Page will reveal the second prompt, which contains Previous Page, Rank B, Rank A, and Nevermind.
    5. As Rank A is the highest rank, clearing it doesn’t change anything.
  • When the player chooses a rank to challenge, the arena NPC will charge the player a certain amount of gold (the higher the rank, the higher the cost). If he/she accepts the cost, it is deducted from the player’s gold, and he/she is transferred to the proper arena map.

And that’s only what’s on the first map. There is an Autorun event that triggers, based on each separate rank, once the player reaches the second one, which serves out the relevant fights. If the player wins all three matches or is defeated, he/she is sent back to the first map, to speak with the arena NPC once again, which will either congratulate the player and give him/her a reward (in the case of a win) or urge him/her to do better next time (in the case of a loss).

Creating the Arena Sign-up

I’m going to make this slightly simpler than the version I came up with and disregard party members. Eric and Noah will be able to both participate in the arena at the same time. Even then, I have to note that a total of ten switches are used for this event. (You would need one more switch on top of that for every character you want to temporarily remove from the player’s party.) Here’s the first stage of our arena event.

@>Text: -, -, Normal, Bottom
:     : Welcome to the Arena, where battlers from
:     : all over existence come to do battle!
@>Label: MainMenu
@>Text: -, -, Normal, Bottom
:     : What can I do for you?
@>Show Choices: Arena Battle, How does this work?, Bye
: When [Arena Battle]
   @>
: When [How does this work?]
   @>Text: -, -, Normal, Bottom
   :     : I'm glad you asked, wanderer.
   @>Text: -, -, Normal, Bottom
   :     : Essentially, you start at the bottom of the ladder,
   :     : at Rank D. Win three matches in Rank D and you
   :     : will unlock Rank C, and so forth. It costs Gold to
   :     : compete in each rank, so mind your pocket.
   @>Text: -, -, Normal, Bottom
   :     : The top rank is Rank A, but none have ever
   :     : completed the three bouts at that level.
   @>Text: -, -, Normal, Bottom
   :     : You are completely healed at the end of
   :     : each match, and you can use items as need
   :     : be. However, be careful as we do not
   :     : refund the cost of items used in the Arena.
   @>Text: -, -, Normal, Bottom
   :     : Use them only if they will secure your victory in
   :     : battle.
   @>Jump to Label: MainMenu
   @>
: When [Bye]
   @>Text: -, -, Normal, Bottom
   :     : Later.
   @>
: Branch End
@>Label: EndPage
@>

The good news is that we’re on our way. The bad news is that this is the simplest this event will rather be. Oh, boy, is it going to get extensive! We’re going to want conditionals for each and every possibility. As already noted, a fresh player will have cleared no ranks. Each rank clear will be stored in a single appropriately named switch. We need to have a switch for each possible challenge as well. Last, we need a switch to flip when the player wins his/her matches and another to flip when the player loses his/her matches. What follows are a large series of conditional branches that will make perfect sense in hindsight. First, we have the conditional branch for when the player has not cleared Rank D. As you can see in the following code listing, we have a universal sentence that will show up before the event starts determining which branch will be executed. The sentence asks the player what rank he/she would like to challenge. As Rank D has not been cleared, the resulting prompt will only have two choices. Rank D has a cost of 100 Gold for the player, and if the player doesn’t have the money, the game will return an error message and send him/her back to the initial three choices. If the player does have the Gold, it will be deducted, and the RankDChallenge switch will be flipped.

: When [Arena Battle]
   @>Text: -, -, Normal, Bottom
   :     : What rank would you like to challenge?
   @>Conditional Branch: Switch [0008:RankDClear] == OFF
      @>Show Choices: Rank D, Nevermind
      : When [Rank D]
         @>Label: RankDChallenge
         @>Text: -, -, Normal, Bottom
         :     : This will cost you 100 Gold. Are you sure?$
         @>Show Choices: Yes, No
         : When [Yes]
            @>Conditional Branch: Gold is 100 or more
               @>Change Gold: -100
               @>Text: -, -, Normal, Bottom
               :     : Good luck!
               @>Fadeout Screen
               @>Play SE: 'Move', 80, 100
               @>Control Switches: [0014:RankDChallenge] = ON
               @>Transfer Player:[012:Arena] (008,008), Up
               @>Jump to Label: EndPage
               @>
             : Else
               @>Text: -, -, Normal, Bottom
               :     : You don't have enough Gold!
               @>Jump to Label: MainMenu
               @>
             : Branch End
            @>
         : When [No]
            @>Jump to Label: MainMenu
            @>
         : Branch End

You may notice the strange lack of Fadein Screen on this event. As we transfer the player to the other map, we use Fadein over there instead.

Creating the Arena Battle Event

Once the player has signed up to participate in the arena, he/she is transferred to the arena grounds. This section will walk you through creating the battle event that the player will have to face in the arena. Before talking about the event in question, take a look at Figure 7-2 for a screenshot of the arena grounds.

9781484207857_Fig07-02.jpg

Figure 7-2. The interior part of the arena, where the player battles assorted baddies for fame and glory

We transfer the player to the center of that map, a few squares to the south of the armored NPC that we’re using as the arena announcer. An RPG arena just isn’t much of one if someone isn’t announcing challengers and such. We can kill two birds with one stone, as it were, by making that particular NPC our Autorun event as well. He will have a total of four event pages. Each page has a conditional for each particular rank challenge switch. So, page 1 requires RankDChallenge to be on, page 2 requires RankCChallenge to be turned on, and so forth. The general format of the arena challenges is as follows:

  • A short announcement of the player’s party is made.
  • A Battle Processing event in which the player can continue the game if he/she happens to lose the battle begins.
  • If the player wins, the game loads up the second fight. If the player loses, he/she is sent back to the first map.
  • The same process is repeated until the player wins three fights or loses.
  • Take a look below for a large part of the Rank D Challenge Autorun event.
@>Fadein Screen
@>Wait: 60 frame(s)
@>Text: -, -, Normal, Bottom
:     : Welcome to the Rank D Arena Challenge!
:     : Are the challengers ready?
@>Text: 'Actor4', 0, Normal, Bottom
:     : I am.
@>Text: 'Actor5', 6, Normal, Bottom
:     : As am I.
@>Text: -, -, Normal, Bottom
:     : Let the games begin!
@>Battle Processing: Slime*2
: If Win
   @>Recover All: Entire Party
   @>Text: -, -, Normal, Bottom
   :     : Our challengers have won Round 1!
   @>Play SE: 'Applause1', 80, 100
   @>Text: -, -, Normal, Bottom
   :     : However, there are still two more rounds left!
   :     : Will our challengers rise to the challenge?!
   @>Text: -, -, Normal, Bottom
   :     : Round 2 is now!
   @>Battle Processing: Bat*2
   : If Win
      @>Recover All: Entire Party
      @>Text: -, -, Normal, Bottom
      :     : The challengers take the second win of the day
      :     : in Rank D!
      @>Play SE: 'Applause1', 80, 100
      @>Text: -, -, Normal, Bottom
      :     : This is the moment of truth!
      :     : Will our aspiring challengers take the
      :     : title? Or, will the final challenge of Rank D
      :     : prove too much to handle?!
      @>Text: -, -, Normal, Bottom
      :     : Let loose the monsters of war!!
      @>Battle Processing: Wisp*3
      : If Win
         @>Recover All: Entire Party
         @>Text: -, -, Normal, Bottom
         :     : They have done it!
         @>Control Switches: [0013:ArenaWin] = ON
         @>Jump to Label: Return
         @>
      : If Lose
         @>Recover All: Entire Party
         @>Text: -, -, Normal, Bottom
         :     : Aww. So close, yet so far!
         :     : They have lost the final match!
         :     : Better luck next time!
         @>Control Switches: [0012:ArenaLoss] = ON
         @>Jump to Label: Return
         @>
       : Branch End

As noted before, the Autorun event on the second map starts with a Fadein Screen (if we didn’t do this, the screen would stay black). When you toggle the Continue When Loser check box, the Battle Processing event command as displayed splits into If Win and If Lose. Note the differing switches that are flipped depending on whether the player wins or loses. We heal the player’s party after every battle, win or lose. You can see the rest of the event, following.

   @>
   : If Lose
      @>Recover All: Entire Party
      @>Text: -, -, Normal, Bottom
      :     : Ouch. Well, at least they won 1 out of 3.
      :     : Better luck next time.
      @>Control Switches: [0012:ArenaLoss] = ON
      @>Jump to Label: Return
      @>
   : Branch End
   @>
: If Lose
   @>Recover All: Entire Party
   @>Text: -, -, Normal, Bottom
   :     : It appears they have been trounced in
   :     : their very first match!
   @>Text: 'Actor4', 0, Normal, Bottom
   :     : …
   @>Text: -, -, Normal, Bottom
   :     : Better luck next time!
   @>Control Switches: [0012:ArenaLoss] = ON
   @>Jump to Label: Return
   @>
: Branch End
@>Label: Return
@>Fadeout Screen
@>Transfer Player:[011:Arena] (009,027), Left
@>

Here you can see where all of those Jump to Label: Return commands lead. As in several other cases previously, I used these solely as a precaution, given that there’s no way for unwanted events to execute. The screen is faded out before we transfer the player back to the first map. The other three rank challenge events can be added to our announcer in the same way. All you have to change between each one are the chosen encounters and, if you desire, some of the text shown to the player.

Creating the Arena Result Event

Back at the first map, we need an Autorun event (I placed a blank graphic event behind the arena sign-up NPC) to handle the post-arena results. Because we have four possible challenges, and two possible outcomes for said challenges, this event will have eight total pages. Don’t be daunted, as the pages are simple enough.

  • Page 1 requires RankDChallenge and ArenaWin to be on.
  • Page 2 requires RankDChallenge and ArenaLoss to be on.
  • Every pair of pages after that will represent a different ranked challenge when the player wins and when the player loses.
@>Fadein Screen
@>Wait: 60 frame(s)
@>Conditional Branch: Switch [0008:RankDClear] == OFF
   @>Text: -, -, Normal, Bottom
   :     : Congratulations on clearing Rank D!
   :     : Greater challenges await you in Rank C,
   :     : whenever you are ready to face them!
   @>Play SE: 'Item3', 80, 100
   @>Text: -, -, Normal, Bottom
   :     : You have earned 2 Arena Tokens!
   @>Change Items: [Arena Token], + 2
   @>Control Switches: [0014:RankDChallenge] = OFF
   @>Control Switches: [0014:ArenaWin] = OFF
   @>Control Switches: [0014:RankDClear] = ON
   @>Jump to Label: Done
   @>
: Branch End
@>Conditional Branch: Switch [0008:RankDClear] == ON
   @>Text: -, -, Normal, Bottom
   :     : Way to beat Rank D there!
   :     : However, you've done this already, right?
   :     : Come on, take a risk or two and take
   :     : a harder challenge, would you?!
   @>Play SE: 'Item3', 80, 100
   @>Text: -, -, Normal, Bottom
   :     : You have earned 2 Arena Tokens!
   @>Change Items: [Arena Token], + 2
   @>Control Switches: [0014:RankDChallenge] = OFF
   @>Control Switches: [0014:ArenaWin] = OFF
   @>Jump to Label: Done
   @>
: Branch End
@>Label: Done
@>Recover All: Entire Party
@>

This is the first half of the pair of events for Rank D challenges. As the pair of conditional branches and their contained text will imply, this is the page that requires that the player clear his/her challenge. We start with a Fadein (as the event on the other map ended with a Fadeout) and a one-second wait time after the screen fades in. Afterward, what executes next depends on whether the player has cleared Rank D before or not. If he/she has not, the first branch triggers, and the player is congratulated on the first-time win and earns two Arena Tokens. (I replaced item #14 to add them to the game; they are a Key Item that cannot be consumed, used, or sold from the player’s inventory.) Afterward, because the player is through competing for the moment, we flip off the pair of switches that have been flipped on (in this case, RankDChallenge and ArenaWin) and flip on the RankDClear switch. That Jump to Label is not superfluous. Because the player now has RankDClear switched on, the next branch will execute automatically, unless we skip it via a label jump. That branch, incidentally, is what executes when the player has already beaten Rank D before and is just repeating the challenge. After a minor berating by the NPC, the player earns his/her reward, and the two relevant switches flip off. On the other hand, here’s the loss event for Rank D challenges:

@>Fadein Screen
@>Wait: 60 frame(s)
@>Text: -, -, Normal, Bottom
:     : Don't sweat it. It happens to the best of
:     : us. Get a bit stronger and come back fighting!
@>Recover All: Entire Party
@>Control Switches: [0014:RankDChallenge] = OFF
@>Control Switches: [0012:ArenaLoss] = OFF
@>

As you can see, it’s pretty much a little fluff, then the party is healed, and then the challenge and arena loss switches are flipped off. Rather simple compared to the win event, isn’t it? Now, win or lose, we’re back at our starting location. The player can choose to attempt another challenge (including taking the Rank C challenge, if he/she beats Rank D on his/her first attempt) or go do something else.

Miscellaneous Arena Considerations

There are only two things left to cover with the arena. First, let’s include the code of the Arena Battle event when the player has beaten Rank D.

@>Conditional Branch: Switch [0008:RankDClear] == ON
   @>Conditional Branch: Switch [0009:RankCClear] == OFF
      @>Show Choices: Rank D, Rank C, Nevermind
      : When [Rank D]
         @>Jump to Label: RankDChallenge
         @>
      : When [Rank C]
         @>Label: RankCChallenge
         @>Text: -, -, Normal, Bottom
         :     : This will cost you 500 Gold. Are you sure?$
         @>Show Choices: Yes, No
         : When [Yes]
            @>Conditional Branch: Gold is 500 or more
               @>Change Gold: -500
               @>Text: -, -, Normal, Bottom
               :     : Good luck!
               @>Fadeout Screen
               @>Play SE: 'Move', 80, 100
               @>Control Switches: [0015:RankCChallenge] = ON
               @>Transfer Player:[012:Arena] (008,008), Up
               @>Jump to Label: EndPage
               @>
             : Else
               @>Text: -, -, Normal, Bottom
               :     : You don't have enough Gold!
               @>Jump to Label: MainMenu
               @>
             : Branch End
            @>
         : When [No]
            @>Jump to Label: MainMenu
            @>
         : Branch End

What we see here will be consistent in every conditional branch from here to the end of the arena sign-up event. We check to see if the previous rank in the list was cleared. If so, we make sure that the next one has not been cleared yet. If it has, we’d be skipping to the next branch in the line. In this case, as the player has only beaten Rank D, he/she should be challenging Rank C next. Note the Jump to Label if the player picks Rank D. Redundancy is fine for some fields of work, but in game design, you usually only want to write the same code once, if possible. Then, you call back to that code when you need it. I’ll be touching upon common events in a later chapter, to tidy up some of our previous code. For now, it will suffice to know that we have already written out the Rank D challenge in a previous conditional branch, so we just jump back to it, instead of repeating the same code a second time.

I’ll leave the rest of the eventing of these already mentioned events up to you, as it is pretty much identical to what we have done so far. What you would need to fill out follows:

  • Pages 2 to 4 of the announcer Autorun event: As already mentioned, each page will have a conditional based on the rank that is being challenged. You would have to create Ranks C through A.
  • Pages 3 to 8 of the post-challenge Autorun event placed behind the arena sign-up NPC: Remember to have one page for a win and another for a loss, in each particular rank.
  • The remaining conditional branches in the arena sign-up event: We need one when the player has beaten Rank C and another when the player has beaten Rank B.

Creating Our Arena Shop

Now we have most of the events set up; however, we have not done anything with the NPC that will exchange tokens for items. Let’s remedy that. There are two ways to set up a token shop.

  1. You award special key items that serve as currency. Then, you set up a special shop that, in reality, is a series of Show Choices that each costs a differing amount of tokens.
  2. You award arena currency by adding value to a variable. Then, by clever use of currency swapping, you make it so that you can use the default shop with the currency you have earned. I’ll provide a template for the latter later on.

I’ll show both possibilities, but the second is definitely easier than the first. Following, you’ll find a listing of half of the first arena shop possibility.

@>Text: -, -, Normal, Bottom
:     : Hello there! This is the Arena Exchange! I can trade
:     : you special items for any tokens you may have
:     : earned from your Arena participation.
@>Text: -, -, Normal, Bottom
:     : Here's what I have available.
@>Control Variables: [0006:arenacurrency] = [Arena Token] in Inventory
@>Show Choices: Elixir - 5 Tokens, Defense Piece - 15 Tokens, Solomon's Ring - 30 Tokens, Bye
: When [Elixir - 5 Tokens]
   @>Text: -, -, Normal, Bottom
   :     : To confirm, an Elixir will cost you 5 Tokens.
   @>Text: -, -, Normal, Bottom
   :     : You currently have V[6] Arena Tokens. Will you
   :     : purchase an Elixir?
   @>Show Choices: Yes, No
   : When [Yes]
      @>Conditional Branch: Variable [0006:arenacurrency] >= 5
         @>Change Items: [Elixir], +1
         @>Change Items: [Arena Token], -5
         @>Text: -, -, Normal, Bottom
         :     : Enjoy!
         @>
         : Else
         @>Text: -, -, Normal, Bottom
         :     : You don't have enough Tokens!
         @>
         : Branch End
      @>
   : When [No]
      @>Text: -, -, Normal, Bottom
      :     : Okay. See you later!
      @>
   : Branch End

We have the NPC greet the player, as is usual. Then, we have a new variable to hold the number of Arena Tokens that the player has in his/her inventory. A Show Choices prompt appears with three possible item purchases and Bye as the last option. When the player clicks an item choice, the NPC confirms the cost, tells the player how many Arena Tokens he/she currently has, and asks if he/she wishes to purchase the item, bringing up a Yes/No choice prompt. In what is perhaps one of the few times I’ll ever use Set handling when conditions do not apply, we make sure that the player has the Arena Tokens to purchase the item in question. If the player doesn’t, we return an error message; otherwise, we add the item to the player’s inventory and remove the appropriate number of tokens.

: When [Defense Piece - 15 Tokens]
   @>Text: -, -, Normal, Bottom
   :     : You currently have V[6] Arena Tokens. Will you
   :     : purchase a Defense Piece?
   @>Show Choices: Yes, No
   : When [Yes]
      @>Conditional Branch: Variable [0006:arenacurrency] >= 15
         @>Change Items: [Defense Piece], +1
         @>Change Items: [Arena Token], -15
         @>Text: -, -, Normal, Bottom
         :     : Enjoy!
         @>
         : Else
         @>Text: -, -, Normal, Bottom
         :     : You don't have enough Tokens!
         @>
         : Branch End
      @>
   : When [No]
      @>Text: -, -, Normal, Bottom
      :     : Okay. See you later!
      @>
: When [Solomon's Ring - 30 Tokens]
   @>Text: -, -, Normal, Bottom
   :     : You currently have V[6] Arena Tokens. Will you
   :     : purchase a Solomon's Ring?
   @>Show Choices: Yes, No
   : When [Yes]
      @>Conditional Branch: Variable [0006:arenacurrency] >= 15
         @>Change Items: [Defense Piece], +1
         @>Change Items: [Arena Token], -15
         @>Text: -, -, Normal, Bottom
         :     : Enjoy!
         @>
         : Else
         @>Text: -, -, Normal, Bottom
         :     : You don't have enough Tokens!
         @>
         : Branch End
      @>
   : When [No]
      @>Text: -, -, Normal, Bottom
      :     : Okay. See you later!
      @>
   : Branch End
: When [Bye]
  @>Text: -, -, Normal, Bottom
   :    : Later.
  @>
  : Branch End
@>

This type of arena shop, as you can see, is simple enough. Unfortunately, it becomes less and less useful the more items you want to add to the shop. The Show Choices event command can only hold a total of four choices, so you would be required to add options merely to switch between Choice branches.

The second way is much easier and has only one quirk that will require scripting to address. However, as the quirk is graphical in nature, it doesn’t affect the event’s functionality, so have at it! Take a look at the following:

@>Text: -, -, Normal, Bottom
:     : Hello there! This is the Arena Exchange! I can trade
:     : you special items for any tokens you may have
:     : earned from your Arena participation.
@>Text: -, -, Normal, Bottom
:     : Here's what I have available.
@>Control Variables: [0007:PartyGold] = Gold
@>Change Gold: - 9999999
@>Change Gold: + Variable [0006:arenacurrency]
@>Shop Processing: [Elixir]
:                                : [Defense Piece]
:                                : [Solomon's Ring]
@>Control Variables: [0006:arenacurrency] = Gold
@>Change Gold: -9999999
@>Change Gold: + Variable [0007:PartyGold]
@>

In the second type of arena shop, we save the player’s Gold in a variable appropriately named PartyGold. In this setup, you would have the player receive his/her arena currency in a variable instead of in the form of items. Then, we zero out the player’s Gold and add his/her arena currency to his/her Gold value. We make sure that the Purchase Only check box is toggled and then add any items we wish the player to be able to purchase. Set the price of Elixirs to 5, the price of Defense Pieces to 15, and the price of Solomon’s Rings to 30. After the player closes the shop, we restore his/her Gold and arena currency to their original places. Figure 7-3 is a screenshot of the arena shop in all of its glory.

9781484207857_Fig07-03.jpg

Figure 7-3. The arena shop

As you can already tell, despite the fact that we switched from Gold to arena currency, it is still using G (to represent Gold). A small amount of scripting can be used to change the currency symbol, as desired. I’ll link to a short script created for that purpose by Tsukihime in the Appendix, so go take a look, if you wish to do that now.

Image Note  Keep in mind that you will not be able to use the above mentioned script (or any others, for that matter) if you are working with the Lite version of RMVXA.

With that said and done, we have finally completed this part of Chapter 7, a whopping 15 pages after we started! Here are some exercises to do before we move on to another minigame.

  1. Add extra rewards that are earned by the player the first time he/she clears a certain rank.
  2. Use Battle Processing: Same As Encounter in tandem with an encounter table on the map, to add some random possibilities to arena battles at Rank A.

As the player doesn’t move while on the second map, you could leave the default Range on the possible encounters. Just to be safe, you could make it so that random encounters only appear on that map within a specific Region.

The Treasure Chest Game

This is a game in which the player opens a certain number of chests in the designated playing area. Will the player receive riches or scraps? During the course of this section, I’ll be creating a seven-chest game. Take a look at Figure 7-4 to see what the area looks like when complete.

9781484207857_Fig07-04.jpg

Figure 7-4. The treasure chest room

We have the game host in the center of the map, surrounded by his seven chests. Here’s what we need to do to make our treasure chest game:

  • Come up with a list of rewards that can be obtained. I’ll list my seven, but feel free to come up with your own.
    1. Potion
    2. 1 Gold
    3. Elixir
    4. 1 Gold (Yes, the player has two chances to get 1 Gold).
    5. Hi-Potion
    6. 200 Gold
    7. 500 Gold
      • Add a variable that will store the current “seed” for the treasure chests. We want to make it so that the contents of a particular chest are one of those seven, on a random basis. Otherwise, the player can just open the same chest and get the same reward consistently. A chest’s contents will change, based upon the seed value.
      • Add a switch that will be flipped on while the minigame is in progress and turned off once it is completed.
      • Make it so that, once opened, a chest disappears for the duration of the minigame and reappears afterward.
      • Have a variable that decreases every time the player opens a chest. We’ll set this to two at the start of the minigame, meaning that the player can open two of the seven chests present.
      • Once two chests have been opened, announce that the game is over and reset the initial starting conditions, so that the player can play again, if he/she so chooses.

To pull this off with eventing, we’ll have to set up each treasure chest individually, as well as create the NPC and the Parallel Process event that triggers when the game is over. I’m going to start with the chest in the upper-left corner. Let’s call that chest the master, as the rewards listed previously will be placed into the event in the same order. As the chests will be present even while the game is not active, we have to make sure that the player cannot open them. Each chest will be a two-page event, in which page 1 has a treasure chest graphic and Direction Fix has been toggled. (This makes it so that the chest does not appear to open slightly if the player interacts with it from certain angles). If the player tries to interact with the chest, the event will show a text box declaring that it is locked. Page 2 has the TreasureChestStart switch conditional, meaning that it will not trigger unless the minigame is currently active. As with page 1, this page will have an Action Button trigger.

@>Set Move Route: This event (Wait)
:               : $>Direction Fix OFF
:               : $>Turn Left
:               : $>Wait: 3 frame(s)
:               : $>Turn Right
:               : $>Wait: 3 frame(s)
@>Conditional Branch: Variable [0009:TreasureChestSeed] == 1
   @>Change Items: [Potion], + 1
   @>Text: -, -, Normal, Bottom
   :     : Got a Potion!
   @>
: Branch End
@>Conditional Branch: Variable [0009:TreasureChestSeed] == 2
   @>Change Gold: + 1
   @>Text: -, -, Normal, Bottom
   :     : Got a single Gold piece!
   @>
: Branch End
@>Conditional Branch: Variable [0009:TreasureChestSeed] == 3
   @>Change Items: [Elixir], + 1
   @>Text: -, -, Normal, Bottom
   :     : Got an Elixir!
   @>
: Branch End
@>Conditional Branch: Variable [0009:TreasureChestSeed] == 4
   @>Change Gold: + 1
   @>Text: -, -, Normal, Bottom
   :     : Got a single Gold piece!
   @>
: Branch End
@>Conditional Branch: Variable [0009:TreasureChestSeed] == 5
   @>Change Items: [Hi-Potion], + 1
   @>Text: -, -, Normal, Bottom
   :     : Got a Hi-Potion!
   @>
: Branch End
@>Conditional Branch: Variable [0009:TreasureChestSeed] == 6
   @>Change Gold: + 200
   @>Text: -, -, Normal, Bottom
   :     : Got 200 Gold!
   @>
: Branch End
@>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

Table7-1.jpg

As you can see, our master list is the left-most column. Each column corresponds to a different chest from top to bottom. Take a moment to look at the numbers and note that no numbers repeat when reading from left to right. For example, the first row is 1627435, which has no numerical repeats. If your rows aren’t repeating, chances are that the slot in question is fine. To prove the point, if the minigame rolls a 1 for the seed, here’s what you can expect from each chest:

  1. Potion
  2. 200 Gold
  3. 1 Gold
  4. 500 Gold
  5. 1 Gold
  6. Elixir
  7. Hi-Potion

Pretty neat, isn’t it? As crunching permutations is rather secondary to the point of this book, feel free to use the grid that I came up with for your own chests. What you can do is copy-paste page 2 of the master chest event. Then, depending on the chest number, you move around the various items in the event page, so that the item order matches the ordered list that you want. Once you have done that, you renumber the conditional branches such that they go from 1 to 7, as in the master chest: same items, different seed order. For additional context, check the eventing of the second treasure chest on the following page, so that you can get a visual of what I mean. I’ll leave the rest of the chests to you, as this involves more of the same, as already has been noted.

@>Set Move Route: This event (Wait)
:               : $>Direction Fix OFF
:               : $>Turn Left
:               : $>Wait: 3 frame(s)
:               : $>Turn Right
:               : $>Wait: 3 frame(s)
@>Conditional Branch: Variable [0009:TreasureChestSeed] == 1
   @>Change Gold: + 200
   @>Text: -, -, Normal, Bottom
   :     : Got 200 Gold!
   @>
: Branch End
@>Conditional Branch: Variable [0009:TreasureChestSeed] == 2
   @>Change Gold: + 1
   @>Text: -, -, Normal, Bottom
   :     : Got a single Gold piece!
   @>
: Branch End
@>Conditional Branch: Variable [0009:TreasureChestSeed] == 3
   @>Change Items: [Potion], + 1
   @>Text: -, -, Normal, Bottom
   :     : Got a Potion!
   @>
: Branch End
@>Conditional Branch: Variable [0009:TreasureChestSeed] == 4
   @>Change Gold: + 1
   @>Text: -, -, Normal, Bottom
   :     : Got a single Gold piece!
   @>
: Branch End
@>Conditional Branch: Variable [0009:TreasureChestSeed] == 5
   @>Change Gold: + 500
   @>Text: -, -, Normal, Bottom
   :     : Got 500 Gold!
   @>
: Branch End
@>Conditional Branch: Variable [0009:TreasureChestSeed] == 6
   @>Change Items: [Hi-Potion], + 1
   @>Text: -, -, Normal, Bottom
   :     : Got a Hi-Potion!
   @>
: Branch End
@>Conditional Branch: Variable [0009:TreasureChestSeed] == 7
   @>Change Items: [Elixir], + 1
   @>Text: -, -, Normal, Bottom
   :     : Got an Elixir!
   @>
: Branch End
@>Wait: 30 frame(s)
@>Control Variables: [0010:ChestsToOpen] -= 1
@>Erase Event
@>

That is a large part of the treasure chest minigame.

Creating the Treasure Chest Game NPC

Next, let’s create the NPC. He’s going to get straight to the point and begin with the all-important question: Want to play the Treasure Chest game? The player will get three choices at that time. He/She can answer yes, at which point the NPC will note that it costs 500 Gold to play and ask the player to confirm. We have the usual processing to make sure that the player can’t play if he or she doesn’t have the Gold and have the NPC say good-bye if he/she says no. The second choice is humorously named “Huh?” and prompts the NPC to explain what the game is actually about. The last choice allows the player to say no from the first question and not have to initially say yes. If the player says yes and has the Gold to play, the NPC will deduct 500 Gold from the player, say a little line, and the screen will fade out. After the fade-out, we set the value of ChestsToOpen to 2, set the value of TreasureChestSeed to a random value between 1 and 7, and flip the TreasureChestStart to the on state. One second later, the screen fades back in, and the fun can begin. We add a simple second page to the NPC that gives him a witty one-liner urging the player to “Get to opening!” the chests, as it were, but only when TreasureChestStart is on. A listing of the first page of the NPC event follows.

@>Label: Main
@>Text: -, -, Normal, Bottom
 :    : Want to play the Treasure Chest game?
@>Show Choices: Yes, Huh?, No
: When [Yes]
   @>Text: -, -, Normal, Bottom
   :     : That will be 500 Gold, if you will.$
   @>Show Choices: Yes, No
   : When [Yes]
      @>Conditional Branch: Gold is 500 or more
         @>Change Gold: - 500
         @>Text: -, -, Normal, Bottom
         :     : Let the game begin!
         @>Fadeout Screen
         @>Wait: 60 frame(s)
         @>Control Variables: [0010:ChestsToOpen] = 2
         @>Control Variables: [0009:TreasureChestSeed] = Random No. (1…7)
         @>Control Switches: [0019: TreasureChestStart] = ON
         @>Fadein Screen
         @>
       : Else
         @>Text: -, -, Normal, Bottom
         :     : Come back when you have enough Gold!
         @>
       : Branch End
         @>
   : When [No]
      @>Text: -, -, Normal, Bottom
      :     : See you later, then.
      @>
    : Branch End
   @>
: When [Huh?]
   @>Text: -, -, Normal, Bottom
   :     : Guess I should explain. These seven chests around
   :     : me contain either an item, some Gold, or a single
   :     : gold piece. The catch, of course, is that you may
   :     : only open two of them.
   @>Text: -, -, Normal, Bottom
   :     : Oh, and it costs you 500 Gold to play.
   @>Jump to Label: Main
   @>
: When [No]
    @>Text: -, -, Normal, Bottom
    :     : See you later, then.
   @>
   Branch End
@>

Image Note  It’s as good a time as any to mention that $ causes the game to display the party’s current Gold when used within a text box. We’ve used it several times already for precisely that purpose.

Completing the Treasure Chest Game

Last, but definitely not least, we have the Parallel Process event. We have to make sure that we end the game right when the player has opened the second chest, lest he/she get greedy and open all seven of them. Also, we have to make it so that the player is temporarily removed from the map, so that the chosen chests can reappear for future play-throughs of the minigame. We can do this via the clever use of a switch that I’ll call Intermission. The Parallel Process event is one page long and needs to have a condition of TreasureChestStart is ON (otherwise the player will loop infinitely between the two maps). The Parallel Process event starts with a conditional branch that requires that ChestsToOpen be equal to 0. Then, it checks for Intermission to be off (which it should be). The NPC will say “That’s it!” and the screen will fade out. The player will be transferred to a nearly blank map that contains a small Autorun event that flips on the Intermission switch and sends the player back to the Treasure Chest game map (specifically, one square to the south of the NPC and facing the player).

Back at the game map, the Parallel Process event has a second conditional branch that only triggers when Intermission has been turned on. We take a one-second pause and turn off the TreasureChestStart and Intermission switches, effectively resetting the minigame state so that the player can play again. Here’s the Parallel Process event:

@>Conditional Branch: Variable [0010:ChestsToOpen] == 0
   @>Conditional Branch: Switch [0020:Intermission] == OFF
      @>Text: -, -, Normal, Bottom
      :     : That's it!
      @>Fadeout Screen
      @>Transfer Player:[014:Intermission] (007,006), Up, None
      @>
    : Branch End
   @>
: Branch End
 @>Conditional Branch: Switch [0020:Intermission] == ON
   @>Wait: 60 frame(s)
   @>Control Switches: [0019:TreasureChestStart] = OFF
   @>Control Switches: [0020:Intermission] = OFF
   @>Fadein Screen
   @>
: Branch End

The Autorun event on the intermission map is made up of two little lines:

@>Control Switches: [0020:Intermission] = ON
@>Transfer Player:[013:TreasureChestGame] (008,007), Up, None

Related Exercises

With that done, you have just completed your very own treasure chest game in the vein of some of the Zelda games. Here are some neat exercises for you to try out that are related to this particular minigame.

  1. Using the “Item exists” conditional of an event, make it so that the player can see the item that a particular minigame chest contains.
    • The inspiration for this one comes from Ocarina of Time. In that particular Zelda entry, the player can see the contents of chests in a minigame, by using an item found at the bottom of a well.
    • You could duplicate page 2 of each of your chests for this purpose and have a text box that allows the player to decide whether or not to open the chest, based on what it contains. Just make sure that said page is 3 and not 2; otherwise, it will never trigger. (Never forget that events attempt to execute from right to left; the right-most page will always be executed, if possible).
  2. Make it so that an opened chest remains visible until the minigame ends.
    • It’s as simple as having for each chest one switch (you could name them TreasureChest1, TreasureChest2, and so forth) that is flipped on when its related chest is opened and including another event page that requires that switch to be flipped on and has a graphic of the open treasure chest. Grant bonus points for telling the player that the chest has already been opened, if they examine it.
    • You’ll have to toggle off those switches to reset the minigame conditions. Incidentally, that’s the reason why I don’t use self-switches for the same purpose. A self-switch can only be affected at a local level, which means that if you flip Chest 5’s A switch, for example, you would have to flip it off via Chest 5’s event specifically.
  3. Have items that can only be received once per play-through.
    • Say you wanted to have a rare medallion as one of the seven possible rewards. What you could do is use a switch that flips on when the player finds the item for the first time, then have a conditional branch that changes the item found in a chest in subsequent minigames.
    • It might be tempting to use an Item exists conditional branch here, but that will only work if the rare item in question cannot be obtained elsewhere. Otherwise, weird things will happen. Mainly, the player will not be able to obtain the item if he/she already has it (even if the player has never gotten one from the minigame) and can get it multiple times if it has a sell price (by selling the one he/she has before replaying the minigame).

Other Minigames

The mark of a great minigame is one that makes the player want to play it even more than the actual game. I’m a personal fan of card games and have to admit that the ninth version of Final Fantasy and Xenosaga Episode 1 have card games that hooked me for dozens of hours. That’s not bad for what is supposed to be a diversion from the main plot. Following, I’ll list some other ideas for minigames and offer tips and tricks on how I would start tackling them within RMVXA.

  1. A sequence where the player has limited time to escape a certain area
    • For the sake of having an example, let’s say the player is in a space station that is being overrun by baddies. If the player does not reach the escape pod within 1000 steps, he/she gets a game over.
    • There’s no direct way to determine via eventing when a player has taken a step in RMVXA. The easiest workaround is to use three variables. One variable checks the player’s total steps at the start of the escape minigame. The second saves the player’s current steps every time he/she moves, while the last variable is the difference between the first and second variables. We’ll need a Parallel Process event to cover those interactions.
    • The Parallel Process event would have a conditional branch that requires the difference between the two variables to be 1000 or more. Once that is met, you employ the Game Over command for its sole use.
    • Of course, if the player makes it out in time, all is well.
    • To add to the tension of the situation, you can make it so that certain doors and elevators become inoperable at certain step milestones (such as 700 steps left, 300 steps left, and so on).
  2. A matching-pair memory game involving NPCs or symbols
    • Each pair of identical events should have its own variable. There should also be a variable equal to the number of total pairs at the start of the game.
    • Another variable should be set to 2 and drop each time the player selects a spot. When a member of a pair is spotted, its variable should be increased by 1.
    • When two spots have been uncovered, the counting variable will be at 0. The game should check to see if any pair variables are at 2. If they are, we remove them and award the player a point.
    • We can have another variable for Lives. The player loses a life every time he or she fails to match a pair. If the player is out of lives, the minigame ends prematurely, and we reward him/her based on points received.
    • If a pair has not been matched, we hide the two uncovered spots. If a pair has been matched, we use Erase Event on it.

Adding the Minigame Areas to Our World Map

That just about concludes our chapter, but for one last thing: we haven’t added our new locations to the world map! Take a look at Figure 7-5.

9781484207857_Fig07-05.jpg

Figure 7-5. Another part of our world map that has been populated with locations

The tent is the arena and is located at (13,69). The treasure chest game is located at the small building at (20,64). The bridge directly to the east of the tower is locked until you beat the tower’s boss. You can do that by placing a conditional branch that triggers when the player steps on the bridge and has not beaten the boss yet. Give a short message (I have the game display “A horrible force blocks the way!”), and then have the player take a step back, putting him/her back on the first small continent.

Summary

This chapter covered how to create an arena in which the player can battle predetermined enemies to earn points toward rare and special items. In addition, I covered how to make a treasure chest game in the spirit of some of the Legend of Zelda games. Last, I gave ideas for other possible minigames. In the next chapter, I will be covering optional quests (also called sidequests).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset