Using Twine to have complex and non-linear storyline. Provides a custom quest system.
Twine is a system to have interactive story that is pretty straightforward. But I found it hard to have some story format.
Player can pretty always navigate between some passages (Permanent passage) and on everywhere, can begins quest that needs to be played at different places.
Exemple :
There is a home, a room, and a garden. This are permanent passages. In the room, a quest can be found that requires some herbs from the garden.
In traditionnal Twine working, we will have to copy link to the garden, for this quest or edit garden to see a variable and display the quest to search the herbs.
With this framework, writers/game-master have to define home, room and garden as permanent passages, and create passage to the first element of the quest to the room, and from here (from the first "quest" passage will define where the others will appear)
You need Twine, v2, and format Snowman (pure js)
Create a new story.
In the launch passage add the fellowing between tag for js : <% and %>\
class Quest{
constructor(id,target,condition){
this.id=id
this.target = target;
this.condition=condition;
}
}
s.quest = [];
It's very simple, in this first version, we create a structure that will host our quest, and create a global variable that will hold them.
New Passage via Twine.
And when you edit the passage, take care to have a description that will be quasi permanent throughout the story.
Add to the end the fellowing between tag for js (<% and %>)\
_.each(s.quest['XXXX'],function(quest){
if(quest.condition()){
%><p><%=quest.target%></p><%
}
});
s.back="[[YYYYYYY]]";
Change XXXX by your referential for this permanent passage.
Change YYYYYYY by your referential for this permanent passage that will be displayed to the player. (Backing link)\
Re-open your init passage and add after initializing s.quest
s.quest['XXXX']=[];
It will initialize the list of quest you will find for this permanent passage.
s.quest['XXXX'].push(new Quest("someIdUnique","ZZZZ", function(){return true;}));
Change XXXX by the referential of your permanent passage, and ZZZZ by a link to the passage that begins the new quest. Note that Twine will link the quest from where this is added.
If you add this line from your init, it will be separated from your permanent passage.
s.quest['permPlace1'] = _.reject(s.quest['permPlace1'],function(quest){
return quest.id=="newQuest";});
Replace permPlace1 by the referency of your permanent place, and the "newQuest" by the id of the quest you want to remove.
In the creation of the quest, you have a place in the "condition" parameter where you can specify a condition. For exemple :
function(){return s.quest['permPlace1'].length<3;}
will display the quest only if the number of quest on permPlace1 is less than 3 (counting non-displaying quest)
At length, this project might be a new format for Twine.
- Quest system
- Inventory system
- Reputation system
- Example in english
- Overlay of Twine to see all storyline for quests, and all storyline for permanent passages