11 March 2010

Chapter 4b: Combination Locks (Advanced) - The Complete Chest Tutorial

Following on from Part 4a, which created a single combination, this tutorial will prevent you from opening the chest unless you know the complete combination beforehand.

For the purposes of this tutorial, we'll create 4 additional events (Bush #1, Bush #2, Bush #3 and Bush #4) that can be searched for each part of the combination. These are dotted around the map so that when "searched", one part of the combination will show up.

We'll also need to create 4 variables (Num 1, Num 2, Num 3 and Num 4) to "store" the individual combination numbers, but this is primarily to avoid using switches when the number is obtained.

The combination for this tutorial will be 4321, with each part stored in the variable "Num Digits". If you attempt to open the chest without first knowing the entire combination of four numbers, you won't be able to open it.

Starting with the Bush #1 event, in the Event Commands, we're going to create a Conditional Branch to determine if the bush has already been searched. If so, display a message with the first number in the combination sequence; if not, set the first number (in this case set to 4) and add one to the number of digits. The complete code will look like this:
<>Branch if Var [0003:Num 1] is 0 Greater
  <>Message: The first number is: \V[3].
  <>
: Else Handler
  <>Variable Oper: [0003:Num 1] Set, 4
  <>Variable Oper: [0007:Num Digits] + , 1
  <>Message: The first number is: \V[3].
  <>
: End

Repeat that with Bush #2, changing "Num 1" to "Num 2", "\V[3]" to "\V[4]" and under the Else Handler change the "4" to a "3", thus:
<>Branch if Var [0004:Num 2] is 0 Greater
  <>Message: The first number is: \V[4].
  <>
: Else Handler
  <>Variable Oper: [0004:Num 2] Set, 3
  <>Variable Oper: [0007:Num Digits] + , 1
  <>Message: The first number is: \V[4].
  <>
: End

Repeat the process for Bush #3 and Bush #4, increasing the values accordingly.

After that, we need to create the chest. For this, we'll check to see if all the numbers needed for the combination lock are known. If not, a message will be displayed telling you that you don't know the full code. If so, check for the correct combination (in this case, 4321) and open the chest upon the correct combination being entered.

We'll be drawing on the previous tutorials - Part 1 (Basic Chests), Part 4a (Combination Locks) and Part 3 (Random Contents) to create the chest.

The complete routine will look like this:
<>Branch if Var [0007:Num Digits] is 4
  <>Input Number: 4 Digit, [0002:Combo]
  <>Branch if Var [0002:Combo] is 4321
    <>Play Sound: open1
    <>Move Event: This Event, Face Right
    <>Wait: 0.2 Sec
    <>Move Event: This Event, Face Up
    <>Wait: 0.2 Sec
    <>Move Event: This Event, Face Left
    <>Wait: 0.2 Sec
    <>Call Event: Random Contents
    <>Switch Operation: [0004:Chest 4b Opened] ON
    <>
  : Else Handler
    <>Message: The combination is incorrect.
    <>
  : End
  <>
: Else Handler
  <>Message: You don't have all the numbers yet.
  <>
: End

Chapter 4a: Combination Locks (Basic) - The Complete Chest Tutorial

Combination locks can be placed on some chests, which will only be opened if the correct combination is entered, otherwise will remain closed. In this two part tutorial, I'll demonstrate how this can be achieved.

The first, which sets up a basic 4-digit combination lock, we need to create another chest event, "Chest 4a". On Page 2, set the Preconditions Switch to "Chest 4a Opened".

On Page 1, we'll set up a variable and input option for the combination (in this case 1234), stored in "Combo", determine if the correct combination has been entered and, if so, provide random contents (detailed in Part 3). If not, the chest remains closed.

The complete code on Page 1 will look like this:
<>Input Number: 4 Digit, [0002:Combo]
<>Branch if Var [0002:Combo] is 1234
  <>Play Sound: open1
  <>Move Event: This Event, Face Right
  <>Wait: 0.2 Sec
  <>Move Event: This Event, Face Up
  <>Wait: 0.2 Sec
  <>Move Event: This Event, Face Left
  <>Wait: 0.2 Sec
  <>Call Event: Random Contents
  <>Switch Operation: [0001: Chest 4a Opened] ON
  <>
