@bgforge/mls-server 3.2.1 → 3.3.1

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.
@@ -1,134 +1,92 @@
1
1
  [
2
2
  {
3
- "label": "THEN",
4
- "kind": 14,
5
- "source": "builtin",
6
- "category": "keywords"
7
- },
8
- {
9
- "label": "RESPONSE",
10
- "kind": 14,
11
- "source": "builtin",
12
- "category": "keywords"
13
- },
14
- {
15
- "label": "OR",
16
- "kind": 14,
17
- "source": "builtin",
18
- "category": "keywords"
19
- },
20
- {
21
- "label": "GLOBAL",
22
- "kind": 14,
23
- "source": "builtin",
24
- "category": "keywords"
25
- },
26
- {
27
- "label": "LOCALS",
28
- "kind": 14,
29
- "source": "builtin",
30
- "category": "keywords"
31
- },
32
- {
33
- "label": "MYAREA",
34
- "kind": 14,
35
- "source": "builtin",
36
- "category": "keywords"
37
- },
38
- {
39
- "label": "END",
40
- "kind": 14,
41
- "source": "builtin",
42
- "category": "keywords"
43
- },
44
- {
45
- "label": "BEGIN",
3
+ "label": "ADD_STATE_TRIGGER",
46
4
  "kind": 3,
47
5
  "source": "builtin",
48
6
  "category": "actions",
49
7
  "documentation": {
50
8
  "kind": "markdown",
51
- "value": "```weidu-d-tooltip\nBEGIN filename [ nonPausing ] state list\n```\nBEGIN tells WeiDU that you are creating a new DLG file from scratch. Any existing DLG file with the same name will be overwritten. The new DLG file contains exactly the states in the list. If you set nonPausing to a non-zero integer, the game will not \"stop time\" while the conversation takes place. By default time stops during conversations."
9
+ "value": "```weidu-d-tooltip\nADD_STATE_TRIGGER filename stateNumber stateTriggerString [ stateNumber list ] \tdActionWhen list\n```\nThis instructs WeiDU to add the stateTriggerString to all of the states with the given stateNumbers in the file filename.DLG (which must already exist). This is handy for adding extra conditions to an existing dialogue state."
52
10
  }
53
11
  },
54
12
  {
55
- "label": "APPEND",
13
+ "label": "ADD_TRANS_ACTION",
56
14
  "kind": 3,
57
15
  "source": "builtin",
58
16
  "category": "actions",
59
17
  "documentation": {
60
18
  "kind": "markdown",
61
- "value": "```weidu-d-tooltip\nAPPEND [ IF_FILE_EXISTS ] filename state list END\n```\nThis tells WeiDU to place the given states at the end of the already-existing dialogue filename.DLG. If there is IF_FILE_EXISTS and the file doesn't exists, this action is skipped."
19
+ "value": "```weidu-d-tooltip\nADD_TRANS_ACTION filename BEGIN stateNumber list END BEGIN transNumber list END transActionString dActionWhen list\n```\nThis instructs WeiDU to add the transActionString to all of the actions in all the transitions in all of the states specified by the stateNumber list and the transNumber list. You may use state labels in the stateNumber list. If the transNumber list is empty, the text added to all transitions on all listed states. Note that the BEGIN and END keywords must be present, even if you specify an empty list of transNumbers. The \"first\" transition is number 0. Any out-of-bounds transNumbers are silently ignored. The transActionString is prepended to any existing action text on a per-transition, per-state basis."
62
20
  }
63
21
  },
64
22
  {
65
- "label": "APPEND_EARLY",
23
+ "label": "ADD_TRANS_TRIGGER",
66
24
  "kind": 3,
67
25
  "source": "builtin",
68
26
  "category": "actions",
69
27
  "documentation": {
70
28
  "kind": "markdown",
71
- "value": "```weidu-d-tooltip\nAPPEND_EARLY [ IF_FILE_EXISTS ] filename state list END\n```\nWorks like APPEND, but the states are added early on in the compilation timeline (just after BEGIN is processed). Thus they can be the targets for INTERJECT_COPY_TRANS and friends."
29
+ "value": "```weidu-d-tooltip\nADD_TRANS_TRIGGER filename stateNumber transTriggerString [ moreStateNumbers list ] [ DO transNumber list ] dActionWhen list\n```\nThis instructs WeiDU to add the transTriggerString to all of the transitions in all of the states with the given stateNumbers in the file filename.DLG (which must already exist). This is often used in conjunction with EXTEND_BOTTOM to make a new branch in an existing state. Use ADD_TRANS_TRIGGER to add the negation of some predicate to all of the existing transitions, then use EXTEND_BOTTOM to add a transition with that predicate to that state. If a list of transNumbers is specified, only those transitions will have transTriggerString added to them. If such a list is not specified, every transition in every specified state will be modified. Note that the \"first\" transition is number 0."
72
30
  }
73
31
  },
74
32
  {
75
- "label": "CHAIN",
33
+ "label": "ALTER_TRANS",
76
34
  "kind": 3,
77
35
  "source": "builtin",
78
36
  "category": "actions",
79
37
  "documentation": {
80
38
  "kind": "markdown",
81
- "value": "```weidu-d-tooltip\nCHAIN\n [ IF [ WEIGHT #weight ] stateTriggerString THEN ]\n [ IF_FILE_EXISTS ] entryFilename entryLabel\n chainText list\n chainEpilogue\n```\nThis instructs WeiDU to make a long conversation in which the PC can say nothing. This is useful when you want the NPCs to talk among themselves for a long time. It and its friends, INTERJECT and INTERJECT_COPY_TRANS can incredible time-savers when you're writing non-trivial dialogue. See the examples for ideas. CHAIN will only append to existing dialogues. You cannot use CHAIN to create a new DLG. If the entryFilename file is missing and there is IF_FILE_EXISTS, the whole CHAIN is not compiled."
39
+ "value": "```weidu-d-tooltip\nALTER_TRANS filename BEGIN stateNumber list END BEGIN transNumber list END BEGIN changeWhat changeInto list END\n```\nFine altering of a single transition. See the ALTER_TRANS tutorial."
82
40
  }
83
41
  },
84
42
  {
85
- "label": "INTERJECT",
43
+ "label": "APPEND",
86
44
  "kind": 3,
87
45
  "source": "builtin",
88
46
  "category": "actions",
89
47
  "documentation": {
90
48
  "kind": "markdown",
91
- "value": "```weidu-d-tooltip\nINTERJECT entryFilename entryLabel globalVariable chainText list chainEpilogue\n```\nBehaves like CHAIN except that all of the chainText is additionally guarded by the transition predicate Global(\"globalVariable\",\"GLOBAL\",0) and accompanied by the action SetGlobal(\"globalVariable\",\"GLOBAL\",1). If you pick globalVariable to be unique, this will ensure that the chainText is only ever seen once per game. This is useful for making interjections."
49
+ "value": "```weidu-d-tooltip\nAPPEND [ IF_FILE_EXISTS ] filename state list END\n```\nThis tells WeiDU to place the given states at the end of the already-existing dialogue filename.DLG. If there is IF_FILE_EXISTS and the file doesn't exists, this action is skipped."
92
50
  }
93
51
  },
94
52
  {
95
- "label": "INTERJECT_COPY_TRANS",
53
+ "label": "APPEND_EARLY",
96
54
  "kind": 3,
97
55
  "source": "builtin",
98
56
  "category": "actions",
99
57
  "documentation": {
100
58
  "kind": "markdown",
101
- "value": "```weidu-d-tooltip\nINTERJECT_COPY_TRANS [ SAFE ] entryFilename entryLabel globalVariable chainText list\n```\nThis behaves just like INTERJECT except that the exitFilename and exitLabel are not present. Instead, whenever the dialogue would pass out of the chainText it follows a copy of the transitions that were at the state with stateLabel originally. This is convenient for making quick interjections from NPCs that do not actually change the true flow of the conversation. See the transition COPY_TRANS and the INTERJECT_COPY_TRANS tutorial for more information about this idea. If SAFE is specified, INTERJECT_COPY_TRANS will not warn about potentially unsafe uses (use this if you know it is safe)."
59
+ "value": "```weidu-d-tooltip\nAPPEND_EARLY [ IF_FILE_EXISTS ] filename state list END\n```\nWorks like APPEND, but the states are added early on in the compilation timeline (just after BEGIN is processed). Thus they can be the targets for INTERJECT_COPY_TRANS and friends."
102
60
  }
103
61
  },
104
62
  {
105
- "label": "INTERJECT_COPY_TRANS2",
63
+ "label": "BEGIN",
106
64
  "kind": 3,
107
65
  "source": "builtin",
108
66
  "category": "actions",
109
67
  "documentation": {
110
68
  "kind": "markdown",
111
- "value": "```weidu-d-tooltip\nINTERJECT_COPY_TRANS2 [ SAFE ] entryFilename entryLabel globalVariable chainText list\n```\nThis works just like INTERJECT_COPY_TRANS, except that any actions taken in the transitions of the state specified by entryFilename and entryLabel are preserved and kept with the speaker associated with entryFilename (rather than being mistakenly performed by your new speaker). See the INTERJECT_COPY_TRANS2 tutorial."
69
+ "value": "```weidu-d-tooltip\nBEGIN filename [ nonPausing ] state list\n```\nBEGIN tells WeiDU that you are creating a new DLG file from scratch. Any existing DLG file with the same name will be overwritten. The new DLG file contains exactly the states in the list. If you set nonPausing to a non-zero integer, the game will not \"stop time\" while the conversation takes place. By default time stops during conversations."
112
70
  }
113
71
  },
114
72
  {
115
- "label": "INTERJECT_COPY_TRANS3",
73
+ "label": "CHAIN",
116
74
  "kind": 3,
117
75
  "source": "builtin",
118
76
  "category": "actions",
119
77
  "documentation": {
120
78
  "kind": "markdown",
121
- "value": "```weidu-d-tooltip\nINTERJECT_COPY_TRANS3 [ SAFE ] entryFilename entryLabel globalVariable chainText list\n```\nThis works just like INTERJECT_COPY_TRANS, except that all states in chainText get a link in the entry state, rather than only the first one. Expecting documentation."
79
+ "value": "```weidu-d-tooltip\nCHAIN\n [ IF [ WEIGHT #weight ] stateTriggerString THEN ]\n [ IF_FILE_EXISTS ] entryFilename entryLabel\n chainText list\n chainEpilogue\n```\nThis instructs WeiDU to make a long conversation in which the PC can say nothing. This is useful when you want the NPCs to talk among themselves for a long time. It and its friends, INTERJECT and INTERJECT_COPY_TRANS can incredible time-savers when you're writing non-trivial dialogue. See the examples for ideas. CHAIN will only append to existing dialogues. You cannot use CHAIN to create a new DLG. If the entryFilename file is missing and there is IF_FILE_EXISTS, the whole CHAIN is not compiled."
122
80
  }
123
81
  },
124
82
  {
125
- "label": "INTERJECT_COPY_TRANS4",
83
+ "label": "EXTEND_BOTTOM",
126
84
  "kind": 3,
127
85
  "source": "builtin",
128
86
  "category": "actions",
129
87
  "documentation": {
130
88
  "kind": "markdown",
131
- "value": "```weidu-d-tooltip\nINTERJECT_COPY_TRANS4 [ SAFE ] entryFilename entryLabel globalVariable chainText list\n```\nThis is either INTERJECT_COPY_TRANS3 with INTERJECT_COPY_TRANS2-style action handling, or INTERJECT_COPY_TRANS2 with the extended INTERJECT_COPY_TRANS3 state creation rules, depending at how you look at it."
89
+ "value": "```weidu-d-tooltip\nEXTEND_BOTTOM filename stateNumber list [ #positionNumber ] transition list END\n```\nBehaves just like EXTEND_TOP but adds the transitions to the bottom of the list instead."
132
90
  }
133
91
  },
134
92
  {
@@ -142,163 +100,163 @@
142
100
  }
143
101
  },
