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 ]