: Else Handler
  <>Message: The combination is incorrect.
  <>
: End

When you playtest the game, if you try and open the chest with any other combination than 1234, the combination will be incorrect. Trying 1234 will open the chest and give random items (from Part 3).
09 March 2010

Chapter 3: Random Contents - The Complete Chests Tutorial

Wouldn't it be better if the contents of chests were randomized, rather than fixed? This adds an element of surprise to the game, a sense of the unexpected.

To set up randomized items, we'll be using a Common Event, which can then be called from within the chest events.

So, let's create the Common Event (in the Database) first of all. Create a new Common Event, called "Random Contents", with the Trigger set to "Call" (the default).

In the Event Commands, we'll be generating a random number between 1 and 3, which will then correspond to the item given. To do this, we need to set up a variable (Randomizer or similar) and some Conditional Branches, each pointing to the random number generated.

For this tutorial, the goodies I've chosen are 5 Potions, 100 GP and 5 Antidotes.

This is how the finished code looks:
<>Variable Oper: [0001:Randomizer] Set, Rnd[1-3]
<>Branch if Var [0001:Randomizer] is 1
<>Message: 5 Potions found!
<>Change Items: Potion 5 Add
<>
: End
<>Branch if Var [0001:Randomizer] is 2
<>Message: 100 GP found!
<>Change Money: 100 Add
<>
: End
<>Branch if Var [0001:Randomizer] is 3
<>Message: 5 Antidotes found!
<>Change Items: Antidote 5 Add
<>
: End

To add more items, increase the end range of the variable Randomizer and add another corresponding Conditional Branch.

Using the map from the previous tutorials, create another chest on the map, named "Chest 3". You can copy the locked chest and paste it onto the map, deleting the Event Commands in Page 1, except "Play Sound" through to the third "Wait" command.

At the end, add the Call Event command to call the "Random Contents" Common Event we just created. Then turn the switch "Chest 3 Opened" to ON and change the Preconditions switch to "Chest 3 Opened" as well.

The completed code will look like this:

<>Play Sound: open1
<>Move Event: This Event, Face Right
<>Wait: 0.2 Sec
<>Move Event: This Event, Face Up
<>Wait: 0.2 Sec
<>Move Event: This Event, Face Left
<>Wait: 0.2 Sec
<>Call Event: Random Contents
<>Switch Operation: [0001: Chest 3 Opened] ON

With every chest you want random content, simply call the "Random Contents" event and turn turn on the corresponding switch in a similar fashion.
08 March 2010

Chapter 2: Locked Chests - The Complete Chests Tutorial

As a continuation of the Chest Tutorials - Part 1: Basic Chests, this tutorial details how to create a chest requiring a key to open.

First of all, we'll need to create the key to open the chests. In the "Item" tab of the Database, create the key as a "Common Item" type and description.

Now, let's lock "Chest 1" (from Part 1) by modifying the Event Commands slightly. Before adding any commands, press CTRL A (to select all) and CTRL X (to cut it).

Add a Conditional Branch (Tab 3), set to "Item" (second tab), "Party Possesses" and "Key", with the "Execute Custom Handler" option checked.

Under the Branch, paste (CTRL V) the previous commands. Then under the "Else Handler", create a message stating the chest is locked.

The complete script in Page 1 should look like this:
<>Branch if Key Possessed
<>Play Sound: open1
<>Move Event: This Event, Face Right
<>Wait: 0.2 Sec
<>Move Event: This Event, Face Up
<>Wait: 0.2 Sec
<>Move Event: This Event, Face Left
<>Wait: 0.2 Sec
<>Message: 5 Potions received!
<>Change Items: Potion 5 Add
<>Switch Operation: [0001: Chest 2 Opened] ON
<>
: Else Handler
<>Message: It's locked! You need a key to open it!
<>
: End

That's it for the chest. When you playtest now, you won't be able to open the chest without the key and you'll get the "It's locked!" message.

To obtain the key, we're going to set up another event, an NPC, who will give the key only once.