144
102
  {
145
- "label": "EXTEND_BOTTOM",
103
+ "label": "INTERJECT",
146
104
  "kind": 3,
147
105
  "source": "builtin",
148
106
  "category": "actions",
149
107
  "documentation": {
150
108
  "kind": "markdown",
151
- "value": "```weidu-d-tooltip\nEXTEND_BOTTOM filename stateNumber list [ #positionNumber ] transition list END\n```\nBehaves just like EXTEND_TOP but adds the transitions to the bottom of the list instead."
109
+ "value": "```weidu-d-tooltip\nINTERJECT entryFilename entryLabel globalVariable chainText list chainEpilogue\n```\nBehaves like CHAIN except that all of the chainText is additionally guarded by the transition predicate Global(\"globalVariable\",\"GLOBAL\",0) and accompanied by the action SetGlobal(\"globalVariable\",\"GLOBAL\",1). If you pick globalVariable to be unique, this will ensure that the chainText is only ever seen once per game. This is useful for making interjections."
152
110
  }
153
111
  },
154
112
  {
155
- "label": "ADD_STATE_TRIGGER",
113
+ "label": "INTERJECT_COPY_TRANS",
156
114
  "kind": 3,
157
115
  "source": "builtin",
158
116
  "category": "actions",
159
117
  "documentation": {
160
118
  "kind": "markdown",
161
- "value": "```weidu-d-tooltip\nADD_STATE_TRIGGER filename stateNumber stateTriggerString [ stateNumber list ] \tdActionWhen list\n```\nThis instructs WeiDU to add the stateTriggerString to all of the states with the given stateNumbers in the file filename.DLG (which must already exist). This is handy for adding extra conditions to an existing dialogue state."
119
+ "value": "```weidu-d-tooltip\nINTERJECT_COPY_TRANS [ SAFE ] entryFilename entryLabel globalVariable chainText list\n```\nThis behaves just like INTERJECT except that the exitFilename and exitLabel are not present. Instead, whenever the dialogue would pass out of the chainText it follows a copy of the transitions that were at the state with stateLabel originally. This is convenient for making quick interjections from NPCs that do not actually change the true flow of the conversation. See the transition COPY_TRANS and the INTERJECT_COPY_TRANS tutorial for more information about this idea. If SAFE is specified, INTERJECT_COPY_TRANS will not warn about potentially unsafe uses (use this if you know it is safe)."
162
120
  }
163
121
  },
