How To Create Repeatable Quests in Harlowe

In my game, the player is an apple farmer who delivers apples to people in the town via orders. My issue is I can’t wrap my head around how to make a quest system. I have no idea how to start.

Any suggestions?

So as a general starting point, all your quests will probably use variables of some kind.

You may wish to establish a naming convention such as quests have variables like $q-john for the quest an NPC named John gives out.

I might suggest that quest progress is represented by a number. Quests may have different stages, but something like:

$q-john
= 0 The player has not accepted this quest.
= 1 The player accepted the quest
= 2 The player found the golden apple and needs to return it to John
= 3 The quest was completed.

You may have more stages. Then you’ll probably want a quest log which is a page that checks all the quests and their variables. This is pseudocode but:

<if $q-john eq 1>You need to find a golden apple for John.<elseif $q-john eq 2>You found the golden apple! Return it to John!<elseif $q-john eq 3>You completed John's quest to bring him a golden apple.<endif>

You increment the number at each phase. If John explains his tale of woe about needing an apple, and $q-john is 0, you increment $q-john to 1 so it will show in the quest log. Similarly, increment the variable at each phase - after finding the apple and then after returning it to the quest giver - so it will update in the log.

1 Like

Thank you so much!
Now, would I somehow put this into code:

Or was this just a guide for what those stages would do?

That was just a guide for planning purposes. I’m not good with the specific flavors of Twine code so it was all just example hopefully to give the concept of a quest log some structure!

I have been writing in AXMA whose code was very influenced by old-school Twine - it’s sort of like Sugarcube a bit. Here is an example of code from Cursed Pickle of Shireton:

Variable setup in Startup passage
#items

<<if !$junk>><<set $junk = 0>><<endif>>

<<if !$metal>><<set $metal = 0>><<endif>>

<<if !$healing>><<set $healing = 0>><<endif>>

<<if !$flowers>><<set $flowers = 0>><<endif>>

<<if !$pollen>><<set $pollen = 0>><<endif>>

<<if $pollen eq 0>><<set $dronekill=0>><<endif>>

<<if !$florabread>><<set $florabread=0>><<endif>>

<<if !$honeybread>><<set $honeybread=0>><<endif>>

<<if !$crabclaws>><<set $crabclaws=0>><<endif>>
Quest Log passage
=== [[*Character|charmenu]] | [[*Inventory]] | Quests | [[*Healing]] ===

<<if $bakerparty eq true>>

* Get rid of the Cursed Pickle of Shireton

<<if $cooperation eq true>>

* Escape The Lünēbyn Institute

* The Cursed Pickle of Shireton wants you to do //a whole lot of stuff//.

<<endif>>

<<endif>>

<<if $mail eq true>>

* Deliver a letter to <<print $maildest>>.

<<endif>>

<<if $weaponquest eq true>>

* Purchase a weapon from the Weapon Shoppe, equip it, and show it to the Sheriff of NewBeeTown.

<<endif>>

<<if $healquest eq true>>

* Visit Flora's Honeywell to purchase healing items.

<<endif>>

<<if $orphanage eq true>>

* <<if !$orphankey>>Get the key to the orphanage and release<<else>>Take the orphan key to the Orphanery and free<<endif>> the poor orphans before they burn!<<endif>>

<<if $nbtsmithquest neq null>>

* Collect scrap metal and sell it to the Weaponsmith of NewBeeTown. (You have <<print $metal>>) <<endif>>

<<if $crabquest eq true>>

* Harvest crab claws for the Innkeeper of NewBeeTown. (You have <<print $crabclaws>>) <<endif>>

<<if $qflowers and $mutated neq true>>

* Gather 20 Flowers for Flora, the BeeKeeper of NewBeeTown. (You have <<print $flowers>>) <<endif>>

<<if $qpollen and $mutated neq true>>

* Collect pollen from Rogue Drones in Merry Meadows north of NewBeeTown for Flora. (You have <<print $pollen>>) <<endif>>

<<if $mutated eq true>>

* Collect pollen for the Hive Queen to create honey. (You have <<print $pollen>>)

<<endif>>

<<if $qhoneybread>>

* Purchase bread from the Baker of Shireton and return it to Flora in NewBeeTown. (You have <<print $florabread>>) <<endif>>

<<if $hurl eq true>>

* Acquire five loaves of sourdough bread from the Shireton Bakery and deliver them to the Innkeeper in Lünēbyn so the guests at the free breakfast buffet can have //Famous// French Toast. (You have 0)

<<endif>>

<<if $sameybread eq true>>

* The Innkeeper of <<print $destination>> will pay big money for loaves of bread! (You have 0)

<<endif>>

<<if $bbquest eq true>>

* Bring the Dubious Vendor of Shireton a loaf of bread from the Shireton Bakery in exchange for a mysterious artifact! (You have 0)<<endif>>

Thank you for the examples! I appreciate your help.

1 Like