In the Event Commands of the NPC event, place the following:
<>Branch if Key Possessed
<>Message: Did you open the chest yet?
<>
: Else Handler
<>Message: Here's the key to that chest.
: Keep whatever you find inside.
<>Change Items: Key 1 Add
<>
: End

What this does is check first to see if the NPC has already given the key. If not, add the Key to the inventory; if so, don't give another key but display a message instead. And now the chest can be opened to obtain the Potions.

We can now move onto Chapter 3: Random Contents.
07 March 2010

Chapter 1: Basic Chests - The Complete Chests Tutorial

One of the commonest questions I'm asked is about creating chests in RM2K3. There is no "perfect" method, although there is one that I found works adequately. As part of a multi-part tutorial, these methods will also work with all RMXP and RMVX events (with a little adaptation).

The first thing to do is to create a chest event on the map. Give it a name, say "Chest 1". This will have 2 pages, the first to obtain the contents and the second to make sure the chest is empty afterwards.

Page 1

This is the first time the chest is opened, where the contents of the chest are obtained.

Set the "Event Graphic" to a closed chest (there are 2 RTP in "object1"), making sure that Movement Type is set to "Stationary", Trigger Condition is "Action Key" and Event Layer is "Same Layer As Hero".

In the Event Commands, place the following:

<>Play Sound: open1
<>Face Event: This Event, Face Right
<>Wait: 0.2 Sec
<>Face Event: This Event, Face Up
<>Wait: 0.2 Sec
<>Face Event: This Event, Face Left
<>Wait: 0.2 Sec

What this does is "animate" the chest opening. Many online chest tutorials place the "animation" movement in a single "Move Event" sequence, which, in my opinion, is ineffectual. Having individual commands like this provides a much more effective method of animation.

Next, we need to fill the chest with goodies! So, after the above sequence, for this tutorial we'll gift the player 5 Potions, thus:

<>Message: 5 Potions received!
<>Change Items: Potion 5 Add
<>Switch Operation: [0001: Chest 1 Opened] ON

The final Switch command is to make sure that the chest is empty after the potions are grabbed.

Page 2

This is to make sure the chest is (and remains) empty after its contents have been obtained.

In "Preconditions", make sure the "Chest 1 Opened" switch is ON.

Then set the "Event Graphic" to wide open (Facing is "Left"). Animation Type must be set to "Fixed Graphic".

And finally, in the Event Commands, place a message stating the chest is empty, thus:

<>Message: The chest is empty.


Now, when you playtest it, the chest will slowly open, you will obtain its contents, and it will remain open but empty.

We can now move onto Chapter 2: Locked Chests.
06 March 2010

The Complete Chest Tutorial

The Complete Chests Tutorial for RM2K3 is now complete. The demo is now available (see right-hand side menu).

The different chapters in this tutorial are:



I may add additional chapters as the need arises (through inspiration or suggestions), but for now that's it. As each chapter is finished, I'll add the link here.

Note: The original Chapter 8, Items by Location (Map ID) has been temporarily deleted and will be added at a later time.
05 March 2010

No Updates, Next Updates

There weren't any updates last month - and only four in January! I've been so busy working and playing several newer MMORPGs, including Grand Fantasia (which I was beta testing for a while) and GodsWar Online.

I've also been working on a new game, Chronicles of Yrd, which is more of an experiment than anything else and a test of my eventing and scripting knowledge. I'm trying to make an RMXP version and an RMVX version, both of which follow the same basic plot but they are different.

The next major update to RPG Maker Times is going to be the comprehensive "Chest Tutorial", which will include a demo, that I mentioned a few entries ago. It's currently at 85%, but as it nears completion I'll announce it here but will place it on the RPG Maker 2K3 Master blog in its entirety, with reference links here.

Further updates will include more RMVX Windowskins, which I'm attempting on creating from scratch, as well as some more RMXP ones too. And talking of graphics, one of the recurring questions that I've been asked lately is about graphics, so I'll attempt on implementing more comprehensive tutorials on graphics for all RPG Makers. This includes everything from character sheets to tilesets.