164
122
  {
165
- "label": "ADD_TRANS_TRIGGER",
123
+ "label": "INTERJECT_COPY_TRANS2",
166
124
  "kind": 3,
167
125
  "source": "builtin",
168
126
  "category": "actions",
169
127
  "documentation": {
170
128
  "kind": "markdown",
171
- "value": "```weidu-d-tooltip\nADD_TRANS_TRIGGER filename stateNumber transTriggerString [ moreStateNumbers list ] [ DO transNumber list ] dActionWhen list\n```\nThis instructs WeiDU to add the transTriggerString to all of the transitions in all of the states with the given stateNumbers in the file filename.DLG (which must already exist). This is often used in conjunction with EXTEND_BOTTOM to make a new branch in an existing state. Use ADD_TRANS_TRIGGER to add the negation of some predicate to all of the existing transitions, then use EXTEND_BOTTOM to add a transition with that predicate to that state. If a list of transNumbers is specified, only those transitions will have transTriggerString added to them. If such a list is not specified, every transition in every specified state will be modified. Note that the \"first\" transition is number 0."
129
+ "value": "```weidu-d-tooltip\nINTERJECT_COPY_TRANS2 [ SAFE ] entryFilename entryLabel globalVariable chainText list\n```\nThis works just like INTERJECT_COPY_TRANS, except that any actions taken in the transitions of the state specified by entryFilename and entryLabel are preserved and kept with the speaker associated with entryFilename (rather than being mistakenly performed by your new speaker). See the INTERJECT_COPY_TRANS2 tutorial."
172
130
  }
173
131
  },
174
132
  {
175
- "label": "ADD_TRANS_ACTION",
133
+ "label": "INTERJECT_COPY_TRANS3",
176
134
  "kind": 3,
177
135
  "source": "builtin",
178
136
  "category": "actions",
179
137
  "documentation": {
180
138
  "kind": "markdown",
181
- "value": "```weidu-d-tooltip\nADD_TRANS_ACTION filename BEGIN stateNumber list END BEGIN transNumber list END transActionString dActionWhen list\n```\nThis instructs WeiDU to add the transActionString to all of the actions in all the transitions in all of the states specified by the stateNumber list and the transNumber list. You may use state labels in the stateNumber list. If the transNumber list is empty, the text added to all transitions on all listed states. Note that the BEGIN and END keywords must be present, even if you specify an empty list of transNumbers. The \"first\" transition is number 0. Any out-of-bounds transNumbers are silently ignored. The transActionString is prepended to any existing action text on a per-transition, per-state basis."
139
+ "value": "```weidu-d-tooltip\nINTERJECT_COPY_TRANS3 [ SAFE ] entryFilename entryLabel globalVariable chainText list\n```\nThis works just like INTERJECT_COPY_TRANS, except that all states in chainText get a link in the entry state, rather than only the first one. Expecting documentation."
182
140
  }
183
141
  },
184
142
  {
185
- "label": "REPLACE_TRANS_ACTION",
143
+ "label": "INTERJECT_COPY_TRANS4",
186
144
  "kind": 3,
187
145
  "source": "builtin",
188
146
  "category": "actions",
189
147
  "documentation": {
190
148
  "kind": "markdown",
191
- "value": "```weidu-d-tooltip\nREPLACE_TRANS_ACTION filename BEGIN stateNumber list END BEGIN transNumber list END oldText newText dActionWhen list\n```\nThis instructs WeiDU to replace all instances of oldText in newText to all of the actions in all the transitions in all of the states specified by the stateNumber list and the transNumber list. You may use state labels in the stateNumber list. If the transNumber list is empty, the text added to all transitions on all listed states. Note that the BEGIN and END keywords must be present, even if you specify an empty list of transNumbers. The \"first\" transition is number 0. Any out-of-bounds transNumbers are silently ignored."
149
+ "value": "```weidu-d-tooltip\nINTERJECT_COPY_TRANS4 [ SAFE ] entryFilename entryLabel globalVariable chainText list\n```\nThis is either INTERJECT_COPY_TRANS3 with INTERJECT_COPY_TRANS2-style action handling, or INTERJECT_COPY_TRANS2 with the extended INTERJECT_COPY_TRANS3 state creation rules, depending at how you look at it."
192
150
  }
193
151
  },
