Skip to content

Writing Your Own Quests

August Miller edited this page Dec 2, 2021 · 40 revisions

Quest Structure

Before creating your own quest, it is paramount that you understand how quests are structured in Project Dork. You must understand Maps, their structure, and how these components communicate to create a quest.

Maps

Maps are the most important concept to grasp before writing a quest in Project Dork. You may think of a Map as a container. Inside this container, we place boxes called Rooms, and inside these boxes, we place Items that we can use to interact with. We then connect these rooms with gates that may be locked and unlocked with various items. These gates are known as Doorways. Remember the three elements of a Project Dork quest: Rooms, Items, and Doorways.

Rooms

Room are the containers that hold objects and are connected by doorways. They are the skeleton of a map and have the following properties:

  • Name

The name of the room. This is how the room will appear in code and gameplay when referenced. This name may also impact the images and/or audio the dork master selects when referring to this room, so be specific in your naming.

  • Description

This is what is displayed when a player chooses to inspect this room, or when a player begins their turn within this room. This is what players will use to place themselves in your world, so be as specific and detailed as possible.

Items

Items are the objects that can be placed in rooms and within a player's inventory. All items contain the following properties

  • Weight

How much the item weighs. This may impact a player's ability to place the item in their inventory.

  • Value

How much the item is worth.

  • Name

The name of the item. This is how the item will appear in code and gameplay when referenced. This name may also impact the images and/or audio the dork master selects when referring to this item, so be specific in your naming.

  • Description

This is what is displayed when a player chooses to inspect this item.

  • Scenery

This is a Boolean value that captures weather or not an item is part of the scenery or not. If this is true, the item will not be appear in the list of items within the room when inspecting a room, and players will not be able to move the item or place it in their inventory. A scenery object is used as a container to add more descriptions to scenes. For example, we may create a scenery item "Scent" to store a description of the room's aroma. Another example could be declaring a scenery item of "Graffiti" to provide a description of some graffiti in our room "Dark Alley".

Doorways

Doorways are the gates that connect rooms. Doorways are one-way in nature, meaning a doorway going from "Room 1" to "Room 2" can move a player from "Room 1" to "Room 2". However, once in "Room 2", we must specify another doorway to move players from "Room 2" to "Room 1". It is left to the writer of a quest file to create this geometry in any way they see fit. Doorways have the following properties

  • Locked

A Boolean value specifying if this doorway is locked or unlocked. A locked cannot be used by a player, and must be unlocked via the doorway's key before it may be used.

  • Key

An keyItem that may be used to unlock this doorway once in the same room.

  • Locked Description

The description that is displayed to the player when this doorway is inspected and locked.

  • Unlocked Description

The description that is displayed to the player when this doorway is inspected and not locked.

Characters

Characters consist of things that may take turns. There are players, enemies, and merchants. Enemies and Merchants are special characters called NPC's.

Turn Manager

The Quester Language

"Quester Language" (QL) will feel very similar to users with experience in other programming languages. There are minor syntactical differences and features. The true complexity of a Project Dork quest must come from the creativity of the writer, as QL only requires a few basic commands. The syntax is easy to learn, and once mastered, can be used to create infinitely many quests. Your imagination is the only limit.

All QL commands may be classified into two categories: Creators and Modifiers.

Creators

A Creator is a QL command that creates one of the key map elements: a room, item, or doorway. These elements must be created before being modified by modifiers. Attempting to modify an element that does not yet exist will result in a compilation error from the dork master.

create room <roomName>

Creates a new room with the provided name.

create item <itemName>

Creates a standard item with the provided name.

create healthItem <itemName>

Creates a new item of the healthItem variety with the provided name.

create key <keyName>

Creates a new item of the key variety with the provided name.

create trap <trapName>

Creates a new item of the trap variety with the provided name.

create doorway <doorwayName>

Creates a new doorway with the provided name.

create merchant <merchantName>

Creates a new merchant with the provided name.

Modifiers

A Modifier is a QL command that modifies a previously created element. Rooms, items, and doorways all have specific properties that may be set through these modifiers. Please note that a QL element MUST be created before a modification is attempted.

Room Modifiers

  • set start room to <roomName>

Sets the room of the map in which all players begin. Example: set start room to room1

  • set end room to <roomName>

Sets the room of the map in which all players must reach to win. Example: set end room to room2

  • set <fromRoom> direction <direction> to <toRoom> via <doorwayName>

This connects a doorway from the "fromRoom" to the "toRoom" in the direction specified. Example: set Room1 direction north to room2 via north passage

  • add <itemName> to <roomName>

Adds the specified item to the room specified. Example: add sword to dungeon

Item Modifiers

Item modifiers pertain to all items, including Health Items and Keys. They can be referenced as item or by their more specific type.

  • set <itemName> scenery to <boolean>

Sets the scenery flag of the item with the provided name. Example: set old tree scenery to true

  • set item <itemName> description to "<itemDescription>"

Sets the description of the item with the provided name. Example: set item old tree description to "A timeworn birch tree."

  • set item <itemName> weight to <0.0>

Sets the weight of the item with the provided name. Example: set item heavy sword weight to 50.0

  • set item <itemName> value to <0.0>

Sets the value of the item with the provided name. Example: set item gold coin value to 1.0

