scottkit 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog.md +35 -18
- data/VERSION +1 -1
- data/data/tutorial/Makefile +7 -0
- data/data/tutorial/t1.map +1 -0
- data/data/tutorial/t2.map +6 -0
- data/data/tutorial/t3.map +6 -0
- data/data/tutorial/t4.map +10 -0
- data/data/tutorial/t5.map +10 -0
- data/data/tutorial/tutorial.md +373 -0
- data/data/tutorial/tutorial.source.md +145 -0
- data/manual/reference.md +25 -24
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74caa6f49f168820ecb2dd75e69168e99a418580
|
4
|
+
data.tar.gz: 7a1ff862fc3c098090fa42c9f42927742bcd1417
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 865872bd20ee18ccd2ed13af2c121de6d0932db82fb303648948a0ceb759adbd3b0c0ace1564cf54ca81e25dd015d7a4538767805badedbc144460ca103faa0d
|
7
|
+
data.tar.gz: f50211980fb0b774677efc29adde3d9ea3f06d1e512f126a47044998a270286ac545e5e1e53330d0c02baf11919005071ffaa375a6c8ded52cc0cd22afbb30ea
|
data/ChangeLog.md
CHANGED
@@ -1,50 +1,67 @@
|
|
1
|
-
Revision history for Ruby gem ScottKit
|
2
|
-
|
1
|
+
# Revision history for Ruby gem ScottKit
|
2
|
+
|
3
|
+
## 1.2.0 (IN PROGRESS)
|
4
|
+
|
5
|
+
* Create initial tutorial, exactly equivalent to that of Games::ScottAdams.
|
6
|
+
|
7
|
+
## 1.1.0 (Thu Oct 12 21:59:28 BST 2017)
|
8
|
+
|
9
|
+
* Documentation fix: correctly name the `present` condition (was `accessible`).
|
10
|
+
* Documentation fix: correctly name _twelve_ actions. (Thanks to Brian Jones for spotting the first of these.)
|
11
|
+
* `moveto` -> `goto`
|
12
|
+
* `print_noun_nl` -> `println_noun`
|
13
|
+
* `nl` -> `println`
|
14
|
+
* `clear_screen` -> `clear`
|
15
|
+
* `set_0` -> `set_flag0`
|
16
|
+
* `clear_0` -> `clear_flag0`
|
17
|
+
* `decrease_counter` -> `dec_counter`
|
18
|
+
* `add_counter` _nu`mber_ -> add_to_counter _number_`
|
19
|
+
* `subtract_counter` -> subtract_from_counter`
|
20
|
+
* `swap_loc_default` -> `swap_room`
|
21
|
+
* `swap_loc` -> swap_specific_room`
|
22
|
+
* `special` -> draw`
|
23
|
+
|
24
|
+
## 1.0.0 (Wed Oct 11 21:45:27 BST 2017)
|
3
25
|
|
4
|
-
1.0.0 (IN PROGRESS)
|
5
|
-
-------------------
|
6
26
|
* Finish translating reference guide from POD to MarkDown.
|
7
27
|
* Update reference guide to describe ScottKit format rather then Games::ScottAdams format.
|
8
28
|
* Fix handling of darkness when playing games.
|
9
29
|
* Support unquoted "carried" and "at" in conditions
|
10
30
|
|
11
|
-
0.4.0 (Mon Mar 1 22:20:09 GMT 2010)
|
12
|
-
|
31
|
+
## 0.4.0 (Mon Mar 1 22:20:09 GMT 2010)
|
32
|
+
|
13
33
|
* Move towards using YARD for documentation instead of Rdoc. This
|
14
34
|
includes changes to things like the format of the Changes file. Far
|
15
35
|
from perfect so far: for example, plain-text documentation like
|
16
36
|
`doc/Definition` gets mangled.
|
17
37
|
|
18
|
-
0.3.0 (February 28, 2010)
|
19
|
-
|
38
|
+
## 0.3.0 (February 28, 2010)
|
39
|
+
|
20
40
|
* Move ScottKit out of its sub-siubdirectory in the 9Gb `mike`
|
21
41
|
git module into its own git module.
|
22
42
|
* Move repository hosting to github.
|
23
43
|
* Arrange for formatted documentation to appear at
|
24
44
|
[http://rdoc.info/projects/MikeTaylor/scottkit](http://rdoc.info/projects/MikeTaylor/scottkit)
|
25
45
|
|
26
|
-
0.2.0 (February 28, 2010)
|
27
|
-
|
46
|
+
## 0.2.0 (February 28, 2010)
|
47
|
+
|
28
48
|
* Add `-z` option to sleep after finishing - useful when running in a
|
29
49
|
DOS Shell under Windows, so that error messages can be seen.
|
30
50
|
* Add facility to load a game while playing, using `#load`
|
31
51
|
|
32
|
-
0.1.0 (February 28, 2010)
|
33
|
-
|
52
|
+
## 0.1.0 (February 28, 2010)
|
53
|
+
|
34
54
|
* Add `-p` option to compile and play a game from source.
|
35
55
|
|
36
|
-
0.0.0 (February 28, 2010)
|
37
|
-
|
56
|
+
## 0.0.0 (February 28, 2010)
|
57
|
+
|
38
58
|
* Initial release.
|
39
59
|
|
40
60
|
|
41
|
-
Still to do
|
42
|
-
===========
|
61
|
+
## Still to do
|
43
62
|
|
44
63
|
* Tweak compiler to break actions when they need too many arguments as
|
45
64
|
well as when they need too many instructions.
|
46
|
-
* Write tutorial scaffolding.
|
47
65
|
* Ensure that the right files are built by `YARD`
|
48
|
-
* Write blog entry about ScottKit
|
49
66
|
* Maybe modify to run against GLK using the Glkx driver
|
50
67
|
* File inclusion
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.1.0
|
@@ -0,0 +1 @@
|
|
1
|
+
Chamber---------Dungeon
|
@@ -0,0 +1,373 @@
|
|
1
|
+
# ScottKit Tutorial
|
2
|
+
|
3
|
+
<!-- md2toc -l 2 tutorial.source.md -->
|
4
|
+
* [Introduction](#introduction)
|
5
|
+
* [Stage 1](#stage-1)
|
6
|
+
* [Stage 1 map](#stage-1-map)
|
7
|
+
* [Stage 1 source](#stage-1-source)
|
8
|
+
* [Stage 2](#stage-2)
|
9
|
+
* [Stage 2 map](#stage-2-map)
|
10
|
+
* [Stage 2 source](#stage-2-source)
|
11
|
+
* [Stage 3](#stage-3)
|
12
|
+
* [Stage 3 map](#stage-3-map)
|
13
|
+
* [Stage 3 source](#stage-3-source)
|
14
|
+
* [Stage 4](#stage-4)
|
15
|
+
* [Stage 4 map](#stage-4-map)
|
16
|
+
* [Stage 4 source](#stage-4-source)
|
17
|
+
* [Stage 5](#stage-5)
|
18
|
+
* [Stage 5 map](#stage-5-map)
|
19
|
+
* [Stage 5 source](#stage-5-source)
|
20
|
+
|
21
|
+
## Introduction
|
22
|
+
|
23
|
+
This document walks you through the process of creating a small but complete and playable game with six rooms, seven items including a single treasure, and a couple of puzzles. It makes no attempt to be complete: you need the reference manual for that. But by the time you've worked your way through this tutorial you should be familiar with rooms, items, actions and occurrences, and you'll be ready to start writing your own games.
|
24
|
+
|
25
|
+
|
26
|
+
## Stage 1
|
27
|
+
|
28
|
+
This is the minimal playable game, consisting of rooms only - and only two of them.
|
29
|
+
|
30
|
+
This stage is built entirely using the %room and %exit directives.
|
31
|
+
|
32
|
+
### Stage 1 map
|
33
|
+
|
34
|
+
```
|
35
|
+
|
36
|
+
Chamber---------Dungeon
|
37
|
+
|
38
|
+
```
|
39
|
+
|
40
|
+
### Stage 1 source
|
41
|
+
|
42
|
+
```
|
43
|
+
room chamber "square chamber"
|
44
|
+
exit east dungeon
|
45
|
+
|
46
|
+
room dungeon "gloomy dungeon"
|
47
|
+
exit west chamber
|
48
|
+
```
|
49
|
+
|
50
|
+
|
51
|
+
## Stage 2
|
52
|
+
|
53
|
+
This stage introduces the first items: one portable (the coin) and one not (the sign).
|
54
|
+
|
55
|
+
This stage uses the directives from the previous stage, plus `item` and `called`.
|
56
|
+
|
57
|
+
### Stage 2 map
|
58
|
+
|
59
|
+
```
|
60
|
+
|
61
|
+
Chamber---------Dungeon
|
62
|
+
[sign] |
|
63
|
+
|
|
64
|
+
|
|
65
|
+
Cell
|
66
|
+
[*coin*]
|
67
|
+
|
68
|
+
```
|
69
|
+
|
70
|
+
### Stage 2 source
|
71
|
+
|
72
|
+
```
|
73
|
+
room chamber "square chamber"
|
74
|
+
exit east dungeon
|
75
|
+
|
76
|
+
item sign "Sign says: leave treasure here, then say SCORE"
|
77
|
+
|
78
|
+
room dungeon "gloomy dungeon"
|
79
|
+
exit west chamber
|
80
|
+
exit south cell
|
81
|
+
|
82
|
+
room cell "dungeon cell"
|
83
|
+
exit north dungeon
|
84
|
+
|
85
|
+
item coin "*Gold coin*"
|
86
|
+
called "coin"
|
87
|
+
```
|
88
|
+
|
89
|
+
|
90
|
+
## Stage 3
|
91
|
+
|
92
|
+
Here we introduce the first explicitly-coded actions - the previous stages' movement between locations and ability to pick up and drop items are "intrinsics" provided by the interpreter.
|
93
|
+
|
94
|
+
The new action provides the first puzzle: the player needs to unlock the cell door before entering the cell to obtain the coin. The key is necessary in order to open the door.
|
95
|
+
|
96
|
+
This stage uses the directives from the previous stage, plus `nowhere`, `at`, `action` and `result`.
|
97
|
+
|
98
|
+
### Stage 3 map
|
99
|
+
|
100
|
+
```
|
101
|
+
|
102
|
+
Chamber---------Dungeon
|
103
|
+
[sign, key] [door]
|
104
|
+
=
|
105
|
+
|
|
106
|
+
Cell
|
107
|
+
[*coin*]
|
108
|
+
|
109
|
+
```
|
110
|
+
|
111
|
+
### Stage 3 source
|
112
|
+
|
113
|
+
```
|
114
|
+
action score: score
|
115
|
+
action inventory: inventory
|
116
|
+
action look: look
|
117
|
+
|
118
|
+
room chamber "square chamber"
|
119
|
+
exit east dungeon
|
120
|
+
|
121
|
+
item sign "Sign says: leave treasure here, then say SCORE"
|
122
|
+
|
123
|
+
room dungeon "gloomy dungeon"
|
124
|
+
exit west chamber
|
125
|
+
|
126
|
+
item door "Locked door"
|
127
|
+
|
128
|
+
room cell "dungeon cell"
|
129
|
+
exit north dungeon
|
130
|
+
|
131
|
+
item coin "*Gold coin*"
|
132
|
+
called "coin"
|
133
|
+
|
134
|
+
item key "Brass key"
|
135
|
+
called "key"
|
136
|
+
at chamber
|
137
|
+
|
138
|
+
item door2 "Open door leads south"
|
139
|
+
nowhere
|
140
|
+
|
141
|
+
action open door when here door and !present key
|
142
|
+
print "It's locked."
|
143
|
+
|
144
|
+
action open door when here door
|
145
|
+
swap door door2
|
146
|
+
print OK
|
147
|
+
look
|
148
|
+
|
149
|
+
action go door when here door2
|
150
|
+
goto cell
|
151
|
+
look
|
152
|
+
```
|
153
|
+
|
154
|
+
|
155
|
+
## Stage 4
|
156
|
+
|
157
|
+
This stage introduces automatic actions, or "occurrences", which occur without the player needing to do anything. In effect, they happen _to_ him rather than being done _by_ him.
|
158
|
+
|
159
|
+
It also uses inline documentation in the form of an action comment (though why you'd want to do this is beyond me) and specifies the start and treasury rooms explicitly.
|
160
|
+
|
161
|
+
This stage uses the directives from the previous stage, plus `occur`, `comment`, `start` and `treasury`.
|
162
|
+
|
163
|
+
### Stage 4 map
|
164
|
+
|
165
|
+
```
|
166
|
+
|
167
|
+
Throne Room Crypt
|
168
|
+
[sign] [vampire, key]
|
169
|
+
| |
|
170
|
+
| |
|
171
|
+
Chamber---------Dungeon
|
172
|
+
[cross] [door]
|
173
|
+
=
|
174
|
+
|
|
175
|
+
Cell
|
176
|
+
[*coin*]
|
177
|
+
|
178
|
+
```
|
179
|
+
|
180
|
+
### Stage 4 source
|
181
|
+
|
182
|
+
```
|
183
|
+
start dungeon
|
184
|
+
treasury throne
|
185
|
+
|
186
|
+
action score: score
|
187
|
+
action inventory: inventory
|
188
|
+
action look: look
|
189
|
+
|
190
|
+
room throne "gorgeously decorated throne room"
|
191
|
+
exit south chamber
|
192
|
+
|
193
|
+
item sign "Sign says: leave treasure here, then say SCORE"
|
194
|
+
|
195
|
+
room chamber "square chamber"
|
196
|
+
exit east dungeon
|
197
|
+
exit north throne
|
198
|
+
|
199
|
+
item cross "Wooden cross"
|
200
|
+
called "cross"
|
201
|
+
|
202
|
+
room dungeon "gloomy dungeon"
|
203
|
+
exit west chamber
|
204
|
+
exit north crypt
|
205
|
+
|
206
|
+
item door "Locked door"
|
207
|
+
|
208
|
+
item key "Brass key"
|
209
|
+
called "key"
|
210
|
+
at crypt
|
211
|
+
|
212
|
+
item door2 "Open door leads south"
|
213
|
+
nowhere
|
214
|
+
|
215
|
+
action open door when here door and !present key
|
216
|
+
print "It's locked."
|
217
|
+
|
218
|
+
action open door when here door
|
219
|
+
swap door door2
|
220
|
+
print OK
|
221
|
+
look
|
222
|
+
|
223
|
+
action go door when here door2
|
224
|
+
goto cell
|
225
|
+
look
|
226
|
+
|
227
|
+
room cell "dungeon cell"
|
228
|
+
exit north dungeon
|
229
|
+
|
230
|
+
item coin "*Gold coin*"
|
231
|
+
called "coin"
|
232
|
+
|
233
|
+
room crypt "damp, dismal crypt"
|
234
|
+
exit south dungeon
|
235
|
+
|
236
|
+
item vampire "Vampire"
|
237
|
+
|
238
|
+
occur when here vampire and !carried cross
|
239
|
+
print "Vampire bites me! I'm dead!"
|
240
|
+
game_over
|
241
|
+
comment "vampire attacks unless cross is carried"
|
242
|
+
|
243
|
+
occur when here vampire and "carried" cross
|
244
|
+
print "Vampire cowers away from the cross!"
|
245
|
+
```
|
246
|
+
|
247
|
+
|
248
|
+
## Stage 5
|
249
|
+
|
250
|
+
This stage adds a light source (and darkness), a random occurrence and aliases for both verbs and nouns.
|
251
|
+
|
252
|
+
This stage uses the directives from the previous stage, plus `lightsource`, `occur` with an argument, `verbgroup` and `noungroup`.
|
253
|
+
|
254
|
+
### Stage 5 map
|
255
|
+
|
256
|
+
```
|
257
|
+
|
258
|
+
Throne Room Crypt
|
259
|
+
[sign, lamp] [vampire, key]
|
260
|
+
| |
|
261
|
+
| |
|
262
|
+
Cave Mouth------Chamber---------Dungeon
|
263
|
+
[cross] [door]
|
264
|
+
=
|
265
|
+
|
|
266
|
+
Cell
|
267
|
+
[*coin*]
|
268
|
+
|
269
|
+
```
|
270
|
+
|
271
|
+
### Stage 5 source
|
272
|
+
|
273
|
+
```
|
274
|
+
start cave
|
275
|
+
treasury throne
|
276
|
+
|
277
|
+
action score: score
|
278
|
+
action inventory: inventory
|
279
|
+
action look: look
|
280
|
+
|
281
|
+
room cave "cave mouth"
|
282
|
+
exit east chamber
|
283
|
+
|
284
|
+
room throne "gorgeously decorated throne room"
|
285
|
+
exit south chamber
|
286
|
+
|
287
|
+
item sign "Sign says: leave treasure here, then say SCORE"
|
288
|
+
|
289
|
+
item lamp "old-fashioned brass lamp"
|
290
|
+
called "lamp"
|
291
|
+
|
292
|
+
lightsource lamp
|
293
|
+
|
294
|
+
room chamber "square chamber"
|
295
|
+
exit east dungeon
|
296
|
+
exit north throne
|
297
|
+
exit west cave
|
298
|
+
|
299
|
+
# Flag 15 is on when and only when it is dark
|
300
|
+
occur when "at" chamber and flag 15
|
301
|
+
clear_dark
|
302
|
+
look
|
303
|
+
|
304
|
+
item cross "Wooden cross"
|
305
|
+
called "cross"
|
306
|
+
|
307
|
+
room dungeon "gloomy dungeon"
|
308
|
+
exit west chamber
|
309
|
+
exit north crypt
|
310
|
+
|
311
|
+
occur when "at" dungeon and !flag 15
|
312
|
+
set_dark
|
313
|
+
look
|
314
|
+
|
315
|
+
occur 25% when "at" dungeon
|
316
|
+
print "I smell something rotting to the north."
|
317
|
+
|
318
|
+
item door "Locked door"
|
319
|
+
|
320
|
+
item key "Brass key"
|
321
|
+
called "key"
|
322
|
+
at crypt
|
323
|
+
|
324
|
+
item door2 "Open door leads south"
|
325
|
+
nowhere
|
326
|
+
|
327
|
+
action open door when here door and !present key
|
328
|
+
print "It's locked."
|
329
|
+
|
330
|
+
action open door when here door
|
331
|
+
swap door door2
|
332
|
+
print OK
|
333
|
+
look
|
334
|
+
|
335
|
+
action go door when here door2
|
336
|
+
goto cell
|
337
|
+
look
|
338
|
+
|
339
|
+
room cell "dungeon cell"
|
340
|
+
exit north dungeon
|
341
|
+
|
342
|
+
item coin "*Gold coin*"
|
343
|
+
called "coin"
|
344
|
+
|
345
|
+
room crypt "damp, dismal crypt"
|
346
|
+
exit south dungeon
|
347
|
+
|
348
|
+
item vampire "Vampire"
|
349
|
+
|
350
|
+
occur when here vampire and !carried cross
|
351
|
+
print "Vampire bites me! I'm dead!"
|
352
|
+
game_over
|
353
|
+
comment "vampire attacks unless cross is carried"
|
354
|
+
|
355
|
+
occur when here vampire and "carried" cross
|
356
|
+
print "Vampire cowers away from the cross!"
|
357
|
+
|
358
|
+
verbgroup take get
|
359
|
+
verbgroup leave drop
|
360
|
+
noungroup lamp lantern
|
361
|
+
```
|
362
|
+
|
363
|
+
|
364
|
+
## Caveats
|
365
|
+
|
366
|
+
This tutorial skips a lot of details. [The reference manual](../../manual/reference.md) is indispensible for filling in the gaps.
|
367
|
+
|
368
|
+
The following directives are not yet discussed: `ident`, `version`, `wordlen`, `maxload`, `lighttime`.
|
369
|
+
|
370
|
+
There is not yet any discussion of flags, counters and location stores.
|
371
|
+
|
372
|
+
Some discussion of what makes a good game design may be appropriate.
|
373
|
+
|
@@ -0,0 +1,145 @@
|
|
1
|
+
changequote(`[[[', `]]]')dnl
|
2
|
+
# ScottKit Tutorial
|
3
|
+
|
4
|
+
<!-- md2toc -l 2 tutorial.source.md -->
|
5
|
+
* [Introduction](#introduction)
|
6
|
+
* [Stage 1](#stage-1)
|
7
|
+
* [Stage 1 map](#stage-1-map)
|
8
|
+
* [Stage 1 source](#stage-1-source)
|
9
|
+
* [Stage 2](#stage-2)
|
10
|
+
* [Stage 2 map](#stage-2-map)
|
11
|
+
* [Stage 2 source](#stage-2-source)
|
12
|
+
* [Stage 3](#stage-3)
|
13
|
+
* [Stage 3 map](#stage-3-map)
|
14
|
+
* [Stage 3 source](#stage-3-source)
|
15
|
+
* [Stage 4](#stage-4)
|
16
|
+
* [Stage 4 map](#stage-4-map)
|
17
|
+
* [Stage 4 source](#stage-4-source)
|
18
|
+
* [Stage 5](#stage-5)
|
19
|
+
* [Stage 5 map](#stage-5-map)
|
20
|
+
* [Stage 5 source](#stage-5-source)
|
21
|
+
|
22
|
+
## Introduction
|
23
|
+
|
24
|
+
This document walks you through the process of creating a small but complete and playable game with six rooms, seven items including a single treasure, and a couple of puzzles. It makes no attempt to be complete: you need the reference manual for that. But by the time you've worked your way through this tutorial you should be familiar with rooms, items, actions and occurrences, and you'll be ready to start writing your own games.
|
25
|
+
|
26
|
+
|
27
|
+
## Stage 1
|
28
|
+
|
29
|
+
This is the minimal playable game, consisting of rooms only - and only two of them.
|
30
|
+
|
31
|
+
This stage is built entirely using the %room and %exit directives.
|
32
|
+
|
33
|
+
### Stage 1 map
|
34
|
+
|
35
|
+
```
|
36
|
+
|
37
|
+
include(t1.map)dnl
|
38
|
+
|
39
|
+
```
|
40
|
+
|
41
|
+
### Stage 1 source
|
42
|
+
|
43
|
+
```
|
44
|
+
include(t1.sck)dnl
|
45
|
+
```
|
46
|
+
|
47
|
+
|
48
|
+
## Stage 2
|
49
|
+
|
50
|
+
This stage introduces the first items: one portable (the coin) and one not (the sign).
|
51
|
+
|
52
|
+
This stage uses the directives from the previous stage, plus `item` and `called`.
|
53
|
+
|
54
|
+
### Stage 2 map
|
55
|
+
|
56
|
+
```
|
57
|
+
|
58
|
+
include(t2.map)dnl
|
59
|
+
|
60
|
+
```
|
61
|
+
|
62
|
+
### Stage 2 source
|
63
|
+
|
64
|
+
```
|
65
|
+
include(t2.sck)dnl
|
66
|
+
```
|
67
|
+
|
68
|
+
|
69
|
+
## Stage 3
|
70
|
+
|
71
|
+
Here we introduce the first explicitly-coded actions - the previous stages' movement between locations and ability to pick up and drop items are "intrinsics" provided by the interpreter.
|
72
|
+
|
73
|
+
The new action provides the first puzzle: the player needs to unlock the cell door before entering the cell to obtain the coin. The key is necessary in order to open the door.
|
74
|
+
|
75
|
+
This stage uses the directives from the previous stage, plus `nowhere`, `at`, `action` and `result`.
|
76
|
+
|
77
|
+
### Stage 3 map
|
78
|
+
|
79
|
+
```
|
80
|
+
|
81
|
+
include(t3.map)dnl
|
82
|
+
|
83
|
+
```
|
84
|
+
|
85
|
+
### Stage 3 source
|
86
|
+
|
87
|
+
```
|
88
|
+
include(t3.sck)dnl
|
89
|
+
```
|
90
|
+
|
91
|
+
|
92
|
+
## Stage 4
|
93
|
+
|
94
|
+
This stage introduces automatic actions, or "occurrences", which occur without the player needing to do anything. In effect, they happen _to_ him rather than being done _by_ him.
|
95
|
+
|
96
|
+
It also uses inline documentation in the form of an action comment (though why you'd want to do this is beyond me) and specifies the start and treasury rooms explicitly.
|
97
|
+
|
98
|
+
This stage uses the directives from the previous stage, plus `occur`, `comment`, `start` and `treasury`.
|
99
|
+
|
100
|
+
### Stage 4 map
|
101
|
+
|
102
|
+
```
|
103
|
+
|
104
|
+
include(t4.map)dnl
|
105
|
+
|
106
|
+
```
|
107
|
+
|
108
|
+
### Stage 4 source
|
109
|
+
|
110
|
+
```
|
111
|
+
include(t4.sck)dnl
|
112
|
+
```
|
113
|
+
|
114
|
+
|
115
|
+
## Stage 5
|
116
|
+
|
117
|
+
This stage adds a light source (and darkness), a random occurrence and aliases for both verbs and nouns.
|
118
|
+
|
119
|
+
This stage uses the directives from the previous stage, plus `lightsource`, `occur` with an argument, `verbgroup` and `noungroup`.
|
120
|
+
|
121
|
+
### Stage 5 map
|
122
|
+
|
123
|
+
```
|
124
|
+
|
125
|
+
include(t5.map)dnl
|
126
|
+
|
127
|
+
```
|
128
|
+
|
129
|
+
### Stage 5 source
|
130
|
+
|
131
|
+
```
|
132
|
+
include(t5.sck)dnl
|
133
|
+
```
|
134
|
+
|
135
|
+
|
136
|
+
## Caveats
|
137
|
+
|
138
|
+
This tutorial skips a lot of details. [The reference manual](../../manual/reference.md) is indispensible for filling in the gaps.
|
139
|
+
|
140
|
+
The following directives are not yet discussed: `ident`, `version`, `wordlen`, `maxload`, `lighttime`.
|
141
|
+
|
142
|
+
There is not yet any discussion of flags, counters and location stores.
|
143
|
+
|
144
|
+
Some discussion of what makes a good game design may be appropriate.
|
145
|
+
|
data/manual/reference.md
CHANGED
@@ -459,7 +459,7 @@ of an item defined somewhere in the ScottKit file.
|
|
459
459
|
--
|
460
460
|
True if _ITEM_ is in the player's current room.
|
461
461
|
|
462
|
-
* `
|
462
|
+
* `present` _ITEM_
|
463
463
|
--
|
464
464
|
True if _ITEM_ is either being carried by the player or in the
|
465
465
|
player's current room (i.e. if either `carried ITEM` or `here
|
@@ -504,7 +504,7 @@ The sense of the
|
|
504
504
|
`at`,
|
505
505
|
`carried`,
|
506
506
|
`here`,
|
507
|
-
`
|
507
|
+
`present`,
|
508
508
|
`exists`,
|
509
509
|
`moved`,
|
510
510
|
`loaded`,
|
@@ -530,7 +530,7 @@ necessary, to place each result on its own line.
|
|
530
530
|
|
531
531
|
The following opcodes are supported:
|
532
532
|
|
533
|
-
* `
|
533
|
+
* `goto` _room_
|
534
534
|
--
|
535
535
|
Moves to the specified _room_ and displays its description.
|
536
536
|
|
@@ -538,7 +538,7 @@ Moves to the specified _room_ and displays its description.
|
|
538
538
|
--
|
539
539
|
Redisplays the description of the current room, the obvious exits and
|
540
540
|
any visible items. This is done automatically whenever the player
|
541
|
-
moves (with the `
|
541
|
+
moves (with the `goto` action), `get`s an item from the current
|
542
542
|
room, or `drop`s an item. So far as I can tell, it need only be done
|
543
543
|
explicitly when changing the value of the darkness flag.
|
544
544
|
|
@@ -625,15 +625,15 @@ Prints "The game is now over", waits five seconds and exits.
|
|
625
625
|
--
|
626
626
|
Prints the noun that the user just typed.
|
627
627
|
|
628
|
-
* `
|
628
|
+
* `println_noun`
|
629
629
|
--
|
630
630
|
Prints the noun that the user just typed, followed by a newline.
|
631
631
|
|
632
|
-
* `
|
632
|
+
* `println`
|
633
633
|
--
|
634
634
|
Emits a newline (i.e. moves to the beginning of the next line).
|
635
635
|
|
636
|
-
* `
|
636
|
+
* `clear`
|
637
637
|
--
|
638
638
|
Clears the screen. Who could have guessed?
|
639
639
|
|
@@ -675,12 +675,12 @@ Sets flag 15, which indicates darkness. Exactly equivalent to
|
|
675
675
|
Clears flag 15, which indicates darkness. Exactly equivalent to
|
676
676
|
`clear_flag 15`.
|
677
677
|
|
678
|
-
* `
|
678
|
+
* `set_flag0`
|
679
679
|
--
|
680
680
|
Sets flag 0. Exactly equivalent to
|
681
681
|
`set_flag 0`.
|
682
682
|
|
683
|
-
* `
|
683
|
+
* `clear_flag0`
|
684
684
|
--
|
685
685
|
Clears flag 0. Exactly equivalent to
|
686
686
|
`clear_flag 0`.
|
@@ -698,19 +698,19 @@ drivers can't print values greater than 99, so if you're designing
|
|
698
698
|
your games for maximum portability, you should avoid using numbers
|
699
699
|
higher than this.
|
700
700
|
|
701
|
-
* `
|
701
|
+
* `dec_counter`
|
702
702
|
--
|
703
703
|
Decreases the value of the currently selected counter by one. The
|
704
704
|
value cannot be decreased below zero. Surprisingly, there is no
|
705
|
-
corresponding `increase_counter` action, but you can use `
|
705
|
+
corresponding `increase_counter` action, but you can use `add_to_counter
|
706
706
|
1`.
|
707
707
|
|
708
|
-
* `
|
708
|
+
* `add_to_counter` _number_
|
709
709
|
--
|
710
710
|
Increases the value of the currently selected counter by the specified
|
711
711
|
_number_.
|
712
712
|
|
713
|
-
* `
|
713
|
+
* `subtract_from_counter` _number_
|
714
714
|
--
|
715
715
|
Decreases the value of the currently selected counter by the specified
|
716
716
|
_number_.
|
@@ -718,28 +718,29 @@ _number_.
|
|
718
718
|
* `select_counter` _number_
|
719
719
|
--
|
720
720
|
Chooses which of the sixteen counters is the current one. Subsequent
|
721
|
-
`
|
721
|
+
`dec_counter`, `print_counter`, etc., actions will operate on
|
722
722
|
the nominated counter. (Initially, counter 0 is used.)
|
723
723
|
|
724
|
-
* `
|
724
|
+
* `swap_room`
|
725
725
|
--
|
726
726
|
Swaps the player between the current location and a backup location.
|
727
727
|
The backup location is initially undefined, so the first use of this
|
728
|
-
should be immediately followed by a `
|
728
|
+
should be immediately followed by a `goto` to a known room; the
|
729
729
|
next use will bring the player back where it was first used.
|
730
730
|
|
731
|
-
* `
|
731
|
+
* `swap_specific_room` _number_
|
732
732
|
--
|
733
|
-
Like `
|
733
|
+
Like `swap_room` but works with one of a sixteen numbered
|
734
734
|
backup locations, nominated by _number_. Swaps the current location
|
735
|
-
with backup location _number_, so that subsequently doing `
|
735
|
+
with backup location _number_, so that subsequently doing `swap_specific_room`
|
736
736
|
again with the same argument will result in returning to the original
|
737
737
|
place. This can be used to implement vehicles.
|
738
738
|
|
739
|
-
* `
|
739
|
+
* `draw` _number_
|
740
740
|
--
|
741
|
-
Performs a "special action" that is dependent on the driver. For
|
742
|
-
|
741
|
+
Performs a "special action" that is dependent on the driver. For some
|
742
|
+
drivers, it draws a picture specified but the number. In
|
743
|
+
ScottKit (as in ScottFree), this does nothing.
|
743
744
|
|
744
745
|
* `continue`
|
745
746
|
--
|
@@ -897,8 +898,8 @@ first.
|
|
897
898
|
|
898
899
|
## See also
|
899
900
|
|
900
|
-
* The top-level [README](
|
901
|
-
* [The ScottKit tutorial](
|
901
|
+
* The top-level [README](../README.md)
|
902
|
+
* [The ScottKit tutorial](../data/tutorial/tutorial.md)
|
902
903
|
* The Perl module [Games::ScottAdams](http://search.cpan.org/~mirk/Games-ScottAdams/)
|
903
904
|
|
904
905
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scottkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Taylor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ScottKit is a toolkit for compiling, decompiling and playing adventure
|
14
14
|
games in the Scott Adams format.
|
@@ -61,13 +61,21 @@ files:
|
|
61
61
|
- data/test/t7.sao
|
62
62
|
- data/test/t7.solution
|
63
63
|
- data/test/t7.transcript
|
64
|
+
- data/tutorial/Makefile
|
65
|
+
- data/tutorial/t1.map
|
64
66
|
- data/tutorial/t1.sck
|
67
|
+
- data/tutorial/t2.map
|
65
68
|
- data/tutorial/t2.sck
|
69
|
+
- data/tutorial/t3.map
|
66
70
|
- data/tutorial/t3.sck
|
71
|
+
- data/tutorial/t4.map
|
67
72
|
- data/tutorial/t4.sck
|
73
|
+
- data/tutorial/t5.map
|
68
74
|
- data/tutorial/t5.sck
|
69
75
|
- data/tutorial/t6.sck
|
70
76
|
- data/tutorial/t7.sck
|
77
|
+
- data/tutorial/tutorial.md
|
78
|
+
- data/tutorial/tutorial.source.md
|
71
79
|
- lib/scottkit/compile.rb
|
72
80
|
- lib/scottkit/decompile.rb
|
73
81
|
- lib/scottkit/game.rb
|