194
152
  {
195
- "label": "REPLACE_TRANS_TRIGGER",
153
+ "label": "REPLACE",
196
154
  "kind": 3,
197
155
  "source": "builtin",
198
156
  "category": "actions",
199
157
  "documentation": {
200
158
  "kind": "markdown",
201
- "value": "```weidu-d-tooltip\nREPLACE_TRANS_TRIGGER filename BEGIN stateNumber list END BEGIN transNumber list END oldText newText dActionWhen list\n```\nThis instructs WeiDU to replace all instances of oldText in newText to all of the triggers in all of the transitions in all of the states specified by the stateNumber list and the transNumber list. You may use state labels in the stateNumber list. If the transNumber list is empty, the text added to all transitions on all listed states. Note that the BEGIN and END keywords must be present, even if you specify an empty list of transNumbers. The \"first\" transition is number 0. Any out-of-bounds transNumbers are silently ignored."
159
+ "value": "```weidu-d-tooltip\nREPLACE filename state list END\n```\nThis instructs WeiDU to load filename.DLG and replace some of its states with the new ones described in the state list. All of the states should have numeric stateLabels (e.g., \"5\" or \"67\"). A new state with label X will replace the old state number X."
202
160
  }
203
161
  },
204
162
  {
205
- "label": "ALTER_TRANS",
163
+ "label": "REPLACE_ACTION_TEXT",
206
164
  "kind": 3,
207
165
  "source": "builtin",
208
166
  "category": "actions",
209
167
  "documentation": {
210
168
  "kind": "markdown",
211
- "value": "```weidu-d-tooltip\nALTER_TRANS filename BEGIN stateNumber list END BEGIN transNumber list END BEGIN changeWhat changeInto list END\n```\nFine altering of a single transition. See the ALTER_TRANS tutorial."
169
+ "value": "```weidu-d-tooltip\nREPLACE_ACTION_TEXT filename oldText newText [ moreFilenames ] dActionWhen list\n```\nThis instructs WeiDU to destructively replace every occurrence of oldText (which may be a regexp) in the stateActionStrings of filename.DLG (which must exist). This should only be used to patch or workaround existing dialogues. Never use this if you can help it."
212
170
  }
213
171
  },
214
172
  {
215
- "label": "REPLACE",
173
+ "label": "REPLACE_ACTION_TEXT_PROCESS",
216
174
  "kind": 3,
217
175
  "source": "builtin",
218
176
  "category": "actions",
219
177
  "documentation": {
220
178
  "kind": "markdown",
221
- "value": "```weidu-d-tooltip\nREPLACE filename state list END\n```\nThis instructs WeiDU to load filename.DLG and replace some of its states with the new ones described in the state list. All of the states should have numeric stateLabels (e.g., \"5\" or \"67\"). A new state with label X will replace the old state number X."
179
+ "value": "```weidu-d-tooltip\nREPLACE_ACTION_TEXT_PROCESS filename oldText newText [ moreFilenames ] dActionWhen list\n```\nThis instructs WeiDU to destructively replace every occurrence of oldText (which may be a regexp) in the stateActionStrings of filename.DLG (which must exist) with newText. However, newText is first compiled as a BAF action list. In particular, this means that replacing with commands like: ~DisplayString(Myself,@123)~ ... will do what you expect. This should only be used to patch or workaround existing dialogues. Never use this if you can help it."
222
180
  }
223
181
  },
224
182
  {
225
- "label": "SET_WEIGHT",
183
+ "label": "REPLACE_ACTION_TEXT_PROCESS_REGEXP",
226
184
  "kind": 3,
227
185
  "source": "builtin",
228
186
  "category": "actions",
229
187
  "documentation": {
230
188
  "kind": "markdown",
231
- "value": "```weidu-d-tooltip\nSET_WEIGHT filename stateLabel #stateWeight\n```\nThis instructs WeiDU to destructively change the WEIGHT of the given state in filename.DLG (which must exist). This should only be used to patch or workaround existing dialogues. Never use SET_WEIGHT if you can help it."
189
+ "value": "```weidu-d-tooltip\nREPLACE_ACTION_TEXT_PROCESS_REGEXP filenameRegexp oldText newText [ moreFilenameRegexps ] dActionWhen list\n```\nJust like REPLACE_ACTION_TEXT_PROCESS, but the filenames are regexps. The .DLG is implied. R_A_T_P_R is shorthand for REPLACE_ACTION_TEXT_PROCESS_REGEXP."
232
190
  }
233
191
  },
234
192
  {
235
- "label": "REPLACE_SAY",
193
+ "label": "REPLACE_ACTION_TEXT_REGEXP",
236
194
  "kind": 3,
237
195
  "source": "builtin",
238
196
  "category": "actions",
239
197
  "documentation": {
240
198
  "kind": "markdown",
241
- "value": "```weidu-d-tooltip\nREPLACE_SAY filename stateLabel sayText\n```\nThis instructs WeiDU to destructively change the sayText of the given state in filename.DLG (which must exist). This should only be used to patch or workaround existing dialogues. Never use REPLACE_SAY if you can help it."
199
+ "value": "```weidu-d-tooltip\nREPLACE_ACTION_TEXT_REGEXP filenameRegexp oldText newText [ moreFilenameRegexps ] dActionWhen list\n```\nJust like REPLACE_ACTION_TEXT but the filenames are regexps. The .DLG is implied, do not include it in your regexps."
242
200
  }
243
201
  },
