/
Advanced Help Menu.i7x
157 lines (121 loc) · 5.94 KB
/
Advanced Help Menu.i7x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
Version 1/140513 of Advanced Help Menu by John W Kennedy begins here.
"Builds on Emily Short's Basic Help Menu, with hints that are enabled under program control and sample transcriptions"
Include Basic Help Menu by Emily Short.
To activate hint (H - table-name):
if H is a subtable listed in the table of all hints begin;
choose row with a subtable of H in the Table of all hints;
let M be the parent subtable entry;
let T be the title entry;
blank out the whole row;
choose a blank row in M;
now the title entry is T;
now the subtable entry is H;
now toggle entry is the hint toggle rule;
end if.
To activate hint menu (M - table-name):
if M is a menu listed in the table of all hint menus begin;
choose row with a menu of M in the Table of all hint menus;
let P be the parent subtable entry;
let T be the title entry;
blank out the whole row;
choose a blank row in P;
now the title entry is T;
now the subtable entry is M;
end if.
This is the sample-transcript rule:
clear the screen;
choose row current menu selection in the current menu;
let the transcription be the subtable entry;
repeat through the transcription begin;
say the sample text entry;
say paragraph break;
end repeat;
say "Press SPACE to return to the menu.";
wait for the SPACE key;
redraw status line;
Advanced Help Menu ends here.
---- DOCUMENTATION ----
This first requires that the following two tables be created. The tables themselves must be as given, but the contents depend on the game. The first table gives a list of all hint menus except the master hint menu (here called "Table of general hints". The second table gives a list of all hints
Table of all hint menus
menu title parent subtable
Table of Somerset hints "In Somerset Town" Table of general hints
Table of Enchanted Forest hints "In the Enchanted Forest" Table of general hints
Table of all hints
subtable title parent subtable
Table of forest entry hints "How can I enter the Forest?" Table of Somerset hints
Table of goblet hints "What can I do with the goblet?" Table of Somerset hints
Table of tavern hints "What should I do at the Full Moon Tavern?" Table of Enchanted Forest hints
In addition to these, the actual hint tables must be created, just as in Emily Short's basic system, and the hint menus can be created. Note that each hint menu must be created with sufficient blank rows, or there will be an error at run time.
To activate any hint,
Activate hint (hint-table-name).
To activate any hint menu,
Activate hint menu (hint-menu-name).
A further feature is that one or more sample transcripts can be created. To do so, put in a help menu a row such as this.
"Sample transcription" Table of the sample -- sample-transcript rule
A sample-transcription table contains a column called "sample text", filled with material to be emitted. Each one will be displayed with a trailing paragraph break.
Section: 6L02 Compatibility Update
This extension differs from the author's original version: it has been modified for compatibility with version 6L02 of Inform. The latest version of this extension can be found at <https://github.com/i7/extensions>.
This extension is released under the Creative Commons Attribution licence. Bug reports, feature requests or questions should be made at <https://github.com/i7/extensions/issues>.
Example: * Samplex - A small game mostly consisting of such help.
"Samplex" by John W Kennedy
Include Advanced Help Menu by John W Kennedy.
When play begins:
choose row 1 in Table of Basic Help Options;
now description entry is "This is a demonstration of John W. Kennedy's Advanced Help Menu.";
activate hint menu Table of Entrance hints menu;
activate hint Table of entering hints.
The Cave Entrance is a room.
"You are outside a cave, which is south of you."
South is the Cave Interior.
The Cave Interior is a room.
"This is the interior of the cave."
After going in the Cave Interior:
activate hint menu Table of Cave hints menu;
activate hint Table of opening hints;
continue the action.
The treasure chest is an openable closed container in the Cave Interior.
After opening the treasure chest:
end the story finally saying "You have won."
Table of Basic Help Options (continued)
title subtable description toggle
"Setting options" Table of Setting Options
"Sample transcript" Table of a sample transcript -- sample-transcript rule
"Hints" Table of general hint menus
Table of a Sample Transcript
sample text
"[italic type]This is not a transcript from [bold type]Samplex[roman type][italic type], but illustrates the sort of thing that can happen.[roman type]"
"[bold type]Bedroom[roman type][line break]This is your bedroom. The kitchen is to your east."
">inventory"
"You are holding a mousetrap."
">east"
"[bold type]Kitchen[roman type][line break]This is your kitchen. Tiny black dots on the floor confirm your worst fears."
">put the mousetrap on the floor"
"That would be pointless, as the mousetrap is not set."
Table of all hint menus
menu title parent subtable
Table of Entrance hints menu "At the cave entrance" Table of general hint menus
Table of Cave hints menu "In the cave" Table of general hint menus
Table of general hint menus
title subtable (a table name) description toggle (a rule)
-- -- -- --
with 1 blank row. [2 blank rows total]
Table of Entrance hints menu
title subtable (a table-name) description toggle (a rule)
-- -- -- --
[1 blank row total]
Table of Cave hints menu
title subtable (a table-name) description toggle (a rule)
-- -- -- --
[1 blank row total]
Table of all hints
subtable title parent subtable
Table of entering hints "How can I enter the cave?" Table of Entrance hints menu
Table of opening hints "How can I open the chest?" Table of Cave hints menu
Table of entering hints
hint used (a number)
"Well, you could simply wish yourself into the cave." --
"Something simpler would work better." --
"Just go south." --
Table of opening hints
hint used (a number)
"Just open it!" --