Usable Item Modifier

  • set item <itemName> uses to <0>

Sets the number of uses for this item before it is destroyed. Example: set item health potion uses to 10

Health Item Modifiers

Health item modifiers pertain to all health items. In addition, any item modifier, and any usable item modifier may also be used in a health item. *`set healthItem health to <0.0>

Sets the value of the health granted/cost to a player who uses this health item.

Trap Modifiers

Trap modifiers pertain to all traps. In addition, any item modifier, and any usable item modifier may also be used in a trap.

  • set trap <trapName> chance to <0.0>

Sets the value of the traps chance of deploying to the provided percent as a double. Example: set trap poison darts chance to 10.0

  • set trap <trapName> damage to <0.0>

Sets the value of the traps damage when deploying to the provided double. Example: set trap poison darts damage to 100.0

  • set trap <trapName> message to "<Message>"

Sets the value of the traps message when deployed to Example: set trap poison darts message to "Poison darts shoot from the wall"

  • add item <itemName> to disarm <trap>

Adds the item with itemName to the list of items that can disarm trap. Example: add item honey to disarm bear

Key Modifiers

Key Item modifier pertain to all key items. In addition, any item modifier, and any usable item modifier may be used on a key.

Doorway Modifiers

  • set <doorwayName> locked to <boolean>

Sets the locked flag of this doorway. Example: set castle entrance locked to true

  • set <doorwayName> locked description to "<description>"

Sets the description of this doorway when it is locked. Example: set castle entrance locked description to "A castle guard blocks the way in"

  • set <doorwayName> unlocked description to "<description>"

Sets the description of this doorway when it is unlocked. Example: set castle entrance unlocked description to "No castle guard currently blocks the door"

  • set <doorwayName> key to <keyName>

Sets the key for this doorway. Example: set castle entrance key to The King's Letter

  • set <doorwayName> trap to <trap>

Adds the provided trap to this doorway. The trap will be triggered when the doorway is used. Example: set dark hallway trap to poison darts

Character Modifiers

  • add character <characterName> to room <roomName>

Places the character with the given name in the room with the given name. Example: add character butcher to room Market

  • set character <characterName> gold to <0.0>

Sets the gold a character has to the provided double Example: set character butcher gold to 100.0

  • give item <itemName> to character <characterName>

Places the provided item into the character's inventory. Example: give item butcher's knife to character butcher

Merchant Modifiers

Merchants have all the functionality of characters, in addition to the following:

A Few Helpful Notes

Merge Lines

If you find yourself needing more space on line, you may use {} to "merge" lines. Let me give you an example. Say, I would like to create a new sword for my players. That is create item sword. Now, I want to provide a very elaborate description of the sword. Instead of needing to place that on one line, we may use the {} notation:

set item sword description to{
"A wonderfully crafted sword by an expert blacksmith.
It is perfectly balanced where the blade meets the hilt. Peering closer
passed the ornately decorated hilt, you notice a small inscription. It reads
"John""}

The above example is a valid QL Modifier. Note that every new-line will insert a space into the command. So, the Dork Master will read

create{
item
sword}

as create item sword. This is important to remember when providing descriptions to avoid unwanted spaces.

Comments

If you need to insert comments into your quest, you may do so using the // or /* */ notation. The first is for a single-line comment, and the other is for multi-line commenting. Comments may NOT appear between {}.

Meta-tags (#)

If the Bot is displaying images that don't match the theme of your quest, you can further alter the images the Bot pulls by providing meta tags related to your theme. For example, if I designed a quest that takes place in a dungeon, I may provide the tag #dungeon anywhere in the quest file.

An Example

#forest
#medieval
#country
create room scary forest
set room scary forest description to {
"An old forest adjacent to your village. It is full
of many old and tall trees. There are so many that it
casts an eerie shadow even in the middle of the day.
You are standing next to the tallest tree in the forest."
}
create room safe village
create room top of tree
set room top of tree description to {
"You are at the top of the tallest tree in the forest.
Your village lies to the north, and you can see the old bear
in the path that way. There are a few bees buzzing around a bee's nest."
}

set start room to scary forest
set end room to safe village

create doorway climb tree
create doorway descend tree
set scary forest direction up to top of tree via climb tree
set top of tree direction down to scary forest via descend tree
set climb tree locked to false
set descend tree locked to false


set climb tree unlocked description to{
"a lot of sturdy branches. You think you could climb it".}
set descend tree unlocked description to{
"a few footholds. You think you could climb back down".}



create doorway grizzly bear
set grizzly bear unlocked description to{
"that the old bear fell asleep".}
set grizzly bear locked description to{
"an old pacing bear. You wouldn't dare approach it without some honey."}
set grizzly bear locked to true

set scary forest direction north to safe village via grizzly bear

create item bee's nest
create key honey

set grizzly bear key to honey

create item tree

add tree to scary forest
set tree scenery to true
set item tree description to {
"It is a tall and sturdy tree.
There are a lot of solid branches."
}
set bee's nest scenery to true
add bee's nest to top of tree
add honey to top of tree




set item honey description to {
"A glob of honey. If you're quick, you think you can take it."
}
set item honey weight to 1.0

set item bee's nest description to {
"A buzzing bee's nest. There is some honey dripping out from it."
}