244
202
  {
245
- "label": "REPLACE_STATE_TRIGGER",
203
+ "label": "REPLACE_SAY",
246
204
  "kind": 3,
247
205
  "source": "builtin",
248
206
  "category": "actions",
249
207
  "documentation": {
250
208
  "kind": "markdown",
251
- "value": "```weidu-d-tooltip\nREPLACE_STATE_TRIGGER filename stateNumber stateTriggerString [ stateNumber list ] \tdActionWhen list\n```\nThis instructs WeiDU to destructively set the stateTriggerString of all of the states with the given stateNumbers in the file filename.DLG (which must already exist). It should be used with caution."
209
+ "value": "```weidu-d-tooltip\nREPLACE_SAY filename stateLabel sayText\n```\nThis instructs WeiDU to destructively change the sayText of the given state in filename.DLG (which must exist). This should only be used to patch or workaround existing dialogues. Never use REPLACE_SAY if you can help it."
252
210
  }
253
211
  },
254
212
  {
255
- "label": "REPLACE_TRIGGER_TEXT",
213
+ "label": "REPLACE_STATE_TRIGGER",
256
214
  "kind": 3,
257
215
  "source": "builtin",
258
216
  "category": "actions",
259
217
  "documentation": {
260
218
  "kind": "markdown",
261
- "value": "```weidu-d-tooltip\nREPLACE_TRIGGER_TEXT filename oldText newText dActionWhen list\n```\nThis instructs WeiDU to destructively replace every occurrence of oldText (which may be a regexp) in the stateTriggerStrings and transTriggerStrings of filename.DLG (which must exist). This should only be used to patch or workaround existing dialogues. Never use this if you can help it."
219
+ "value": "```weidu-d-tooltip\nREPLACE_STATE_TRIGGER filename stateNumber stateTriggerString [ stateNumber list ] \tdActionWhen list\n```\nThis instructs WeiDU to destructively set the stateTriggerString of all of the states with the given stateNumbers in the file filename.DLG (which must already exist). It should be used with caution."
262
220
  }
263
221
  },
264
222
  {
265
- "label": "REPLACE_TRIGGER_TEXT_REGEXP",
223
+ "label": "REPLACE_TRANS_ACTION",
266
224
  "kind": 3,
267
225
  "source": "builtin",
268
226
  "category": "actions",
269
227
  "documentation": {
270
228
  "kind": "markdown",
271
- "value": "```weidu-d-tooltip\nREPLACE_TRIGGER_TEXT_REGEXP filenameRegexp oldText newText dActionWhen list\n```\nJust like REPLACE_TRIGGER_TEXT but the filename is a regexp. The .DLG is implied."
229
+ "value": "```weidu-d-tooltip\nREPLACE_TRANS_ACTION filename BEGIN stateNumber list END BEGIN transNumber list END oldText newText dActionWhen list\n```\nThis instructs WeiDU to replace all instances of oldText in newText to all of the actions in all the transitions in all of the states specified by the stateNumber list and the transNumber list. You may use state labels in the stateNumber list. If the transNumber list is empty, the text added to all transitions on all listed states. Note that the BEGIN and END keywords must be present, even if you specify an empty list of transNumbers. The \"first\" transition is number 0. Any out-of-bounds transNumbers are silently ignored."
272
230
  }
273
231
  },
274
232
  {
275
- "label": "REPLACE_ACTION_TEXT",
233
+ "label": "REPLACE_TRANS_TRIGGER",
276
234
  "kind": 3,
277
235
  "source": "builtin",
278
236
  "category": "actions",
279
237
  "documentation": {
280
238
  "kind": "markdown",
281
- "value": "```weidu-d-tooltip\nREPLACE_ACTION_TEXT filename oldText newText [ moreFilenames ] dActionWhen list\n```\nThis instructs WeiDU to destructively replace every occurrence of oldText (which may be a regexp) in the stateActionStrings of filename.DLG (which must exist). This should only be used to patch or workaround existing dialogues. Never use this if you can help it."
239
+ "value": "```weidu-d-tooltip\nREPLACE_TRANS_TRIGGER filename BEGIN stateNumber list END BEGIN transNumber list END oldText newText dActionWhen list\n```\nThis instructs WeiDU to replace all instances of oldText in newText to all of the triggers in all of the transitions in all of the states specified by the stateNumber list and the transNumber list. You may use state labels in the stateNumber list. If the transNumber list is empty, the text added to all transitions on all listed states. Note that the BEGIN and END keywords must be present, even if you specify an empty list of transNumbers. The \"first\" transition is number 0. Any out-of-bounds transNumbers are silently ignored."
282
240
  }
283
241
  },
284
242
  {
285
- "label": "REPLACE_ACTION_TEXT_REGEXP",
243
+ "label": "REPLACE_TRIGGER_TEXT",
286
244
  "kind": 3,
287
245
  "source": "builtin",
288
246
  "category": "actions",
289
247
  "documentation": {
290
248
  "kind": "markdown",
291
- "value": "```weidu-d-tooltip\nREPLACE_ACTION_TEXT_REGEXP filenameRegexp oldText newText [ moreFilenameRegexps ] dActionWhen list\n```\nJust like REPLACE_ACTION_TEXT but the filenames are regexps. The .DLG is implied, do not include it in your regexps."
249
+ "value": "```weidu-d-tooltip\nREPLACE_TRIGGER_TEXT filename oldText newText dActionWhen list\n```\nThis instructs WeiDU to destructively replace every occurrence of oldText (which may be a regexp) in the stateTriggerStrings and transTriggerStrings of filename.DLG (which must exist). This should only be used to patch or workaround existing dialogues. Never use this if you can help it."
292
250
  }
293
251
  },
294
252
  {
295
- "label": "REPLACE_ACTION_TEXT_PROCESS",
253
+ "label": "REPLACE_TRIGGER_TEXT_REGEXP",
296
254
  "kind": 3,
297
255
  "source": "builtin",
298
256
  "category": "actions",
299
257
  "documentation": {
300
258
  "kind": "markdown",
301
- "value": "```weidu-d-tooltip\nREPLACE_ACTION_TEXT_PROCESS filename oldText newText [ moreFilenames ] dActionWhen list\n```\nThis instructs WeiDU to destructively replace every occurrence of oldText (which may be a regexp) in the stateActionStrings of filename.DLG (which must exist) with newText. However, newText is first compiled as a BAF action list. In particular, this means that replacing with commands like: ~DisplayString(Myself,@123)~ ... will do what you expect. This should only be used to patch or workaround existing dialogues. Never use this if you can help it."
259
+ "value": "```weidu-d-tooltip\nREPLACE_TRIGGER_TEXT_REGEXP filenameRegexp oldText newText dActionWhen list\n```\nJust like REPLACE_TRIGGER_TEXT but the filename is a regexp. The .DLG is implied."
302
260
  }
303
261
  },
