Vǫrðr Forge Steam page

Characters and Gameplay

Quests

A quest is one quest row in assets/data/quests.vfa, and its whole life runs on flags: the same flags any script sets. So quests save, load and chain with nothing extra to wire.

comp quest gather_wood -1 -
field name A Fire For The Hearth
field start met_the_elder
field stage wood_collected Gather firewood from the south field
field stage fire_lit Light the hearth in the elder's hall
field reward gold 50
quest <id>
The row: a one-word id.
name
The name the player sees.
start <flag>
The quest enters the journal when this flag is set. Without it, the quest is there from the start.
needs <reading>
The quest is active only while this holds, e.g. standing(marsh) >= 20.
stage <flag> <text>
One objective, unticked until its flag is set. Up to eight per quest.
count <stage flag> <n> <kill|buy|sell|interact|take|store> [detail]
n matching events set that stage's flag.
reward <verb...>
One Run verb call, run once when the quest completes. Up to sixteen.
desc <text>
What the journal says about the quest.
fail <flag>
The quest fails when this flag is set while it runs.

An id, a stage flag or the enemy a count names may be longer than 31 letters, in the file, the Quest Book, the questdef and quest verbs and a kill count. The book tells ids and flags apart by their first 31 letters, so two that differ only after the 31st are one.

A quest is complete when every stage's flag is set, or when its own q_<id>_done flag is set (a quest with no stages completes only that way). Either way its rewards run once, and its Completed: line shows at the foot of the screen. A quest that fails pays nothing.

The Completed: line never covers a reward's own say words: when words are up it stands just above them. Quest completed notice under NOTICES on the Quest Book page picks Show (the default), Off, or Top of screen, where it stands at the top of the view while the words stay at the foot.

Setting flags

Scripts set flags with flag set <name>: in a conversation's event, a zone, a chest, a boss's death. One event sets a flag; the next requires it:

require flag wood_collected : not_yet
say The fire catches. Warmth returns to the hall.
flag set fire_lit

Every villager who dies sets killed_<name> on their own.

The journal in play

Press J or L and the Quests screen opens. On the left are the quests under Active, Completed and Failed, each heading folding; Completed and Failed show only when they hold something. Click an active quest to track it, and a mark sits beside it. The middle shows the chosen quest's steps: the done ones ticked, the one in hand bright, and a counting step with its tally, such as (3/10). On the right are its description, then the player's reputation and their deeds. A deed of felling an enemy names it as players read it: the Display name of the character type it wears, when it has one, else its name with underscores read as spaces, as in Felled a Blue Pill.

The Quests screen: the tracked quest, its steps, and the deeds on the right.
The Quests screen: the tracked quest, its steps, and the deeds on the right.

The tracked quest is the one the player clicked, else the first active one, and the save remembers it. The Quests screen is one of the game screens, so Q and E flip to the others.

To keep the journal on the play screen itself, add the Quest Journal widget in the UI Editor. It lists the active quests, can show the completed and failed ones too, and opens the tracked quest.

From a script: quest <id> <stage> finishes a stage, named by its flag or by its number counting from 1, the same as setting its flag. A stage named by its flag stays the same stage when the steps are moved.

Your first quest

The Quest Book page of Edit > Project Settings shows every quest as a row, edited where it stands, with flags, enemies and items picked from lists. Each change is written to quests.vfa at once. Its WORDS rows rename Quests and Journal wherever the player reads them.

  1. Open Edit > Project Settings... and choose Quest Book under QUESTS.
  2. Press Add under the table, type the quest's name and press Enter. Its id is the name in lower case with underscores, and it starts with no steps.
  3. Click the quest's row. Under it are its Description and Needs (a reading picked in parts: what is read, of what, how it compares, and the number), its Steps and its Rewards.
  4. Press Add under Steps and type what the player is asked to do; Enter makes the step with a flag of its own. Click a step's words to change them. Its Flag is picked from the flags the project names, or New... to type one. To make a step count something, give it Counts, then pick the Event (kill, buy, sell or interact) and what it is Of.
  5. Add under Rewards adds gold 10. Click its verb to pick another from Run's verbs; each word after it is picked from what the project has, or typed when it is a number or a sentence. A quest reward picks the step by its words and writes its flag. renown gives {renown}: renown 10 (a negative amount takes, never below 0). run runs an event you name, so a reward can be anything an event can do: run elder_thanks.
  6. Starts when and Fails when on the quest's row pick a flag; From the start and Never are no flag.

The file also takes take and store as a counting step's event (a container's Take and Store), which the page's Event list does not offer yet.

Up and Down move the picked quest, step or reward; Delete asks first, and a step's counter goes with it. A quest, or a step, that something in the project names cannot be deleted: the page says how many places use it. A step named by its number somewhere does not move until that place names it by its flag. Renaming a quest's id renames it in every script, dialogue and table that names it, and its q_<id>_done flag with it.

A stage ticks when its flag is set, so something in your game has to set each one: a reply's Does on the Dialog page (flag set came_back), a zone's event, or a count row. Until every stage's flag is set, the quest stays active.