Creating Locks

One of the perks of having your own dream is being able to create a private area for yourself and your chosen guests. Most often, this is created through a lock which blocks unwanted furres from entering into an area. There are many different ways to do locks. So many, in fact, that it wouldn't be practical to show them all here. For the purposes of this tutorial, we'll give you two examples that use switches. Switches are probably the most common form of locks in most dreams.

Here is the picture of the dream that we will be referring to for this Tutorial. This dream can be downloaded at the bottom of this page.

The picture above shows two doorways that we will block through the use of DragonSpeak. Each doorway will be able to be locked by bumping into the switch that is next to it. A green switch (Object 161) means that the doorway is unlocked, while a red switch (Object 162) means that the doorway is locked. Also shown is a picture of the different objects that we are using in this dream and their corresponding object numbers.

Before we work on any DragonSpeak, let's first think about what we're going to be doing. We're going to have two locks that are both operated by bumping into a switch. That means that we'll have a similar event that occurs with each lock: the swapping of one switch to the other when you bump into it. This allows us combine this "toggling" of the switches into a single block of DragonSpeak code that we can use for many different types of switch locks. Let's proceed with the DragonSpeak.


Step One: To "toggle" the switch, we simply need to check to see when a furre walks into one of the two objects, and when they do, switch the object to the opposite one. The DragonSpeak to do this is shown below. If you're confused about the idea of toggling, you can read the tutorial on it by clicking on the link here.

(0:3) When somebody moves into object type 161,
(3:6) where the triggering furre moved into,
(5:4) place object type 162.
(0:3) When somebody moves into object type 162,
(3:6) where the triggering furre moved into,
(5:4) place object type 161.

As you can see, with just these six lines of code, we're able to make it so no matter where you are in the dream, and no matter which of these two switches (161 or 162) that you bump into, you'll be able to switch it over to the opposite switch. If you have a lot of switches in your dream, this will save you a lot of code. Imagine having to do a block of DragonSpeak for each individual lock! It'd take forever, and it would eat up a lot of your valuable DragonSpeak lines. This code block will go below all of the DragonSpeak code that we write for the locks. I'll explain that later, but first, let's write the code for the locks.


Step Two: Let's start with the gray pillar lock. All this lock will do is change what the object is in front of the doorway. The object will toggle through the raised gray pillar and the sunken gray pillar. When you bump into the green switch that is by this doorway it means that you're going to turn the switch from green to red, which means that you want to lock the doorway (raise the pillar). When you bump into the red switch that is by this doorway it means that you're going to turn the switch from red to green, which means that you want to unlock the doorway (lower the pillar). You're not going to worry about actually changing the switch at all, because we already wrote the DragonSpeak for that. Below is the DragonSpeak for the gray pillar lock.

(0:7) When somebody moves into position (10,16),
(1:1013) and position (10,16) is object type 162,
(3:2) at position (12,15) on the map,
(5:4) place object type 394.
(0:7) When somebody moves into position (10,16),
(1:1013) and position (10,16) is object type 161,
(3:2) at position (12,15) on the map,
(5:4) place object type 393.

The statue lock uses the same logic for figuring out whether you're unlocking the doorway or locking it. The only thing that is different is what you're doing with the "lock" itself - in this case, the statue. For this lock, we're just going to move the statue object back and forth. Below is the DragonSpeak for the statue lock. Nnotice how we're not changing the the switch objects around here, either.

(0:7) When somebody moves into position (14,12),
(1:1013) and position (14,12) is object type 162,
(3:2) at position (14,13) on the map,
(5:4) place object type 0.
(3:2) at position (12,14) on the map,
(5:4) place object type 44.
(0:7) When somebody moves into position (14,12),
(1:1013) and position (14,12) is object type 161,
(3:2) at position (14,13) on the map,
(5:4) place object type 44.
(3:2) at position (12,14) on the map,
(5:4) place object type 0.

Step Three: Now we have the three pieces of code that we need for our dream: the gray pillar lock, the statue lock, and the code that toggles the switches on/off. The DragonSpeak for the two locks needs to go above the DragonSpeak that toggles the switches, otherwise the doorways will be unlocked when the switch is red and will be locked when the switch is green. Of course, this is a personal preference as to which way you want it to go. I generally associate green with "go", so you don't "go" through locked doors. The entire code is shown below.

* Lock - Gray Pillar
(0:7) When somebody moves into position (10,16),
(1:1013) and position (10,16) is object type 162,
(3:2) at position (12,15) on the map,
(5:4) place object type 394.
(0:7) When somebody moves into position (10,16),
(1:1013) and position (10,16) is object type 161,
(3:2) at position (12,15) on the map,
(5:4) place object type 393.
 
* Lock - Statue
(0:7) When somebody moves into position (14,12),
(1:1013) and position (14,12) is object type 162,
(3:2) at position (14,13) on the map,
(5:4) place object type 0.
(3:2) at position (12,14) on the map,
(5:4) place object type 44.
(0:7) When somebody moves into position (14,12),
(1:1013) and position (14,12) is object type 161,
(3:2) at position (14,13) on the map,
(5:4) place object type 44.
(3:2) at position (12,14) on the map,
(5:4) place object type 0.
 
* Toggles objects red and green switch when you bump into them.
(0:3) When somebody moves into object type 161,
(3:6) where the triggering furre moved into,
(5:4) place object type 162.
(0:3) When somebody moves into object type 162,
(3:6) where the triggering furre moved into,
(5:4) place object type 161.

I hope that wasn't too confusing. As was stated previously, locks are used a lot in dreams, so it's a good thing to know if you desire privacy. Even if you don't use locks, the DragonSpeak ideas that were shown here can be used toward other things. Locks provide a good way of demonstrating those ideas. You can download a copy of this dream from the link below. If that doesn't help, you can always e-mail us at the e-mail address at the bottom of this page. Good luck!

TutorialLocks.zip

Contact Us

Do you have a question that you couldn't find the answer to? Is there a tutorial that you'd like to see added to the MKb? If so, drop us an e-mail. The MKb is created for the Furcadian public, so in order to be effective, we need to know what information you want it to contain. If e-mail links don't work for you, just send us an e-mail at masons@furcadia.com. We look forward to hearing from you.


[ Back to DragonSpeak Tutorials ]

This page, subsequent pages and all content therein, unless otherwise stated is copyright © Dragon's Eye Productions. Site maintained by The Beekin Scribes.