304
262
  {
@@ -312,26 +270,15 @@
312
270
  }
313
271
  },
314
272
  {
315
- "label": "UNLESS",
316
- "kind": 14,
273
+ "label": "SET_WEIGHT",
274
+ "kind": 3,
317
275
  "source": "builtin",
318
- "category": "when",
276
+ "category": "actions",
319
277
  "documentation": {
320
278
  "kind": "markdown",
321
- "value": "```weidu-d-tooltip\nUNLESS String\n```\nThe action is not processed if the element being altered/replaced/added to contains a substring matching against the String regexp."
279
+ "value": "```weidu-d-tooltip\nSET_WEIGHT filename stateLabel #stateWeight\n```\nThis instructs WeiDU to destructively change the WEIGHT of the given state in filename.DLG (which must exist). This should only be used to patch or workaround existing dialogues. Never use SET_WEIGHT if you can help it."
322
280
  }
323
281
  },
324
- {
325
- "label": "EXTERN",
326
- "kind": 14,
327
- "source": "builtin",
328
- "category": "chain_epilogue",
329
- "documentation": {
330
- "kind": "markdown",
331
- "value": "```weidu-d-tooltip\nEXTERN filename stateNumber\n```\nTransfer to the given state in the given dialogue file."
332
- },
333
- "detail": "EXTERN filename stateNumber"
334
- },
335
282
  {
336
283
  "label": "COPY_TRANS",
337
284
  "kind": 14,
@@ -355,35 +302,95 @@
355
302
  "detail": "COPY_TRANS_LATE [ SAFE ] filename stateNumber"
356
303
  },
357
304
  {
358
- "label": "EXIT",
305
+ "label": "BRANCH",
359
306
  "kind": 14,
360
307
  "source": "builtin",
361
- "category": "chain_epilogue",
308
+ "category": "keywords",
362
309
  "documentation": {
363
310
  "kind": "markdown",
364
- "value": "```weidu-d-tooltip\nEXIT\n```\nAt the end of the CHAIN text, exit the dialogue."
365
- },
366
- "detail": "EXIT"
311
+ "value": "```weidu-d-tooltip\nBRANCH transTriggerString BEGIN chain_speaker list END\n```\nLike chain text, except that the first transTriggerString is appended to all existing dialogue units."
312
+ }
367
313
  },
368
314
  {
369
- "label": "APPENDI",
315
+ "label": "END",
370
316
  "kind": 14,
371
317
  "source": "builtin",
372
- "category": "state",
318
+ "category": "keywords",
373
319
  "documentation": {
374
320
  "kind": "markdown",
375
- "value": "```weidu-d-tooltip\nAPPENDI filename state list END\n```\nThis is legacy syntax that behaves just like the D Action APPEND but is considered a state. Avoid it."
321
+ "value": "```weidu-d-tooltip\nEND\n```\nBlock terminator for APPEND, EXTEND_TOP, EXTEND_BOTTOM, state, ALTER_TRANS, and other constructs.\n\n---\nChain epilogue: `END transition list` execute the given transitions after the final state in the CHAIN."
376
322
  }
377
323
  },
378
324
  {
379
- "label": "CHAIN2",
325
+ "label": "GLOBAL",
380
326
  "kind": 14,
381
327
  "source": "builtin",
382
- "category": "state",
328
+ "category": "keywords"
329
+ },
330
+ {
331
+ "label": "IF_FILE_EXISTS",
332
+ "kind": 14,
333
+ "source": "builtin",
334
+ "category": "keywords"
335
+ },
336
+ {
337
+ "label": "LOCALS",
338
+ "kind": 14,
339
+ "source": "builtin",
340
+ "category": "keywords"
341
+ },
342
+ {
343
+ "label": "MYAREA",
344
+ "kind": 14,
345
+ "source": "builtin",
346
+ "category": "keywords"
347
+ },
348
+ {
349
+ "label": "OR",
350
+ "kind": 14,
351
+ "source": "builtin",
352
+ "category": "keywords"
353
+ },
354
+ {
355
+ "label": "RESPONSE",
356
+ "kind": 14,
357
+ "source": "builtin",
358
+ "category": "keywords"
359
+ },
360
+ {
361
+ "label": "SAFE",
362
+ "kind": 14,
363
+ "source": "builtin",
364
+ "category": "keywords"
365
+ },
366
+ {
367
+ "label": "THEN",
368
+ "kind": 14,
369
+ "source": "builtin",
370
+ "category": "keywords"
371
+ },
372
+ {
373
+ "label": "WEIGHT",
374
+ "kind": 14,
375
+ "source": "builtin",
376
+ "category": "keywords"
377
+ },
378
+ {
379
+ "label": "nonPausing",
380
+ "kind": 14,
381
+ "source": "builtin",
382
+ "category": "keywords"
383
+ },
384
+ {
385
+ "label": "IF",
386
+ "kind": 14,
387
+ "source": "builtin",
388
+ "category": "multi",
383
389
  "documentation": {
384
390
  "kind": "markdown",
385
- "value": "```weidu-d-tooltip\nCHAIN2 entryFilename entryLabel chain2Text list exitFilename exitLabel\n```\nThis is legacy syntax that behaves somewhat like the D Action CHAIN but is considered a state. In addition, chain2Text is slightly different from chainText. Avoid this construction."
386
- }
391
+ "value": "```weidu-d-tooltip\nIF\n```\nTransition: `IF transTriggerString [ THEN ] transFeature list transNext`\n\nIf the transTriggerString evaluates to true or is empty, this transition is viable. If it contains no replyText within its transFeature list, it is immediately taken. Otherwise, the replyText is presented as an option to the user. If the transition is taken, any actions in the transFeature list are performed and the dialogue flows to the point indicated by the transNext. transitions are evaluated in \"reverse order\".\n\n---\nAction condition: `IF String`.\n\nThe action is processed if the element being altered/replaced/added to contains a substring matching against the String regexp.\n\n---\nState: `IF [ WEIGHT #weightNumber ] stateTriggerString [ THEN ] [ BEGIN ] stateLabel SAY sayText [ = sayText ... ] transition list END`\n\n[Online documentation](https://weidu.org/~thebigg/README-WeiDU.html#state)"
392
+ },
393
+ "detail": "IF"
387
394
  },
