DragonSpeak Theory

II: THE BASICS OF COMBINING DRAGONSPEAK LINES

Before reading this page, it is assumed that you know and have read what makes up a line of DragonSpeak and how DragonSpeak information is stored in a dream. This page delves deeper into how you can combine different lines of DragonSpeak together to form a block of DragonSpeak code.


Table Of Contents
A. DragonSpeak Logic
B. DragonSpeak Organization
C. Closing Comments

A. Dragonspeak Logic

DragonSpeak is created by combining up to five different elements: Causes, Conditions, Areas, Filters and Effects. You can combine these five different elements together to form chunks of code that can be used to add magic to your dreams. A simple DragonSpeak code translates in common terms like this:

"If this happens, do this."

A slightly more complex code is:

"If this happens, and this condition is true, then do this."

Whereas the most complex codes would be something like:

"If this happens, and this condition is true, then in this area, but only where this other condition is true, do this."

A single DragonSpeak code could have a number of Conditions, Areas, Filters and Effects that are triggered off of a single Cause. For instance, you could make it so if you stepped on a red pillow, it would change all blue pillows to purple pillows and all white pillows to black pillows.

Below is an example of a simple DragonSpeak code that you're probably familiar with:

(0:9) When a furre arrives in the dream,
(5:15) move the triggering furre to (10,10), or to someplace nearby if it's occupied.

Here we have an easy combination of a single Cause combined with a single Effect. This code moves any furre who enters the dream to position (10,10). This appears automatically at the top of all beginning DragonSpeak files. A complex DragonSpeak code may look like:

(0:7) When somebody moves into position (100,100),
(1:1002) and they are holding item 421 in their paws,
(3:4) within the rectangle (32,32) - (40,40),
(4:1) only where the floor is type 10,
(5:4) place object type 5.

This bit of DragonSpeak uses all of the five different scripts that you can add to your code. This code makes it so that whenever you move in to position (100,100), while holding a blue key, you'll place blue pillows down on all that spots that have floor tile number 10 within the rectangle created by (32,32) and (40,40).

For the purposes of this page, I'm going to leave the examples at that for now. I don't want to teach you how to do everything that DragonSpeak allows in this page so much as introduce you to how DragonSpeak works as a scripting language. You have now seen two examples of how you can use DragonSpeak in your dreams, so let's now look more closely at combining the different types of lines together.

[ BACK TO THE TOP ]

B. DragonSpeak Organization

As stated earlier, blocks of DragonSpeak code is created by using five different types of DragonSpeak lines. Each type has a different first number in the headers of their lines. For instance, all Cause headers start with a 0, while all Effect headers start with a 5. The numbers also represent the order in which you'll generally place the lines of code. For instance, it wouldn't make sense to place an Effect before you place the Condition that is supposed to be true before the Effect takes place. This order is probably best explained through a demonstration. The following steps below show you the order in which you place the DragonSpeak lines.

1) The Cause
2) All Conditions (Optional)
3) The Area For The First Effect (Optional)
4) Any Filters For This Area (Optional)
5) The First Effect
6) The Area For The Next Effect (Optional)
7) Clear All Previous Filters (Optional)
8) Any Filters For This Area (Optional)
9) The Next Effect

You can repeat steps 6 through 9 as much as you want for as many other Effects as you want to be triggered off the single Cause. This is useful, because there will probably be many times when you want more than one Effect to occur as a result of a single Cause. So let's now explain the steps listed above.

All blocks of DragonSpeak code need to start off with the Cause. Currently you can only have one Cause per block of DragonSpeak code.

Next come the Condition statements. You don't need to have any of these if you don't want to, and you can put in as many as you need. All Condition statements must be placed directly after the Cause, but before any of the other lines.

If you want to supply an Area for the first Effect, then you'd do so now. If you don't supply any Area, then it will generally default to "(3:1) everywhere on the whole map," depending on the type of Effect that is going to be used. Only one Area can be used per Effect. Once an Effect happens, the Area is then discarded, and it won't affect any of the other Effects that may be in this particular block of DragonSpeak code.

The next thing to be placed would be any Filters you want to use for this block of DragonSpeak code. Unlike Areas, Filters remain until the end of the block of DragonSpeak code, so you have to be a bit careful with them. Filters affect the Area that proceeds them (remember that having no Area is the same thing as setting the Area to the entire dream).

It is now time for our first, and possibly only, Effect. If you only have one Effect, it'll be the last line in the block of DragonSpeak code. If you have more than one Effect, then the last Effect will be the last line in the block of DragonSpeak.

From this point, you can set a new Area, add more Filters and add more Effects. Just remember that Filters last until the end of the block of DragonSpeak code, so you should use the "(4:0) clear all filtering," if you want to cancel out any previous Filters that were set.

Below is an example of what a string of DragonSpeak lines may look like:

(0:7) When somebody moves into position (100,100),
(1:1002) and they are holding item 421 in their paws,
(3:4) within the rectangle (32,32) - (40,40),
(4:1) only where the floor is type 180,
(5:4) place object type 1.
(3:4) within the rectangle (32,32) - (40,40),
(4:0) clear all filtering,
(4:1) only where the floor is type 184,
(5:4) place object type 5.

This is sort of like the example we saw above. Whenever you move into position (100,100), and you're holding a blue key, within the diamond (32,32) - (40,40) you'll place red pillows (object #1) on all red tiles (floor #180) and blue pillows (object #5) on all blue tiles (floor #184). Notice the placement of the "clear all filtering" line.

[ BACK TO THE TOP ]

C. Closing Comments

Hopefully you have a stronger grasp of how you need to structure your blocks of DragonSpeak code. It's generally a good idea to know how you need to piece together the DragonSpeak lines before you go about actually doing it. The last thing we'll cover in this guide is how you can combine your knowledge of how the Furcadia interacts with the DragonSpeak with your knowledge on how to put together blocks of DragonSpeak code.

[ PREVIOUS PAGE ] [ DS THEORY INDEX ] [ NEXT PAGE ]

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.


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