Of course, all of this depends on whether I can find the time to squeeze these things in. As the saying goes, "There just aren't enough hours in the day!"
24 January 2010

More Windowskins VX #4

I know previously I mentioned that the next windowskin update would be for RMXP, but popularity trends dictate otherwise. So, here are some more RMVX windowskins that I've created. As usual, I've used the Windowskin Generator, but have imported my own resources into the program, rather than relying on the default ones.

Also as usual, these will be placed on the sister blog, RPG Maker Times Companion, where you can view examples of these (and all the other) RMVX and RMXP windowskins. Right-click and save the image to your hard drive.

Blue Bubble
RMVX Windowskin - Blue Bubble
Blue Cross
RMVX Windowskin - Blue Cross
Darkwood
RMVX Windowskin - Darkwood
Leathery Gold #1
RMVX Windowskin - Leathery Gold 1
Leathery Gold #2
RMVX Windowskin - Leathery Gold 2
Parchment #4
RMVX Windowskin - Parchment 4
Red Bubble
RMVX Windowskin - Red Bubble
Stone Slab
RMVX Windowskin - Stone Slab
 

Since I now have quite a collection of RMVX Windowskins, as well as a few scriptlets, I will be creating a separate website soon to house them all. Each windowskin there will include visuals of what the Status Menu, Status and Equipment screens look like with a particular windowskihn. Then, in the future, all windowskins from the blogs will be cross-linked there instead.

The website itself will be specifically tailored for RMVX (but may also include RMXP and RM2K3 later, as trends dictate). And this will make it much easier to properly categorize the windowskins, scripts and other resources in one convenient place.
20 January 2010

Betrayal At Krondor Wordlock Script

Wulf's ChoiceFor those who have played Betrayal At Krondor will know precisely what a "Wordlock" is. For those that don't, it's basically a chest (or door) locked by a riddle and they will only open once the correct word has been entered.

Once upon a time, I tried recreating the wordlocks in RM2K3, but encountered a few difficulties given its limitations. Everything had to be set up using Events and Common Events, including creating a customized menu specifically for entering the words. It was a nightmare.

However, now one exists for RMVX, thanks to the awesome talent of Modern Algebra. I've tried this script and, trust me, it is good - just like revisiting Betrayal of Krondor.

The script and demo can be viewed and downloaded here.
12 January 2010

News & Updates

I realised today there haven't been any updates for a while, primarily because I've been busy with other things. However, I haven't been idle on the RPG Maker scene.

Snow Fun For Some

Right now though, the UK snow is the major talking point here at the moment, including being the longest persistent cold snap for 30 years! The family "in joke" at the moment is that I brought the snow with me from Canada, since British Columbia has hardly had any - at least not their "usual" amount - and when I go back there things will return to "normal". With several feet already fallen, and more on its way, people here are ill-equipped to deal with it. Schools have closed, 40% of the workforce have been unable to drive into work, and some of the more isolated areas are still closed off. It's certainly a winter they will remember for a while!

The Gladiator Project - Graphics Wanted

I've had to put TPG on hold for awhile because of a lack of graphics. I'm not good with graphics at all, so if anyone is willing (and able) to create tilesets, character sets, and other types of graphics for the game, it'd be more than greatly appreciated. Contact me here (in comments) or at Twitter. I will give full credit, of course!

Comprehensive Chest Tutorials (RM2K3)

One of the side-projects I have been working on is a huge multi-part RM2K3 "how to" tutorial for chests, which can also be used in RMXP and RMVX, since they use events. Here is a breakdown of the different parts of the tutorial:

  • Part 1: Basic Chests
  • Part 2: Locked Chests
  • Part 3: Random Contents
  • Part 4a: Combination Locks (Basic)
  • Part 4b: Combination Locks (Advanced)
  • Part 5: Trapped Chests
  • Part 6: Picking Locks
  • Part 7: Monster-In-A-Box
  • Part 8: Items by Location (Map ID)
  • Part 9: Items by Level (Hero Level)

There will be a demo that goes along with this tutorial as well.
Related Posts with Thumbnails
Template Design "Perfect World" by SkinCorner