388
395
  {
389
396
  "label": "text",
@@ -396,45 +403,43 @@
396
403
  }
397
404
  },
398
405
  {
399
- "label": "+",
406
+ "label": "APPENDI",
400
407
  "kind": 14,
401
408
  "source": "builtin",
402
- "category": "transition",
409
+ "category": "state",
403
410
  "documentation": {
404
411
  "kind": "markdown",
405
- "value": "```weidu-d-tooltip\n+ [ transTriggerString ] + replyText transFeature list transNext\n```\nThis abbreviated syntax for transitions that would contain REPLY (which is by far the most common case) allows you to save yourself some time and typing. It behaves like the full form above."
412
+ "value": "```weidu-d-tooltip\nAPPENDI filename state list END\n```\nThis is legacy syntax that behaves just like the D Action APPEND but is considered a state. Avoid it."
406
413
  }
407
414
  },
408
415
  {
409
- "label": "COPY_TRANS",
416
+ "label": "CHAIN2",
410
417
  "kind": 14,
411
418
  "source": "builtin",
412
- "category": "transition",
419
+ "category": "state",
413
420
  "documentation": {
414
421
  "kind": "markdown",
415
- "value": "```weidu-d-tooltip\nCOPY_TRANS [ SAFE ] filename stateLabel\n```\nThis instructs WeiDU to copy all of the transitions from the state with the given stateLabel in filename.DLG. This copying takes place before all other D Actions. For example, this is a valid transition list: IF ~Before()~ THEN GOTO my_state COPY_TRANS PLAYER1 33 IF ~After()~ THEN EXTERN SOLA 55 If SAFE is specified, COPY_TRANS will not warn about potentially unsafe uses (use this if you know it is safe)."
416
- },
417
- "detail": "COPY_TRANS [ SAFE ] filename stateLabel"
422
+ "value": "```weidu-d-tooltip\nCHAIN2 entryFilename entryLabel chain2Text list exitFilename exitLabel\n```\nThis is legacy syntax that behaves somewhat like the D Action CHAIN but is considered a state. In addition, chain2Text is slightly different from chainText. Avoid this construction."
423
+ }
418
424
  },
419
425
  {
420
- "label": "COPY_TRANS_LATE",
426
+ "label": "SAY",
421
427
  "kind": 14,
422
428
  "source": "builtin",
423
- "category": "transition",
429
+ "category": "state",
424
430
  "documentation": {
425
431
  "kind": "markdown",
426
- "value": "```weidu-d-tooltip\nCOPY_TRANS_LATE [ SAFE ] filename stateLabel\n```\nSame as COPY_TRANS, but is invoked after all other D Actions."
427
- },
428
- "detail": "COPY_TRANS_LATE [ SAFE ] filename stateLabel"
432
+ "value": "```weidu-d-tooltip\nSAY sayText [ = sayText ... ]\n```\nThe creature then says all of the associated sayText."
433
+ }
429
434
  },
430
435
  {
431
- "label": "REPLY",
436
+ "label": "^",
432
437
  "kind": 14,
433
438
  "source": "builtin",
434
- "category": "trans_feature",
439
+ "category": "string",
435
440
  "documentation": {
436
441
  "kind": "markdown",
437
- "value": "```weidu-d-tooltip\nREPLY replyText\n```\nIf this transition is taken, the PC says the replyText."
442
+ "value": "```weidu-d-tooltip\nString ^ String\n```\nString literal concatenation. The second string is appended to the first string. No whitespace is added. Thus \"hello\" ^ \"World\" is the same as \"helloWorld\"."
438
443
  }
439
444
  },
440
445
  {
@@ -447,6 +452,16 @@
447
452
  "value": "```weidu-d-tooltip\nDO stateActionString\n```\nIf this transition is taken, the stateActionString is executed."
448
453
  }
449
454
  },
455
+ {
456
+ "label": "FLAGS",
457
+ "kind": 14,
458
+ "source": "builtin",
459
+ "category": "trans_feature",
460
+ "documentation": {
461
+ "kind": "markdown",
462
+ "value": "```weidu-d-tooltip\nFLAGS integer\n```\nThis allows you to set the features associated with a transition directly using the binary format of DLG files."
463
+ }
464
+ },
450
465
  {
451
466
  "label": "JOURNAL",
452
467
  "kind": 14,
@@ -457,6 +472,16 @@
457
472
  "value": "```weidu-d-tooltip\nJOURNAL text\n```\nIf this transition is taken, the text is added to the PC's journal."
458
473
  }
459
474
  },
475
+ {
476
+ "label": "REPLY",
477
+ "kind": 14,
478
+ "source": "builtin",
479
+ "category": "trans_feature",
480
+ "documentation": {
481
+ "kind": "markdown",
482
+ "value": "```weidu-d-tooltip\nREPLY replyText\n```\nIf this transition is taken, the PC says the replyText."
483
+ }
484
+ },
460
485
  {
461
486
  "label": "SOLVED_JOURNAL",
462
487
  "kind": 14,
@@ -478,65 +503,86 @@
478
503
  }
479
504
  },
