Merge tag 'upstream/6.12.1_dfsg.1'
[debian_inform6-library.git] / voices_and_tenses.txt
blob5026fa0e23c7288e6002c9b071f95a65b7993b2f
1 The Inform Library version 6.12 introduces two fun new ways of
2 storytelling.  First, you can use first-person and third person
3 narrative voices.  Second, you can use past tense.  The typical way to
4 write interactive fiction has been for the game to talk about the player
5 in the second-person narrative voice in the present tense.  For example:
7   > PUT COOKIE ON TABLE
8   You put the cookie on the table.
10 That's how Infocom usually did things and is Inform's default.  Now
11 suppose you, the author, want the story to read more like an
12 autobiography.  Consider this:
14   > PUT COOKIE ON TABLE
15   I put the cookie on the table.
17 This is the first-person narrative voice.  Third-person narrative voice
18 looks like this:
20   > PUT COOKIE ON TABLE
21   George puts the cookie on the table.
23 To cause these alternative narrative voices, the player object needs to
24 have a narrative_voice property with a value of 1 or 3.  Setting it to 2
25 results in the old regular behavior.  It's most convenient to do this in
26 the Initialise() routine like this:
28   [ Initialise;
29       location = TheRoom;
30       player.narrative_voice = 1;
31   ];
33 For third-person mode, some additional properties are necessary:
35   [ Initialise;
36       location = TheRoom;
37       player.narrative_voice = 3;
38       player.short_name = "George Jones";
39       (player.&name)-->0 = 'George';
40       (player.&name)-->1 = 'Jones';
41   ];
43 The name property must be specified like this.  There are five slots to
44 which you may add dictionary words.
46 Using these modes may require a bit more discipline when it comes to
47 writing your prose and dealing with the default responses from new verbs
48 you introduce.  If the player always controls the same character and/or
49 the narrative voice never changes, you can write your verb subroutines
50 to always talk about George.  If the player changes characters or the
51 narrative voice changes, things get a bit more complicated.  Problems
52 like that can be solved by careful use of the CSubject functions which
53 are detailed at the end of this document.
55 Previously if you changed the player-character to something other than
56 selfobj, the former player-character would be described as "Your former
57 self" when typing "LOOK".  If you want to change bodies like this, you
58 must set player.short_name even if you use the old regular second-person
59 voice.  Make sure the narrative_voice, short_name, and name properties
60 are all sensibly set for all possible bodies the player might control.
62 Changing bodies can be a handy technique for implement flashbacks.
63 Create self2, self3, and so on for each time period you visit.  Just
64 change the player global to the self you want to be in control.  The
65 SelfClass class is provided with all the various properties a
66 player-character needs.  Use this class whenever you create a new self.
68 An interesting way of using the third-person voice is to give the PC a
69 generic name like "detective" (put that in the short_name and name
70 properties).  Then take away the PC's proper attribute.  This will cause
71 the library to address the PC as "the detective" and correctly
72 capitalize the word "the".  For instance:
74   [ Initialise;
75       location = theroom;
76       player.narrative_voice = 3;
77       player.short_name = "detective";
78       (player.&name)-->0 = 'detective';
79       give player ~proper;
80   ];
82 This results in a room description like this:
84   >PUT FOLDER ON TABLE
85   The detective puts the folder on the table.
87   >LOOK
89   Squad Room
90   This is the 13th Precinct's squad room.
92   The detective can see a table (upon which is a folder).
94   >INVENTORY
95   The detective is carrying:
96     a badge
97     a revolver
99 The default article used to describe a non-proper PC is "the".  If you
100 want to talk about "a detective", just set player.article to "a".
102 There is another property for the player object: nameless.  This has
103 meaning only in the first-person or second-person narrative voices.
104 Normally if you're using either of these voices and the PC switches
105 bodies, the PC's former body is referred to as "My former self" or "Your
106 former self".  If you want the former body to be referred to some other
107 way, set player.nameless to false and set the name and short_name
108 properties to something appropriate.  If third-person narrative voice is
109 used, the nameless property is ignored.  "The detective" isn't
110 namelessness.  It's just not a proper name.
112 The Library uses the CSubject subroutines to figure out when to say "I",
113 "You", or "George".  You can use them too.  The most important of these
114 is CSubjectVerb().  It handles the conjugation of verbs used by the
115 actor.  These are its parameters:
116         obj             The actor who is doing something.
117         reportage       Boolean: causes the actor to "observe"[1]
118         nocaps          Boolean: Don't capitalise if "you" is used[2].
119         v1              1st person "I" present verb.
120         v2              2nd person "You" present verb[3].
121         v3              3rd person "He", "she", or "it" present verb.
122         past            The past tense form of the verb[4].
124 [1] In the Library itself, "reportage" is used in SubjectNotPlayer()
125 which determines the correct conjugation for certain actions performed
126 by NPCs.  If this is "false", then this will happen:
127     >SALLY, RUB LAMP
128     Sally achieves nothing by this.
129 If this is "true" then this happens:
130     >SALLY, RUB LAMP
131     Sally observes that she achieves nothing by this.
132 This sort of thing can be important if you want to imply that the NPC is
133 aware of the result of an action.
135 [2] When the second-person voice is used, responses very often begin
136 with "You".  Suppose you want to put a conjunction like "but" in front
137 of "you".  For instance:
138     >EAT PUDDING
139     But you can't have any pudding if you don't eat your meat!
140 See that "you" is not capitalised.  If you omit this parameter, it will
141 be false and therefore the game will capitalise "you".  If you want to
142 use a conjunction as in the above example, pass "true".
144 [3] The v2 parameter is usually not necessary because the first and
145 second person present forms of verbs are usually the same.  Unless you
146 have something special planned, pass 0 for v2.
148 [4] Past tense can be useful for implementing a flashback.  For
149 instance:
150     >EXAMINE VASE
151     The vase was very expensive-looking.
154 Here's an example of using CSubjectVerb():
155    CSubjectVerb(actor,false,false,"close",0,"closes","closed"); " ",
156      (the) x1, ".";
158 The default is to use the present tense.  If you want to change to the
159 past tense, set player.narrative_tense to PAST_TENSE.  To change back,
160 change it to PRESENT_TENSE.  If you're doing something more complicated,
161 like going back and forth between the present and the past, it can be
162 handy to create a "past PC" with its own posessions and properties.
163 That one always has its narrative_tense set to PAST_TENSE.  Then when
164 you want to flash back, simply call ChangePlayer() appropriately.
166 There is a helper function called Tense() that doesn't quite fit in with
167 the CSubject functions.  This one takes two parameters: present and
168 past.  Its purpose is to keep the tense of various verbs straight.  It's
169 not meant for sorting out narrative voices, but instead is applied after
170 that has been sorted out.  In fact, Tense() is used extensively in the
171 CSubject helper functions to do just that.  Here's how to use it:
172     print "After the storm, there still ";
173     Tense("isn't", "wasn't");
174     " enough rainfall.";
176 Most of the rest of the CSubject functions are wrappers for commonly
177 used verbs: "is", "isn't", "has", "will", "can", "can't", and "don't".
178 These have only three parameters: obj, reportage, and nocaps.  You can
179 call these with two or one parameters if you like. The functions will
180 receive 0 (also false) for missing trailing parameters. CSubjectVoice()
181 is similar to CSubjectVerb() except that the name of the subject is not
182 printed.
184 Here they are along with sample calls:
186 CSubjectIs()
187     CSubjectIs(x1,true); " already closed.";
189 CSubjectIsnt()
190     print "But ";
191     CSubjectIsnt(actor,true,false);
192     " in anything at the moment.";
194 CSubjectHas()
195     CSubjectHas(actor,false); " better things to do.";
197 CSubjectWill()
198     CSubjectWill(actor,true); " first have to close ", (the) x1, ".";
200 CSubjectCan()
201     CSubjectCan(actor,true);
202     " only get into something free-standing.";
204 CSubjectCant()
205     CSubjectCant(actor,true);
206     " usefully blow ", (thatorthose) x1, ".";
208 CSubjectDont()
209     CSubjectDont(x1,true); " seem to fit the lock.";
211 CSubjectVoice()
212      print "What ";
213      CSubjectVoice(player, "do", "do", "does", "did");
214      print " ";
215      CSubjectVerb(player, false, true, "want", "want", "want", "want");
216      " to do?";