480
505
  {
481
- "label": "FLAGS",
506
+ "label": "EXIT",
482
507
  "kind": 14,
483
508
  "source": "builtin",
484
- "category": "trans_feature",
509
+ "category": "trans_next",
485
510
  "documentation": {
486
511
  "kind": "markdown",
487
- "value": "```weidu-d-tooltip\nFLAGS integer\n```\nThis allows you to set the features associated with a transition directly using the binary format of DLG files."
512
+ "value": "```weidu-d-tooltip\nEXIT\n```\nThe conversation ends.\n\n---\nChain epilogue: at the end of the CHAIN text, exit the dialogue."
513
+ }
514
+ },
515
+ {
516
+ "label": "EXTERN",
517
+ "kind": 14,
518
+ "source": "builtin",
519
+ "category": "trans_next",
520
+ "documentation": {
521
+ "kind": "markdown",
522
+ "value": "```weidu-d-tooltip\nEXTERN [ IF_FILE_EXISTS ] filename stateLabel\n```\nThe dialogue continues at the state with label stateLabel in the file filename.DLG. The whole transition is not compiled if there's IF_FILE_EXISTS and the file filename doesn't exist.\n\n---\nChain epilogue: `EXTERN filename stateNumber` — transfer to the given state in the given dialogue file."
488
523
  }
489
524
  },
490
525
  {
491
526
  "label": "GOTO",
492
527
  "kind": 14,
493
528
  "source": "builtin",
494
- "category": "tran_next",
529
+ "category": "trans_next",
495
530
  "documentation": {
496
531
  "kind": "markdown",
497
532
  "value": "```weidu-d-tooltip\nGOTO stateLabel\n```\nThe dialogue continues at the state with label stateLabel in the same DLG file as the current state."
498
533
  }
499
534
  },
500
535
  {
501
- "label": "EXTERN",
536
+ "label": "+",
537
+ "kind": 14,
538
+ "source": "builtin",
539
+ "category": "transition",
540
+ "documentation": {
541
+ "kind": "markdown",
542
+ "value": "```weidu-d-tooltip\n+ [ transTriggerString ] + replyText transFeature list transNext\n```\nThis abbreviated syntax for transitions that would contain REPLY (which is by far the most common case) allows you to save yourself some time and typing. It behaves like the full form above."
543
+ }
544
+ },
545
+ {
546
+ "label": "COPY_TRANS",
502
547
  "kind": 14,
503
548
  "source": "builtin",
504
- "category": "tran_next",
549
+ "category": "transition",
505
550
  "documentation": {
506
551
  "kind": "markdown",
507
- "value": "```weidu-d-tooltip\nEXTERN [ IF_FILE_EXISTS ] filename stateLabel\n```\nThe dialogue continues at the state with label stateLabel in the file filename.DLG. The whole transition is not compiled if there's IF_FILE_EXISTS and the file filename doesn't exist."
552
+ "value": "```weidu-d-tooltip\nCOPY_TRANS [ SAFE ] filename stateLabel\n```\nThis instructs WeiDU to copy all of the transitions from the state with the given stateLabel in filename.DLG. This copying takes place before all other D Actions. For example, this is a valid transition list: IF ~Before()~ THEN GOTO my_state COPY_TRANS PLAYER1 33 IF ~After()~ THEN EXTERN SOLA 55 If SAFE is specified, COPY_TRANS will not warn about potentially unsafe uses (use this if you know it is safe)."
508
553
  },
509
- "detail": "EXTERN [ IF_FILE_EXISTS ] filename stateLabel"
554
+ "detail": "COPY_TRANS [ SAFE ] filename stateLabel"
510
555
  },
511
556
  {
512
- "label": "EXIT",
557
+ "label": "COPY_TRANS_LATE",
513
558
  "kind": 14,
514
559
  "source": "builtin",
515
- "category": "tran_next",
560
+ "category": "transition",
516
561
  "documentation": {
517
562
  "kind": "markdown",
518
- "value": "```weidu-d-tooltip\nEXIT\n```\nThe conversation ends."
563
+ "value": "```weidu-d-tooltip\nCOPY_TRANS_LATE [ SAFE ] filename stateLabel\n```\nSame as COPY_TRANS, but is invoked after all other D Actions."
519
564
  },
520
- "detail": "EXIT"
565
+ "detail": "COPY_TRANS_LATE [ SAFE ] filename stateLabel"
521
566
  },
522
567
  {
523
568
  "label": "IF",
524
569
  "kind": 14,
525
570
  "source": "builtin",
526
- "category": "multi",
571
+ "category": "when",
527
572
  "documentation": {
528
573
  "kind": "markdown",
529
- "value": "```weidu-d-tooltip\nIF\n```\nTransition: `IF transTriggerString [ THEN ] transFeature list transNext`\n\nIf the transTriggerString evaluates to true or is empty, this transition is viable. If it contains no replyText within its transFeature list, it is immediately taken. Otherwise, the replyText is presented as an option to the user. If the transition is taken, any actions in the transFeature list are performed and the dialogue flows to the point indicated by the transNext. transitions are evaluated in \"reverse order\".\n\n---\nAction condition: `IF String`.\n\nThe action is processed if the element being altered/replaced/added to contains a substring matching against the String regexp.\n\n---\nState: `IF [ WEIGHT #weightNumber ] stateTriggerString [ THEN ] [ BEGIN ] stateLabel SAY sayText [ = sayText ... ] transition list END`\n\n[Online documentation](https://weidu.org/~thebigg/README-WeiDU.html#state)"
530
- }
574
+ "value": "```weidu-d-tooltip\nIF String\n```\nThe action is processed if the element being altered/replaced/added to contains a substring matching against the String regexp."
575
+ },
576
+ "detail": "IF String"
531
577
  },
532
578
  {
533
- "label": "^",
579
+ "label": "UNLESS",
534
580
  "kind": 14,
535
581
  "source": "builtin",
536
- "category": "string",
582
+ "category": "when",
537
583
  "documentation": {
538
584
  "kind": "markdown",
539
- "value": "```weidu-d-tooltip\nString ^ String\n```\nString literal concatenation. The second string is appended to the first string. No whitespace is added. Thus \"hello\" ^ \"World\" is the same as \"helloWorld\"."
585
+ "value": "```weidu-d-tooltip\nUNLESS String\n```\nThe action is not processed if the element being altered/replaced/added to contains a substring matching against the String regexp."
540
586
  }
541
587
  }
542
588
  ]